From a786dae8dcdf90da1ba197044cd2c198ccc4970d Mon Sep 17 00:00:00 2001 From: Hugo Tinoco <43675476+h4ndzdatm0ld@users.noreply.github.com> Date: Sat, 15 May 2021 07:11:45 +0000 Subject: [PATCH 1/2] sros_system_cpu --- .../alcatel_sros_show_system_cpu.textfsm | 27 +++ ntc_templates/templates/index | 1 + .../alcatel_sros_show_system_cpu.raw | 58 +++++ .../alcatel_sros_show_system_cpu.yml | 202 ++++++++++++++++++ 4 files changed, 288 insertions(+) create mode 100644 ntc_templates/templates/alcatel_sros_show_system_cpu.textfsm create mode 100644 tests/alcatel_sros/show_system_cpu/alcatel_sros_show_system_cpu.raw create mode 100644 tests/alcatel_sros/show_system_cpu/alcatel_sros_show_system_cpu.yml diff --git a/ntc_templates/templates/alcatel_sros_show_system_cpu.textfsm b/ntc_templates/templates/alcatel_sros_show_system_cpu.textfsm new file mode 100644 index 0000000000..be9383a28d --- /dev/null +++ b/ntc_templates/templates/alcatel_sros_show_system_cpu.textfsm @@ -0,0 +1,27 @@ +Value NAME (\S.*?) +Value CPU_TIME (\S+) +Value CPU_USAGE (\S+) +Value CAPACITY_USAGE (\S+) + +Start + ^=+ + ^CPU\sUtil.+ + ^Name\s+CPU\s+Time\s+CPU\s+Usage\s+Capacity\s*$$ + ^\s+\(uSec\)\s+Usage + ^--.+ -> Resources + ^\s*$$ + ^. -> Error + +Resources + ^${NAME}\s{4,}${CPU_TIME}\s+${CPU_USAGE}\s+${CAPACITY_USAGE}\s*$$ -> Record + ^--.+ -> Total + ^\s*$$ + ^. -> Error + +Total + ^${NAME}\s{4,}${CPU_TIME}\s+${CPU_USAGE}\s+ -> Record + ^\s+${NAME}\s{4,}${CPU_TIME}\s+${CPU_USAGE}\s+ -> Record + ^=+ -> Done + ^. -> Error + +Done \ No newline at end of file diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index e33bb43f98..562e80ea4b 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -27,6 +27,7 @@ alcatel_sros_show_router_interface.textfsm, .*, alcatel_sros, sh[[ow]] router (\ alcatel_sros_show_router_mpls_lsp.textfsm, .*, alcatel_sros, sh[[ow]] router mpls lsp alcatel_sros_show_service_id_base.textfsm, .*, alcatel_sros, sh[[ow]] serv[[ice]] id ba[[se]] alcatel_sros_show_service_sdp.textfsm, .*, alcatel_sros, sh[[ow]] service sdp +alcatel_sros_show_system_cpu.textfsm, .*, alcatel_sros, sh[[ow]] system cpu alcatel_sros_oam_mac-ping.textfsm, .*, alcatel_sros, oam mac-pi[[ng]] alcatel_sros_show_port.textfsm, .*, alcatel_sros, show port alcatel_sros_show_lag.textfsm, .*, alcatel_sros, show lag diff --git a/tests/alcatel_sros/show_system_cpu/alcatel_sros_show_system_cpu.raw b/tests/alcatel_sros/show_system_cpu/alcatel_sros_show_system_cpu.raw new file mode 100644 index 0000000000..bbfda6bcce --- /dev/null +++ b/tests/alcatel_sros/show_system_cpu/alcatel_sros_show_system_cpu.raw @@ -0,0 +1,58 @@ +=============================================================================== +CPU Utilization (Sample period: 1 second) +=============================================================================== +Name CPU Time CPU Usage Capacity + (uSec) Usage +------------------------------------------------------------------------------- +BFD 189 0.01% 0.01% +BGP 20 ~0.00% ~0.00% +BGP PE-CE 0 0.00% 0.00% +BIER 0 0.00% 0.00% +CFLOWD 48 ~0.00% ~0.00% +Cards & Ports 2,311 0.23% 0.10% +DHCP Server 11 ~0.00% ~0.00% +ETH-CFM 244 0.02% 0.02% +HQoS Algorithm 102 0.01% 0.01% +HQoS Statistics 653 0.06% 0.06% +ICC 524 0.05% 0.03% +IGMP/MLD 78 ~0.00% ~0.00% +IMSI Db Appl 128 0.01% 0.01% +IOM 37,866 3.78% 2.15% +IP Stack 3,554 0.35% 0.22% +IS-IS 298 0.02% 0.01% +ISA 1,093 0.10% 0.03% +LDP 433 0.04% 0.02% +Logging 15 ~0.00% ~0.00% +MBUF 0 0.00% 0.00% +MCS 83 ~0.00% ~0.00% +MPLS/RSVP 1,230 0.12% 0.05% +MSCP 0 0.00% 0.00% +MSDP 0 0.00% 0.00% +Management 25,404 2.53% 1.84% +OAM 1,759 0.17% 0.05% +OSPF 815 0.08% 0.02% +OpenFlow 30 ~0.00% ~0.00% +PIM/L2Mcast 0 0.00% 0.00% +PKI 24 ~0.00% ~0.00% +PTP 8 ~0.00% ~0.00% +RIP 0 0.00% 0.00% +RTM/Policies 0 0.00% 0.00% +Redundancy 0 0.00% 0.00% +SIM 4,086 0.40% 0.39% +SNMP Daemon 0 0.00% 0.00% +Security 0 0.00% 0.00% +Services 1,246 0.12% 0.04% +Stats 0 0.00% 0.00% +Stats-Extended 0 0.00% 0.00% +Subscriber Mgmt 834 0.08% 0.01% +System 52,774 5.27% 2.63% +Traffic Eng 0 0.00% 0.00% +Tree Sid 0 0.00% 0.00% +VRRP 227 0.02% 0.01% +WEB Redirect 107 0.01% ~0.00% +------------------------------------------------------------------------------- +Total 1,001,337 100.00% + Idle 865,143 86.39% + Usage 136,194 13.60% +Busiest Core Utilization 136,194 13.60% +=============================================================================== diff --git a/tests/alcatel_sros/show_system_cpu/alcatel_sros_show_system_cpu.yml b/tests/alcatel_sros/show_system_cpu/alcatel_sros_show_system_cpu.yml new file mode 100644 index 0000000000..7c39836720 --- /dev/null +++ b/tests/alcatel_sros/show_system_cpu/alcatel_sros_show_system_cpu.yml @@ -0,0 +1,202 @@ +--- +parsed_sample: + - name: "BFD" + cpu_time: "189" + cpu_usage: "0.01%" + capacity_usage: "0.01%" + - name: "BGP" + cpu_time: "20" + cpu_usage: "~0.00%" + capacity_usage: "~0.00%" + - name: "BGP PE-CE" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "BIER" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "CFLOWD" + cpu_time: "48" + cpu_usage: "~0.00%" + capacity_usage: "~0.00%" + - name: "Cards & Ports" + cpu_time: "2,311" + cpu_usage: "0.23%" + capacity_usage: "0.10%" + - name: "DHCP Server" + cpu_time: "11" + cpu_usage: "~0.00%" + capacity_usage: "~0.00%" + - name: "ETH-CFM" + cpu_time: "244" + cpu_usage: "0.02%" + capacity_usage: "0.02%" + - name: "HQoS Algorithm" + cpu_time: "102" + cpu_usage: "0.01%" + capacity_usage: "0.01%" + - name: "HQoS Statistics" + cpu_time: "653" + cpu_usage: "0.06%" + capacity_usage: "0.06%" + - name: "ICC" + cpu_time: "524" + cpu_usage: "0.05%" + capacity_usage: "0.03%" + - name: "IGMP/MLD" + cpu_time: "78" + cpu_usage: "~0.00%" + capacity_usage: "~0.00%" + - name: "IMSI Db Appl" + cpu_time: "128" + cpu_usage: "0.01%" + capacity_usage: "0.01%" + - name: "IOM" + cpu_time: "37,866" + cpu_usage: "3.78%" + capacity_usage: "2.15%" + - name: "IP Stack" + cpu_time: "3,554" + cpu_usage: "0.35%" + capacity_usage: "0.22%" + - name: "IS-IS" + cpu_time: "298" + cpu_usage: "0.02%" + capacity_usage: "0.01%" + - name: "ISA" + cpu_time: "1,093" + cpu_usage: "0.10%" + capacity_usage: "0.03%" + - name: "LDP" + cpu_time: "433" + cpu_usage: "0.04%" + capacity_usage: "0.02%" + - name: "Logging" + cpu_time: "15" + cpu_usage: "~0.00%" + capacity_usage: "~0.00%" + - name: "MBUF" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "MCS" + cpu_time: "83" + cpu_usage: "~0.00%" + capacity_usage: "~0.00%" + - name: "MPLS/RSVP" + cpu_time: "1,230" + cpu_usage: "0.12%" + capacity_usage: "0.05%" + - name: "MSCP" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "MSDP" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "Management" + cpu_time: "25,404" + cpu_usage: "2.53%" + capacity_usage: "1.84%" + - name: "OAM" + cpu_time: "1,759" + cpu_usage: "0.17%" + capacity_usage: "0.05%" + - name: "OSPF" + cpu_time: "815" + cpu_usage: "0.08%" + capacity_usage: "0.02%" + - name: "OpenFlow" + cpu_time: "30" + cpu_usage: "~0.00%" + capacity_usage: "~0.00%" + - name: "PIM/L2Mcast" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "PKI" + cpu_time: "24" + cpu_usage: "~0.00%" + capacity_usage: "~0.00%" + - name: "PTP" + cpu_time: "8" + cpu_usage: "~0.00%" + capacity_usage: "~0.00%" + - name: "RIP" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "RTM/Policies" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "Redundancy" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "SIM" + cpu_time: "4,086" + cpu_usage: "0.40%" + capacity_usage: "0.39%" + - name: "SNMP Daemon" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "Security" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "Services" + cpu_time: "1,246" + cpu_usage: "0.12%" + capacity_usage: "0.04%" + - name: "Stats" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "Stats-Extended" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "Subscriber Mgmt" + cpu_time: "834" + cpu_usage: "0.08%" + capacity_usage: "0.01%" + - name: "System" + cpu_time: "52,774" + cpu_usage: "5.27%" + capacity_usage: "2.63%" + - name: "Traffic Eng" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "Tree Sid" + cpu_time: "0" + cpu_usage: "0.00%" + capacity_usage: "0.00%" + - name: "VRRP" + cpu_time: "227" + cpu_usage: "0.02%" + capacity_usage: "0.01%" + - name: "WEB Redirect" + cpu_time: "107" + cpu_usage: "0.01%" + capacity_usage: "~0.00%" + - name: "Total" + cpu_time: "1,001,337" + cpu_usage: "100.00%" + capacity_usage: "" + - name: "Idle" + cpu_time: "865,143" + cpu_usage: "86.39%" + capacity_usage: "" + - name: "Usage" + cpu_time: "136,194" + cpu_usage: "13.60%" + capacity_usage: "" + - name: "Busiest Core Utilization" + cpu_time: "136,194" + cpu_usage: "13.60%" + capacity_usage: "" From 43997148a2e35d012f5b17937c690d7fc403b51a Mon Sep 17 00:00:00 2001 From: Hugo Tinoco <43675476+h4ndzdatm0ld@users.noreply.github.com> Date: Sat, 15 May 2021 07:15:10 +0000 Subject: [PATCH 2/2] +empty_line --- ntc_templates/templates/alcatel_sros_show_system_cpu.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntc_templates/templates/alcatel_sros_show_system_cpu.textfsm b/ntc_templates/templates/alcatel_sros_show_system_cpu.textfsm index be9383a28d..db51a2ca31 100644 --- a/ntc_templates/templates/alcatel_sros_show_system_cpu.textfsm +++ b/ntc_templates/templates/alcatel_sros_show_system_cpu.textfsm @@ -24,4 +24,4 @@ Total ^=+ -> Done ^. -> Error -Done \ No newline at end of file +Done