nickrusso42518 / nots

[Ansible] Nick's OSPF TroubleShooter
BSD 3-Clause "New" or "Revised" License
176 stars 46 forks source link

Uptime parser needs to account for different formats #1

Open nickrusso42518 opened 6 years ago

nickrusso42518 commented 6 years ago

NXOS shown below. Likely true on XR as well. First neighbor has been up for 1 day and the format is markedly different than the double-colon notation.

 OSPF Process ID 1 VRF default
 Total number of neighbors: 2
 Neighbor ID     Pri State            Up Time  Address         Interface
 2.2.2.2           1 FULL/ -          1d00h    192.168.0.2     Eth1/43 
 2.2.2.2           1 FULL/BDR         06:55:58 192.168.17.6    Eth1/45 
nickrusso42518 commented 6 years ago

Static value of 0 is used for uptime_sec in this case whenever the original uptime string does not contain exactly two colons. Since this total of seconds is not used anywhere in any test to date, there is no operational impact. The correct solution is to count the seconds based on the hours, days, weeks, and years indicated by the uptime.