nots icon indicating copy to clipboard operation
nots copied to clipboard

Uptime parser needs to account for different formats

Open nickrusso42518 opened this issue 6 years ago • 1 comments

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 avatar Jun 26 '18 20:06 nickrusso42518

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.

nickrusso42518 avatar Jun 26 '18 20:06 nickrusso42518