Skip to content

Commit d7c0cbf

Browse files
authored
Merge pull request #366 from napalm-automation/FAILED_ALLOCATING_PACKET_BUFFER
New message matcher on FAILED_ALLOCATING_PACKET_BUFFER notification
2 parents d409589 + 1d293d6 commit d7c0cbf

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
messages:
2+
- error: FAILED_ALLOCATING_PACKET_BUFFER
3+
tag: fpc0
4+
values: {}
5+
line: '(buf alloc) failed allocating packet buffer'
6+
model: NO_MODEL
7+
mapping:
8+
static: {}
9+
variables: {}

napalm_logs/config/junos/init.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ prefixes:
5858
# Some logs have data which can be inside brackets or parenthesis
5959
additionalData: (?:(?:\[|\()(.+)(?:\]|\)))?
6060
line: '{date} {time} {hostPrefix}{host} fpc{fpcId} fpc{fpcId2} dcpfe: {tag}{additionalData}:'
61+
- time_format: "%b %d %H:%M:%S"
62+
values:
63+
date: (\w+\s+\d+)
64+
time: (\d\d:\d\d:\d\d)
65+
hostPrefix: (re\d.)?
66+
host: ([^ ]+)
67+
tag: (fpc\d)
68+
line: '{date} {time} {hostPrefix}{host} {tag}'
6169

6270
# Same structures as above, but to match the ISO8601 date-time format.
6371
# jlaunchd doesn't have proper tags. Override the match to use jlaunchd as the tag instead.
@@ -114,3 +122,11 @@ prefixes:
114122
# Some logs have data which can be inside brackets or parenthesis
115123
additionalData: (?:(?:\[|\()(.+)(?:\]|\)))?
116124
line: '{date}T{time} {hostPrefix}{host} fpc{fpcId} fpc{fpcId2} dcpfe: {tag}{additionalData}:'
125+
- time_format: "%b %d %H:%M:%S"
126+
values:
127+
date: (\d{4}-\d{2}-\d{2})
128+
time: (\d{2}:\d{2}:\d{2}[\.\d{3}]?[\+|-]\d{2}:\d{2})
129+
hostPrefix: (re\d.)?
130+
host: ([^ ]+)
131+
tag: (fpc\d)
132+
line: '{date}T{time} {hostPrefix}{host} {tag}'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<7>Dec 10 00:00:01 some-switch fpc0 (buf alloc) failed allocating packet buffer
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"error": "FAILED_ALLOCATING_PACKET_BUFFER",
3+
"host": "some-switch",
4+
"ip": "127.0.0.1",
5+
"timestamp": 1639094401,
6+
"yang_message": {},
7+
"message_details": {
8+
"date": "Dec 10",
9+
"time": "00:00:01",
10+
"hostPrefix": null,
11+
"host": "some-switch",
12+
"tag": "fpc0",
13+
"pri": "7",
14+
"message": "(buf alloc) failed allocating packet buffer",
15+
"facility": 0,
16+
"severity": 7
17+
},
18+
"yang_model": "NO_MODEL",
19+
"os": "junos",
20+
"facility": 0,
21+
"severity": 7
22+
}

0 commit comments

Comments
 (0)