Skip to content

Commit

Permalink
add new template show port-security interface (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkala authored Mar 15, 2021
1 parent 3e81aef commit 1d24b2d
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Value PORT_SECURITY (\w+)
Value PORT_STATUS (\S+)
Value VIOLATION_MODE ([Pp]rotect|[Rr]estrict|[Ss]hutdown)
Value AGING_TIME (\d{1,4}\smins)
Value AGING_TYPE ([Aa]bsolute|[Ii]nactivity)
Value SS_ADDR_AGING (\w+)
Value MAX_MAC_ADDRS (\d+)
Value TOTAL_MAC_ADDRS (\d+)
Value CONFIG_MAC_ADDRS (\d+)
Value STICKY_MAC_ADDRS (\d+)
Value LAST_SRC_MAC_ADDR_VLAN (\d.+:\d+)
Value VIOLATION_COUNT (\d+)

Start
^Port Security\s+:\s+${PORT_SECURITY}
^Port Status\s+:\s+${PORT_STATUS}
^Violation Mode\s+:\s+${VIOLATION_MODE}
^Aging Time\s+:\s+${AGING_TIME}
^Aging Type\s+:\s+${AGING_TYPE}
^SecureStatic Address Aging\s+:\s+${SS_ADDR_AGING}
^Maximum MAC Addresses\s+:\s+${MAX_MAC_ADDRS}
^Total MAC Addresses\s+:\s+${TOTAL_MAC_ADDRS}
^Configured MAC Addresses\s+:\s+${CONFIG_MAC_ADDRS}
^Sticky MAC Addresses\s+:\s+${STICKY_MAC_ADDRS}
^Last Source Address:Vlan\s+:\s+${LAST_SRC_MAC_ADDR_VLAN}
^Security Violation Count\s+:\s+${VIOLATION_COUNT}
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ cisco_ios_show_switch_detail.textfsm:cisco_ios_show_switch_detail_stack_ports.te
cisco_ios_show_running-config_partition_access-list.textfsm, .*, cisco_ios, sh[[ow]] ru[[nning-config]] p[[artition]] a[[ccess-list]]
cisco_ios_show_ip_bgp_neighbors_advertised-routes.textfsm, .*, cisco_ios, sh[[ow]] ip bgp nei[[ghbors]](\s+\d+\.\d+\.\d+\.\d+)? adv[[ertised-routes]]
cisco_ios_show_running-config_partition_route-map.textfsm, .*, cisco_ios, sh[[ow]] ru[[nning-config]] p[[artition]] route-[[map]]
cisco_ios_show_port-security_interface_interface.textfsm, .*, cisco_ios, sh[[ow]] por[[t-security]] i[[nterface]] (\S+)
cisco_ios_show_capability_feature_routing.textfsm, .*, cisco_ios, sh[[ow]] cap[[ability]] f[[eature]] r[[outing]]
cisco_ios_show_ip_ospf_database_network.textfsm, .*, cisco_ios, sh[[ow]] ip ospf data[[base]] ne[[twork]]
cisco_ios_show_authentication_sessions.textfsm, .*, cisco_ios, show authen[[tication]] ses[[sions]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Port Security : Disabled
Port Status : Secure-down
Violation Mode : Shutdown
Aging Time : 1440 mins
Aging Type : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses : 1
Total MAC Addresses : 0
Configured MAC Addresses : 0
Sticky MAC Addresses : 0
Last Source Address:Vlan : 0000.0000.0000:0
Security Violation Count : 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- port_security: "Disabled"
port_status: "Secure-down"
violation_mode: "Shutdown"
aging_time: "1440 mins"
aging_type: "Absolute"
ss_addr_aging: "Disabled"
max_mac_addrs: "1"
total_mac_addrs: "0"
config_mac_addrs: "0"
sticky_mac_addrs: "0"
last_src_mac_addr_vlan: "0000.0000.0000:0"
violation_count: "0"

0 comments on commit 1d24b2d

Please sign in to comment.