Skip to content

Commit

Permalink
Merge branch 'master' into huawei_smartax_display_mac-address_ont_0_1…
Browse files Browse the repository at this point in the history
…_2_0
  • Loading branch information
evilmonkey19 committed Sep 19, 2024
2 parents 7f67c7a + fe61e8e commit d7bbe5c
Show file tree
Hide file tree
Showing 17 changed files with 618 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ Start
^Port.*TTL -> LLDP

LLDP
# Skip the hyphen header line
^--------.*$$
^${LOCAL_INTERFACE}\s+${NEIGHBOR_NAME}\s+${NEIGHBOR_INTERFACE}\s+.* -> Record

^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ Start
^Tasks:\s+${GLOBAL_TASKS_TOTAL} total,\s+${GLOBAL_TASKS_RUNNING} running,\s+${GLOBAL_TASKS_SLEEPING} sleeping,\s+${GLOBAL_TASKS_STOPPED} stopped,\s+${GLOBAL_TASKS_ZOMBIE} zombie$$
# CPU - 1st format
# %Cpu(s): 2.8 us, 0.7 sy, 0.0 ni, 96.3 id, 0.0 wa, 0.2 hi, 0.0 si, 0.0 st
^%Cpu[(]s[)]:\s+${GLOBAL_CPU_PERCENT_USER}\sus,\s+${GLOBAL_CPU_PERCENT_SYSTEM}\ssy,\s+${GLOBAL_CPU_PERCENT_NICE}\sni,\s+${GLOBAL_CPU_PERCENT_IDLE}\sid,\s+${GLOBAL_CPU_PERCENT_IOWAIT}\swa,\s+${GLOBAL_CPU_PERCENT_HI}\shi,\s+${GLOBAL_CPU_PERCENT_SI}\ssi,\s+${GLOBAL_CPU_PERCENT_STOLEN}\sst$$
^%Cpu[(]s[)]:\s*${GLOBAL_CPU_PERCENT_USER}\sus,\s*${GLOBAL_CPU_PERCENT_SYSTEM}\ssy,\s*${GLOBAL_CPU_PERCENT_NICE}\sni,\s*${GLOBAL_CPU_PERCENT_IDLE}\sid,\s*${GLOBAL_CPU_PERCENT_IOWAIT}\swa,\s*${GLOBAL_CPU_PERCENT_HI}\shi,\s*${GLOBAL_CPU_PERCENT_SI}\ssi,\s*${GLOBAL_CPU_PERCENT_STOLEN}\sst$$
# CPU - 2nd format
# Cpu(s): 12.5%us, 2.3%sy, 0.0%ni, 84.5%id, 0.0%wa, 0.7%hi, 0.1%si, 0.0%st
^Cpu[(]s[)]:\s+${GLOBAL_CPU_PERCENT_USER}%us,\s+${GLOBAL_CPU_PERCENT_SYSTEM}%sy,\s+${GLOBAL_CPU_PERCENT_NICE}%ni,\s+${GLOBAL_CPU_PERCENT_IDLE}%id,\s+${GLOBAL_CPU_PERCENT_IOWAIT}%wa,\s+${GLOBAL_CPU_PERCENT_HI}%hi,\s+${GLOBAL_CPU_PERCENT_SI}%si,\s+${GLOBAL_CPU_PERCENT_STOLEN}%st$$
^Cpu[(]s[)]:\s*${GLOBAL_CPU_PERCENT_USER}%us,\s*${GLOBAL_CPU_PERCENT_SYSTEM}%sy,\s*${GLOBAL_CPU_PERCENT_NICE}%ni,\s*${GLOBAL_CPU_PERCENT_IDLE}%id,\s*${GLOBAL_CPU_PERCENT_IOWAIT}%wa,\s*${GLOBAL_CPU_PERCENT_HI}%hi,\s*${GLOBAL_CPU_PERCENT_SI}%si,\s*${GLOBAL_CPU_PERCENT_STOLEN}%st$$
# Memory - 1st format
# KiB Mem: 2014520 total, 1970928 used, 43592 free, 171340 buffers
^${GLOBAL_MEM_UNIT}\s+Mem.*:\s+${GLOBAL_MEM_TOTAL}\stotal,\s+${GLOBAL_MEM_USED}\sused,\s+${GLOBAL_MEM_FREE}\sfree,\s+${GLOBAL_MEM_BUFFERS}\sbuffers$$
Expand All @@ -77,7 +77,7 @@ Start
^${GLOBAL_SWAP_MEM_UNIT}\s+Swap.*:\s+${GLOBAL_SWAP_MEM_TOTAL}\stotal,\s+${GLOBAL_SWAP_MEM_USED}\sused,\s+${GLOBAL_SWAP_MEM_FREE}\sfree,\s+${GLOBAL_SWAP_MEM_CACHED}\scached$$
# Swap - 2nd format
# MiB Swap: 0.0 total, 0.0 free, 0.0 used. 5325.2 avail Mem
^${GLOBAL_SWAP_MEM_UNIT}\s+Swap.*:\s+${GLOBAL_SWAP_MEM_TOTAL}\stotal,\s+${GLOBAL_SWAP_MEM_FREE}\sfree,\s+${GLOBAL_SWAP_MEM_USED}\sused.\s+${GLOBAL_SWAP_MEM_CACHED}\savail Mem$$
^${GLOBAL_SWAP_MEM_UNIT}\s+Swap.*:\s+${GLOBAL_SWAP_MEM_TOTAL}\stotal,\s+${GLOBAL_SWAP_MEM_FREE}\sfree,\s+${GLOBAL_SWAP_MEM_USED}\sused.\s+${GLOBAL_SWAP_MEM_CACHED}\savail Mem\s*$$
# Swap - 3rd format
# Swap: 0k total, 0k used, 0k free, 1521744k cached
^Swap.*:\s+${GLOBAL_SWAP_MEM_TOTAL}${GLOBAL_SWAP_MEM_UNIT}\stotal,\s+${GLOBAL_SWAP_MEM_USED}[kmgt]\sused,\s+${GLOBAL_SWAP_MEM_FREE}[kmgt]\sfree,\s+${GLOBAL_SWAP_MEM_CACHED}[kmgt]\scached$$
Expand All @@ -86,4 +86,4 @@ Start
^\s*PID\s+USER\s+PR\s+NI\s+VIRT\s+RES\s+SHR\s+S\s+.CPU\s+.MEM\s+TIME.\s+COMMAND\s*$$
# Process line items in table
^\s*${PID}\s+${USER}\s*${PRIORITY}\s*${NICE}\s+${VIRTUAL_MEMORY_SIZE}\s+${RESIDENT_MEMORY_SIZE}\s+${SHARED_MEMORY_SIZE}\s+${PROCESS_STATUS}\s+${PERCENT_CPU}\s+${PERCENT_MEMORY}\s+${CPU_TIME}\s+${COMMAND}\s*$$ -> Record
^. -> Error
^. -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Start
^\s+Security
^\s+Split
^\s+ICMP
^\s+IP\s+(?:fast|Flow|CEF|Null|multicast|route|output|access|Clear)
^\s+IP\s+(?:fast|Fast|Flow|Normal|CEF|Null|multicast|route|output|access|Clear)
^\s+Downstream
^\s+Associated
^\s+Topology
Expand Down
1 change: 1 addition & 0 deletions ntc_templates/templates/cisco_ios_show_vlans.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Data
Interface
^\s*${INTERFACES}\s*$$
^\s*\S+\s+\(\S+\)$$
^\s*$$
^\s+Total\s+\d+\s+
^\s+IP\:\s+${IP_ADDRESSES}
^\s+IPv6\:\s+${IPV6_ADDRESSES}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Value Key ONT_ID (\d+)
Value ONT_PORT_ID (\d+)
Value ONT_PORT_TYPE (\S+)
Value SPEED_MBPS (\S+)
Value DUPLEX (\S+)
Value LINK_STATE (up|down)
Value RING_STATUS (\S+)

Start
^\s+ONT-ID\s+ONT\s*ONT\s*Speed\(Mbps\)\s*Duplex\s*LinkState\s*RingStatus\s*$$
^\s+port-ID\s*Port-type\s*$$
^\s+${ONT_ID}\s+${ONT_PORT_ID}\s+${ONT_PORT_TYPE}\s*(-|${SPEED_MBPS})\s*(-|${DUPLEX})\s*${LINK_STATE}\s*${RING_STATUS} -> Record
^\s+-
^. -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ Value STATE (\S+)
Start
^Switch-Oriented\s*Flow\s*List
^\s*-
^\s*INDEX\s+VLAN\s+VLAN\s+PORT\s+F\/\s*S\/\s*P\s*VPI\s*VCI\s*FLOW\s*FLOW\s*RX\s*TX\s*STATE
^\s*ID\s*ATTR\s*TYPE\s*TYPE\s*PARA -> ServicePorts
^\s*INDEX\s+VLAN\s+VLAN\s+PORT\s+F\/\s*S\/\s*P\s*VPI\s*VCI\s*FLOW\s*FLOW\s*RX\s*TX\s*STATE\s*$$
^\s*ID\s*ATTR\s*TYPE\s*TYPE\s*PARA\s*$$ -> ServicePorts
^\s*$$
^. -> Error

ServicePorts
^\s*${INDEX}\s*${VLAN_ID}\s*${VLAN_ATTR}\s*${PORT_TYPE}\s*${FSP}\s*${ONT_ID}\s*${GEM_INDEX}\s*${FLOW_TYPE}\s*${VLAN_ACCESS}\s*(-|${RX})\s*(-|${TX})\s*${STATE} -> Record
^\s*${INDEX}\s*${VLAN_ID}\s*${VLAN_ATTR}\s*${PORT_TYPE}\s*${FSP}\s*${ONT_ID}\s*${GEM_INDEX}\s*${FLOW_TYPE}\s*${VLAN_ACCESS}\s*(-|${RX})\s*(-|${TX})\s*${STATE}\s* -> Record
^\s*.
^\s*$$
^. -> Error
2 changes: 1 addition & 1 deletion ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ hp_procurve_show_ip.textfsm, .*, hp_procurve, sh[[ow]] ip
huawei_smartax_display_ont_info_summary_ont.textfsm:huawei_smartax_display_ont_info_summary_sn.textfsm, .*, huawei_smartax, di[[splay]] ont i[[nfo]] su[[mmary]] \S+ *$
huawei_smartax_display_ont_info_0_1_2.textfsm:huawei_smartax_display_ont_info_description.textfsm, .*, huawei_smartax, di[[splay]] ont i[[nfo]] (\d+\s*|\d+ \d+ \d+\s*)\s*[[all]] *$
huawei_smartax_display_ont_port_vlan_0_1_byport_eth_0.textfsm, .*, huawei_smartax, di[[splay]] ont p[[ort]] vl[[an]] \d+ \d+ byport eth \d+\s*
huawei_smartax_display_ont_port_state_0_1_eth-port.textfsm, .*, huawei_smartax, di[[splay]] on[[t]] por[[t]] st[[ate]] \d+ \d+ e[[th-port]]
huawei_smartax_display_ont_port_state_0_1_eth-state.textfsm, .*, huawei_smartax, di[[splay]] on[[t]] por[[t]] st[[ate]] \d+ \d+ e[[th-port]]
huawei_smartax_display_ont_port_vlan_0_1_byvlan_0.textfsm, .*, huawei_smartax, di[[splay]] ont p[[ort]] v[[lan]] \d+ \d+ byvlan \d+
huawei_smartax_display_mac-address_ont_0_1_2_0.textfsm, .*, huawei_smartax, di[[splay]] mac-a[[ddress]] o[[nt]] \d+(\/)?\s*\d+(\/)?\s*\d+ \d+ *$
huawei_smartax_display_ont_optical-info_0_all.textfsm, .*, huawei_smartax, di[[splay]] ont o[[ptical-info]] \d+ all
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Last table change time : 5 days, 8:24:38 ago
Number of table inserts : 9
Number of table deletes : 3
Number of table drops : 0
Number of table age-outs : 3
Port Neighbor Device ID Neighbor Port ID TTL
---------- ------------------------ ---------------------- ---
Et2 arista2 Ethernet2 120
Et3 arista2 Ethernet3 120
Et4 arista2 Ethernet4 120
Et5 arista2 Ethernet5 120
Et6 arista2 Ethernet6 120
Et7 arista2 Ethernet7 120
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
parsed_sample:
- neighbor_name: "arista2"
local_interface: "Et2"
neighbor_interface: "Ethernet2"
- neighbor_name: "arista2"
local_interface: "Et3"
neighbor_interface: "Ethernet3"
- neighbor_name: "arista2"
local_interface: "Et4"
neighbor_interface: "Ethernet4"
- neighbor_name: "arista2"
local_interface: "Et5"
neighbor_interface: "Ethernet5"
- neighbor_name: "arista2"
local_interface: "Et6"
neighbor_interface: "Ethernet6"
- neighbor_name: "arista2"
local_interface: "Et7"
neighbor_interface: "Ethernet7"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
top - 18:31:25 up 203 days, 9:59, 1 user, load average: 0.18, 0.20, 0.20
Tasks: 143 total, 1 running, 142 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 3906.5 total, 1284.1 free, 617.5 used, 2005.0 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 3046.3 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
31753 pyclass 20 0 9956 5356 4700 R 0.0 0.1 0:00.06 top
1 root 20 0 15096 8404 6732 S 0.0 0.2 13:52.11 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:09.44 kthreadd
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp
6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-kblockd
8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq
9 root 20 0 0 0 0 S 0.0 0.0 20:39.06 ksoftirqd/0
10 root 20 0 0 0 0 I 0.0 0.0 1043:15 rcu_preempt
11 root 20 0 0 0 0 I 0.0 0.0 0:00.03 rcu_sched
Loading

0 comments on commit d7bbe5c

Please sign in to comment.