Skip to content

Commit

Permalink
Add NXOS/XR cdp detail and XR bfd session
Browse files Browse the repository at this point in the history
  • Loading branch information
itdependsnetworks committed Mar 21, 2017
1 parent cefc38e commit 8913bec
Show file tree
Hide file tree
Showing 10 changed files with 826 additions and 0 deletions.
23 changes: 23 additions & 0 deletions templates/cisco_nxos_show_cdp_neighbors_detail.template
@@ -0,0 +1,23 @@
Value Required DEST_HOST (.*)
Value SYSNAME (.*)
Value MGMT_IP (.*)
Value PLATFORM (.*)
Value REMOTE_PORT (.*)
Value LOCAL_PORT (.*)
Value VERSION (.*)

Start
^Device ID:${DEST_HOST}
^System Name: ${SYSNAME}
^Mgmt address\(es\): -> GetIP
^Platform: ${PLATFORM},
^Interface: ${REMOTE_PORT}, Port ID \(outgoing port\): ${LOCAL_PORT}
^Version: -> GetVersion
^----- -> Record

GetIP
^.*IP.+Address: ${MGMT_IP} -> Start

GetVersion
^${VERSION} -> Start

10 changes: 10 additions & 0 deletions templates/cisco_xr_show_bfd_sessions.template
@@ -0,0 +1,10 @@
Value INTERFACE (.+?)
Value DSTADDRESS (\d+\.\d+\.\d+\.\d+)
Value STATE (\S+)

Start
^\-+ -> Begin1

Begin1
^\s*${INTERFACE}\s+${DSTADDRESS}\s+\S+\s+\S+\s+${STATE} -> Record

23 changes: 23 additions & 0 deletions templates/cisco_xr_show_cdp_neighbors_detail.template
@@ -0,0 +1,23 @@
Value Required DEST_HOST (\S+)
Value SYSNAME (.*)
Value MGMT_IP (.*)
Value PLATFORM (.*)
Value REMOTE_PORT (.*)
Value LOCAL_PORT (.*)
Value VERSION (.*)

Start
^Device ID: ${DEST_HOST}
^SysName : ${SYSNAME}
^Entry address\(es\): -> GetIP
^Platform: ${PLATFORM},
^Interface: ${REMOTE_PORT}
^Port ID \(outgoing port\): ${LOCAL_PORT}
^Version : -> GetVersion

GetIP
^.*IP.+address: ${MGMT_IP} -> Start

GetVersion
^${VERSION} -> Record Start

3 changes: 3 additions & 0 deletions templates/index
Expand Up @@ -80,6 +80,7 @@ cisco_ios_dir.template, .*, cisco_ios, dir

cisco_nxos_show_ip_dhcp_relay_address.template, .*, cisco_nxos, sh[[ow]] ip dh[[cp]] r[[elay]] a[[ddress]]
cisco_nxos_show_lldp_neighbors_detail.template, .*, cisco_nxos, sh[[ow]] ll[[dp]] nei[[ghbors]] d[[etail]]
cisco_nxos_show_cdp_neighbors_detail.template, .*, cisco_nxos, sh[[ow]] c[[dp]] neig[[hbors]] det[[ail]]
cisco_nxos_show_ip_ospf_neighbor_vrf.template, .*, cisco_nxos, sh[[ow]] ip ospf nei[[ghbor]] vrf (\S+)
cisco_nxos_show_ipv6_interface_brief.template, .*, cisco_nxos, sh[[ow]] ipv[[6]] interf[[ace]] b[[rief]]
cisco_nxos_show_port-channel_summary.template, .*, cisco_nxos, sh[[ow]] po[[rt-channel]] sum[[mary]]
Expand Down Expand Up @@ -112,8 +113,10 @@ cisco_wlc_ssh_show_sysinfo.template, .*, cisco_wlc_ssh, sh[[ow]] sysi[[nfo]]

cisco_xr_show_configuration_commit_list.template, .*, cisco_xr, sh[[ow]] conf[[iguration]] c[[ommit]] l[[ist]]
cisco_xr_show_dhcp_ipv4_proxy_binding.template, .*, cisco_xr, sh[[ow]] dh[[cp]] ipv4 p[[roxy]] b[[inding]]
cisco_xr_show_cdp_neighbors_detail.template, .*, cisco_xr, sh[[ow]] c[[dp]] neig[[hbors]] det[[ail]]
cisco_xr_show_isis_neighbors.template, .*, cisco_xr, sh[[ow]] isis ne[[ighbors]]
cisco_xr_show_ospf_neighbor.template, .*, cisco_xr, sh[[ow]] ospf nei[[ghbor]]
cisco_xr_show_bfd_sessions.template, .*, cisco_xr, sh[[ow]] bf[[d]] sess[[ions]]

dell_force10_show_vlan_brief.template, .*, dell_force10, sh[[ow]] vl[[an]] br[[ief]]
dell_force10_show_version.template, .*, dell_force10, sh[[ow]] ver[[sion]]
Expand Down
@@ -0,0 +1,39 @@
---
parsed_sample:

- dest_host: PERIMETER
local_port: FastEthernet1/0/32
mgmt_ip: 10.1.100.1
platform: cisco WS-C3750-48TS
remote_port: mgmt0
sysname: ''
version: Cisco IOS Software, C3750 Software (C3750-IPBASEK9-M), Version 12.2(44)SE2,
RELEASE SOFTWARE (fc2)
- dest_host: dc-lf03(SAL19069XXX)
local_port: Ethernet1/1
mgmt_ip: 10.1.100.226
platform: N9K-C9372TX
remote_port: Ethernet1/1
sysname: dc-lf03
version: Cisco Nexus Operating System (NX-OS) Software, Version 7.0(3)I5(1)
- dest_host: dc-lf03(SAL1906XXXX)
local_port: Ethernet1/3
mgmt_ip: 10.1.100.226
platform: N9K-C9372TX
remote_port: Ethernet1/3
sysname: dc-lf03
version: Cisco Nexus Operating System (NX-OS) Software, Version 7.0(3)I5(1)
- dest_host: dc-sp01(SAL19069XXX)
local_port: Ethernet1/52
mgmt_ip: 10.1.100.222
platform: N9K-C9372TX
remote_port: Ethernet1/49
sysname: dc-sp01
version: Cisco Nexus Operating System (NX-OS) Software, Version 7.0(3)I2(2d)
- dest_host: dc-sp02(SAL19069XXX)
local_port: Ethernet1/52
mgmt_ip: 10.1.100.223
platform: N9K-C9372TX
remote_port: Ethernet1/50
sysname: dc-sp02
version: Cisco Nexus Operating System (NX-OS) Software, Version 7.0(3)I2(2d)
@@ -0,0 +1,109 @@
----------------------------------------
Device ID:PERIMETER
VTP Management Domain Name: null

Interface address(es):
IPv4 Address: 10.1.100.1
Platform: cisco WS-C3750-48TS, Capabilities: Router Switch IGMP Filtering
Interface: mgmt0, Port ID (outgoing port): FastEthernet1/0/32
Holdtime: 134 sec

Version:
Cisco IOS Software, C3750 Software (C3750-IPBASEK9-M), Version 12.2(44)SE2, RELEASE SOFTWARE (fc2)
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Thu 01-May-08 15:42 by antonino

Advertisement Version: 2

Native VLAN: 100
Duplex: full
Mgmt address(es):
IPv4 Address: 10.1.100.1
----------------------------------------
Device ID:dc-lf03(SAL19069XXX)
System Name: dc-lf03

Interface address(es):
IPv4 Address: 10.1.100.226
Platform: N9K-C9372TX, Capabilities: Router Switch IGMP Filtering Supports-STP-Dispute
Interface: Ethernet1/1, Port ID (outgoing port): Ethernet1/1
Holdtime: 157 sec

Version:
Cisco Nexus Operating System (NX-OS) Software, Version 7.0(3)I5(1)

Advertisement Version: 2

Native VLAN: 1
Duplex: full

MTU: 1500
Physical Location: snmplocation
Mgmt address(es):
IPv4 Address: 10.1.100.226
----------------------------------------
Device ID:dc-lf03(SAL1906XXXX)
System Name: dc-lf03

Interface address(es):
IPv4 Address: 10.1.100.226
Platform: N9K-C9372TX, Capabilities: Router Switch IGMP Filtering Supports-STP-Dispute
Interface: Ethernet1/3, Port ID (outgoing port): Ethernet1/3
Holdtime: 157 sec

Version:
Cisco Nexus Operating System (NX-OS) Software, Version 7.0(3)I5(1)

Advertisement Version: 2

Native VLAN: 1
Duplex: full

MTU: 1500
Physical Location: snmplocation
Mgmt address(es):
IPv4 Address: 10.1.100.226
----------------------------------------
Device ID:dc-sp01(SAL19069XXX)
System Name: dc-sp01

Interface address(es):
IPv4 Address: 10.1.1.1
Platform: N9K-C9372TX, Capabilities: Router Switch IGMP Filtering Supports-STP-Dispute
Interface: Ethernet1/49, Port ID (outgoing port): Ethernet1/52
Holdtime: 166 sec

Version:
Cisco Nexus Operating System (NX-OS) Software, Version 7.0(3)I2(2d)

Advertisement Version: 2

Native VLAN: 1
Duplex: full

MTU: 1500
Physical Location: NY-DC
Mgmt address(es):
IPv4 Address: 10.1.100.222
----------------------------------------
Device ID:dc-sp02(SAL19069XXX)
System Name: dc-sp02

Interface address(es):
IPv4 Address: 10.1.1.9
Platform: N9K-C9372TX, Capabilities: Router Switch IGMP Filtering Supports-STP-Dispute
Interface: Ethernet1/50, Port ID (outgoing port): Ethernet1/52
Holdtime: 166 sec

Version:
Cisco Nexus Operating System (NX-OS) Software, Version 7.0(3)I2(2d)

Advertisement Version: 2

Native VLAN: 1
Duplex: full

MTU: 1500
Physical Location: NY-DC
Mgmt address(es):
IPv4 Address: 10.1.100.223
21 changes: 21 additions & 0 deletions tests/cisco_xr/show_bfd_sessions/cisco_xr_show_bfd_sessions.parsed
@@ -0,0 +1,21 @@
---
parsed_sample:

- dstaddress: 10.100.100.141
interface: Fo0/0/1/0
state: UP
- dstaddress: 10.100.100.19
interface: Fo0/0/0/0
state: UP
- dstaddress: 10.100.100.125
interface: Fo0/0/0/1
state: UP
- dstaddress: 10.100.100.113
interface: Fo0/1/0/0
state: UP
- dstaddress: 10.100.100.145
interface: Fo0/1/1/0
state: UP
- dstaddress: 10.100.100.129
interface: Fo0/2/1/1
state: UP
15 changes: 15 additions & 0 deletions tests/cisco_xr/show_bfd_sessions/cisco_xr_show_bfd_sessions.raw
@@ -0,0 +1,15 @@
Interface Dest Addr Local det time(int*mult) State
Echo Async H/W NPU
------------------- --------------- ---------------- ---------------- ----------
Fo0/0/1/0 10.100.100.141 45ms(15ms*3) 6s(2s*3) UP
No n/a
Fo0/0/0/0 10.100.100.19 45ms(15ms*3) 6s(2s*3) UP
No n/a
Fo0/0/0/1 10.100.100.125 45ms(15ms*3) 6s(2s*3) UP
No n/a
Fo0/1/0/0 10.100.100.113 45ms(15ms*3) 6s(2s*3) UP
No n/a
Fo0/1/1/0 10.100.100.145 45ms(15ms*3) 6s(2s*3) UP
No n/a
Fo0/2/1/1 10.100.100.129 45ms(15ms*3) 6s(2s*3) UP
No n/a

0 comments on commit 8913bec

Please sign in to comment.