Skip to content

Commit

Permalink
Few corrections for the IOS config chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceaulinic committed Apr 17, 2018
1 parent 16f1d14 commit cbb6ad1
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 62 deletions.
14 changes: 0 additions & 14 deletions napalm_logs/config/ios/INTERFACE_CHANGED.yml

This file was deleted.

14 changes: 14 additions & 0 deletions napalm_logs/config/ios/INTERFACE_DOWN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Interface GigabitEthernet2, changed state to administratively down

messages:
- error: INTERFACE_DOWN
tag: LINK-5-CHANGED
values:
interface: (\w+[\.\-\d\/\w+]+)
adminStatus|upper: (\w+)
line: 'Interface {interface}, changed state to administratively {adminStatus}'
model: openconfig-interfaces
mapping:
variables:
interfaces//interface//{interface}//state//admin_status: adminStatus
static: {}
12 changes: 6 additions & 6 deletions napalm_logs/config/ios/OSPF_NEIGHBOR_DOWN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ messages:
- error: OSPF_NEIGHBOR_DOWN
tag: OSPF-5-ADJCHG
values:
neighborIP: (\d+.\d+.\d+.\d+)
interface: (\w+[\.\-\d\/\w+]+)
adjacency-state-change-reason-message: ([\w ]+)
neighborIP: ([\w\d:\.]+)
interface: ([\w\d\.]+)
adjacencyStateChangeReasonMessage: ([\w+\s?]+)
initStatus: (\w+)
line: 'Nbr {neighborIP} on {interface} from {initStatus} to DOWN, Neighbor Down: {adjacency-state-change-reason-message}'
line: 'Nbr {neighborIP} on {interface} from {initStatus} to DOWN, Neighbor Down: {adjacencyStateChangeReasonMessage}'
model: openconfig-ospf
mapping:
variables:
network-instances//network-instance//global//protocols//protocol//ospf//ospfv2//areas//area//area//interfaces//interface//{interface}//neighbors//neighbor//{neighborIP}//state//adjacency-state-change-reason-message: {adjacency-state-change-reason-message}
network-instances//network-instance//global//protocols//protocol//ospf//ospfv2//areas//area//area//interfaces//interface//{interface}//neighbors//neighbor//{neighborIP}//state//adjacency-state-change-reason-message: adjacencyStateChangeReasonMessage
static:
network-instances//network-instance//global//protocols//protocol//ospf//ospfv2//areas//area//area//interfaces//interface//{interface}//neighbors//neighbor//{neighborIP}//state//adjacency-state: DOWN
network-instances//network-instance//global//protocols//protocol//ospf//ospfv2//areas//area//area//interfaces//interface//{interface}//neighbors//neighbor//{neighborIP}//state//adjacency-state-change-reason: INACTIVE_TIMER
network-instances//network-instance//global//protocols//protocol//ospf//ospfv2//areas//area//area//interfaces//interface//{interface}//neighbors//neighbor//{neighborIP}//state//adjacency-state-change-reason: INACTIVE_TIMER
6 changes: 3 additions & 3 deletions napalm_logs/config/ios/OSPF_NEIGHBOR_UP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ messages:
- error: OSPF_NEIGHBOR_UP
tag: OSPF-5-ADJCHG
values:
neighbor: (\d+.\d+.\d+.\d+)
interface: (\w+[\.\-\d\/\w+]+)
neighbor: ([\w\d:\.]+)
interface: ([\w\d\.]+)
initStatus: (\w+)
line: 'Nbr {neighbor} on {interface} from {initStatus} to FULL, Loading Done'
model: openconfig-ospf
mapping:
variables: {}
static:
network-instances//network-instance//global//protocols//protocol//ospf//ospfv2//areas//area//area//interfaces//interface//{interface}//neighbors//neighbor//{neighbor}//state//adjacency-state: UP
network-instances//network-instance//global//protocols//protocol//ospf//ospfv2//areas//area//area//interfaces//interface//{interface}//neighbors//neighbor//{neighbor}//state//adjacency-state: UP
21 changes: 10 additions & 11 deletions napalm_logs/config/ios/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ prefixes:
- time_format: "%b %d %H:%M:%S"
values:
messageId: (\d+)
host: (\w+\d)
date: (\w+ \s?\d+)
host: ([^ ]+)
date: (\w+\s?\d+)
time: (\d\d:\d\d:\d\d)
milliseconds: (\.\d\d\d)
tag: ([\w\d-]+)
milliseconds: (\d\d\d)
tag: ([\w-]+)
# some messages contain a process number (eg. OSPF related messages)
processId: (\d+)
line: '{messageId}: {host}: *{date} {time}{milliseconds}: %{tag}: Process {processId}, '
line: '{messageId}: {host}: *{date} {time}.{milliseconds}: %{tag}: Process {processId}, '
- time_format: "%b %d %H:%M:%S"
values:
messageId: (\d+)
host: (\w+\d)
date: (\w+ [\s]?\d+)
host: ([^ ]+)
date: (\w+\s?\d+)
time: (\d\d:\d\d:\d\d)
milliseconds: (\.\d\d\d)
tag: ([\w\d-]+)
line: '{messageId}: {host}: *{date} {time}{milliseconds}: %{tag}: '

milliseconds: (\d+)
tag: ([\w-]+)
line: '{messageId}: {host}: *{date} {time}.{milliseconds}: %{tag}: '
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
"interface": {
"GigabitEthernet2": {
"state": {
"oper_status": "down"
"admin_status": "DOWN"
}
}
}
}
},
"message_details": {
"severity": 5,
"facility": 3,
"hostPrefix": null,
"facility": 23,
"pri": "189",
"processName": null,
"host": "router1",
"tag": "LINK_CHANGED",
"tag": "LINK-5-CHANGED",
"time": "08:30:56",
"date": "Nov 14",
"messageId": "521",
"milliseconds": "699",
"message": "Interface GigabitEthernet2, changed state to administratively down"
},
"timestamp": 1507969856,
"facility": 3,
"facility": 23,
"ip": "127.0.0.1",
"host": "router1",
"yang_model": "openconfig-interfaces",
"error": "INTERFACE_CHANGED",
"error": "INTERFACE_DOWN",
"os": "ios",
"severity": 4
}
"severity": 5
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#<189>521: router1: *Mar 15 10:05:53.044: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.46.4 on GigabitEthernet2.45 from INIT to DOWN, Neighbor Down: Dead timer expired
<189>521: router1: *Mar 15 10:05:53.044: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.46.4 on GigabitEthernet2.45 from INIT to DOWN, Neighbor Down: Dead timer expired
14 changes: 7 additions & 7 deletions tests/config/ios/OSPF_NEIGHBOR_DOWN/init_to_down/yang.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@
"message_details": {
"date": "Mar 15",
"time": "10:05:53",
"hostPrefix": null,
"host": "router1",
"processName": null,
"processId": "1",
"tag": "OSPF_ADJCHG",
"tag": "OSPF-5-ADJCHG",
"pri": "189",
"message": "<189>521: router1: *Mar 15 10:05:53.044: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.46.4 on GigabitEthernet2.45 from INIT to DOWN, Neighbor Down: Dead timer expired",
"facility": 3,
"messageId": "521",
"milliseconds": "044",
"message": "Nbr 172.16.46.4 on GigabitEthernet2.45 from INIT to DOWN, Neighbor Down: Dead timer expired",
"facility": 23,
"severity": 5
},
"yang_model": "openconfig-ospf",
"os": "ios",
"facility": 3,
"facility": 23,
"severity": 5,
"error": "OSPF_NEIGHBOR_DOWN",
"host": "router1",
"ip": "127.0.0.1",
"timestamp": 1521108353
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#<190>521: router1: *Mar 15 10:05:53.044: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.46.4 on GigabitEthernet2.45 from LOADING to FULL, Loading Done
<190>521: router1: *Mar 15 10:05:53.044: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.46.4 on GigabitEthernet2.45 from LOADING to FULL, Loading Done
20 changes: 10 additions & 10 deletions tests/config/ios/OSPF_NEIGHBOR_UP/loading_to_full/yang.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"neighbor": {
"172.16.46.4": {
"state": {
"adjacency-state": "FULL"
"adjacency-state": "UP"
}
}
}
Expand All @@ -39,22 +39,22 @@
"message_details": {
"date": "Mar 15",
"time": "10:05:53",
"hostPrefix": null,
"host": "router1",
"processName": null,
"processId": "1",
"tag": "OSPF_ADJCHG",
"tag": "OSPF-5-ADJCHG",
"pri": "190",
"message": "<190>521: router1: *Mar 15 10:05:53.044: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.46.4 on GigabitEthernet2.45 from LOADING to FULL, Loading Done",
"facility": 3,
"severity": 5
"messageId": "521",
"milliseconds": "044",
"message": "Nbr 172.16.46.4 on GigabitEthernet2.45 from LOADING to FULL, Loading Done",
"facility": 23,
"severity": 6
},
"yang_model": "openconfig-ospf",
"os": "ios",
"facility": 3,
"severity": 5,
"facility": 23,
"severity": 6,
"error": "OSPF_NEIGHBOR_UP",
"host": "router1",
"ip": "127.0.0.1",
"timestamp": 1521108353
}
}

0 comments on commit cbb6ad1

Please sign in to comment.