Skip to content

Commit

Permalink
Fix time capture and handle 'under a minute' times in Aruba show syst…
Browse files Browse the repository at this point in the history
…em (issue#1837) (networktocode#1858)
  • Loading branch information
mjbear authored Sep 30, 2024
1 parent f591cb0 commit a4a5c3b
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 8 deletions.
7 changes: 2 additions & 5 deletions ntc_templates/templates/aruba_aoscx_show_system.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ Start
^Base MAC Address\s+:\s+${BASE_MAC}
^ArubaOS-CX Version\s+:\s+${VERSION}
^Time Zone\s+:\s+${TIME_ZONE}
^Up Time\s+:\s+${UPTIME_WEEKS}\sweek -> Continue
^.*${UPTIME_DAYS}\s+(day|days) -> Continue
^.*${UPTIME_HOURS}\s+(hour|hours) -> Continue
^.*${UPTIME_MINUTES}\s+(minute|minutes) -> Record
^Up Time\s+:(\s+${UPTIME_WEEKS}\s+weeks?,?)?(\s+${UPTIME_DAYS}\s+days?,?)?(\s+${UPTIME_HOURS}\s+hours?,?)?(\s+(${UPTIME_MINUTES}|under\s+a)\s+minutes?)? -> Record
^CPU
^Memory
^-+$$
^\*+$$
^\s*$$
^. -> Error "LINE NOT FOUND"
^. -> Error "LINE NOT FOUND"
2 changes: 1 addition & 1 deletion tests/aruba_aoscx/show_system/show_system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ parsed_sample:
time_zone: "UTC"
uptime_days: ""
uptime_hours: ""
uptime_minutes: "2"
uptime_minutes: "12"
uptime_weeks: ""
vendor: "Aruba"
version: "FL.10.11.1021"
4 changes: 2 additions & 2 deletions tests/aruba_aoscx/show_system/show_system2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ parsed_sample:
serial: "XXXXXXXXXX"
time_zone: "UTC"
uptime_days: "1"
uptime_hours: "3"
uptime_minutes: "2"
uptime_hours: "23"
uptime_minutes: "32"
uptime_weeks: ""
vendor: "Aruba"
version: "FL.10.11.1021"
16 changes: 16 additions & 0 deletions tests/aruba_aoscx/show_system/show_system3.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Hostname : 6300
System Description : FL.10.10.1070
System Contact :
System Location :

Vendor : Aruba
Product Name : JL664A 6300M 24G 4SFP56 Swch
Chassis Serial Nbr : xxxxxxxxxx
Base MAC Address : 001122-334455
ArubaOS-CX Version : FL.10.10.1070

Time Zone : America/Edmonton

Up Time : 2 weeks, 22 hours under a minute
CPU Util (%) : 8
Memory Usage (%) : 25
15 changes: 15 additions & 0 deletions tests/aruba_aoscx/show_system/show_system3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
parsed_sample:
- base_mac: "001122-334455"
contact: ""
hostname: "6300"
location: ""
product: "JL664A 6300M 24G 4SFP56 Swch"
serial: "xxxxxxxxxx"
time_zone: "America/Edmonton"
uptime_days: ""
uptime_hours: "22"
uptime_minutes: ""
uptime_weeks: "2"
vendor: "Aruba"
version: "FL.10.10.1070"
16 changes: 16 additions & 0 deletions tests/aruba_aoscx/show_system/show_system4.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Hostname : 6300
System Description : FL.10.10.1070
System Contact :
System Location :

Vendor : Aruba
Product Name : JL664A 6300M 24G 4SFP56 Swch
Chassis Serial Nbr : xxxxxxxxxx
Base MAC Address : 001122-334455
ArubaOS-CX Version : FL.10.10.1070

Time Zone : America/Edmonton

Up Time : 12 weeks, 13 days, 14 hours, under a minute
CPU Util (%) : 8
Memory Usage (%) : 25
15 changes: 15 additions & 0 deletions tests/aruba_aoscx/show_system/show_system4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
parsed_sample:
- base_mac: "001122-334455"
contact: ""
hostname: "6300"
location: ""
product: "JL664A 6300M 24G 4SFP56 Swch"
serial: "xxxxxxxxxx"
time_zone: "America/Edmonton"
uptime_days: "13"
uptime_hours: "14"
uptime_minutes: ""
uptime_weeks: "12"
vendor: "Aruba"
version: "FL.10.10.1070"

0 comments on commit a4a5c3b

Please sign in to comment.