Skip to content

Commit

Permalink
Merge pull request #325 from napalm-automation/bgp-conn-rejected
Browse files Browse the repository at this point in the history
BGP_CONNECTION_REJECTED and BGP_CONNECTION_RESET notifications
  • Loading branch information
mirceaulinic committed Apr 15, 2020
2 parents fb335a6 + 0c63ad0 commit 6a52625
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 1 deletion.
15 changes: 15 additions & 0 deletions napalm_logs/config/junos/BGP_CONNECTION_REJECTED.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
messages:
- error: BGP_CONNECTION_REJECTED
tag: bgp_handle_notify
values:
peer: ([\w\d:\.]+)
asn: (\d+)
peeringType: (\w+)
number: (\d+)
line: '{number}: NOTIFICATION received from {peer} ({peeringType} AS {asn}): code 6 (Cease) subcode 5 (Connection Rejected)'
model: openconfig-bgp
mapping:
variables:
bgp//neighbors//neighbor//{peer}//state//peer_as: asn
static:
bgp//neighbors//neighbor//{peer}//state//session_state: ACTIVE
14 changes: 14 additions & 0 deletions napalm_logs/config/junos/BGP_CONNECTION_RESET.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
messages:
- error: BGP_CONNECTION_RESET
tag: bgp_recv
values:
peer: ([\w\d:\.]+)
asn: (\d+)
peeringType: (\w+)
line: 'read from peer {peer} ({peeringType} AS {asn}) failed: Connection reset by peer'
model: openconfig-bgp
mapping:
variables:
bgp//neighbors//neighbor//{peer}//state//peer_as: asn
static:
bgp//neighbors//neighbor//{peer}//state//session_state: ACTIVE
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[pylama]
linters = mccabe,pep8,pyflakes
ignore = D203,C901
skip = build/*,.tox/*
skip = build/*,.tox/*,.venv/*

[pylama:pep8]
max_line_length = 120
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<172>2020-03-31T08:41:59+00:00 some-router rpd[13037]: bgp_handle_notify:4236: NOTIFICATION received from 10.0.0.1 (External AS 64512): code 6 (Cease) subcode 5 (Connection Rejected)
37 changes: 37 additions & 0 deletions tests/config/junos/BGP_CONNECTION_REJECTED/default/yang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"error": "BGP_CONNECTION_REJECTED",
"host": "some-router",
"ip": "127.0.0.1",
"timestamp": 1585644119,
"yang_message": {
"bgp": {
"neighbors": {
"neighbor": {
"10.0.0.1": {
"state": {
"peer_as": "64512",
"session_state": "ACTIVE"
}
}
}
}
}
},
"message_details": {
"date": "2020-03-31",
"time": "08:41:59+00:00",
"hostPrefix": null,
"host": "some-router",
"processName": "rpd",
"processId": "13037",
"tag": "bgp_handle_notify",
"pri": "172",
"message": "4236: NOTIFICATION received from 10.0.0.1 (External AS 64512): code 6 (Cease) subcode 5 (Connection Rejected)",
"facility": 21,
"severity": 4
},
"yang_model": "openconfig-bgp",
"os": "junos",
"facility": 21,
"severity": 4
}
1 change: 1 addition & 0 deletions tests/config/junos/BGP_CONNECTION_RESET/default/syslog.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<172>2020-03-31T08:41:59+00:00 some-router rpd[13037]: bgp_recv: read from peer fd00:1065::1 (External AS 65500) failed: Connection reset by peer
37 changes: 37 additions & 0 deletions tests/config/junos/BGP_CONNECTION_RESET/default/yang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"error": "BGP_CONNECTION_RESET",
"host": "some-router",
"ip": "127.0.0.1",
"timestamp": 1585644119,
"yang_message": {
"bgp": {
"neighbors": {
"neighbor": {
"fd00:1065::1": {
"state": {
"peer_as": "65500",
"session_state": "ACTIVE"
}
}
}
}
}
},
"message_details": {
"date": "2020-03-31",
"time": "08:41:59+00:00",
"hostPrefix": null,
"host": "some-router",
"processName": "rpd",
"processId": "13037",
"tag": "bgp_recv",
"pri": "172",
"message": "read from peer fd00:1065::1 (External AS 65500) failed: Connection reset by peer",
"facility": 21,
"severity": 4
},
"yang_model": "openconfig-bgp",
"os": "junos",
"facility": 21,
"severity": 4
}

0 comments on commit 6a52625

Please sign in to comment.