get_host_uptime.py #1086
-
When trying to run "get_host_uptime.py" (samples/rtr/get_host_uptime.py), I get an error that when I search it seems that there is an issue with how the script is parsing the time/date format. Does anyone know what needs to be tweaked in the code to make the script work? The error is below... The "-48" is the final part of the %f value (it is a bunch of numbers followed by a "-" and then several more numbers. It seems like the code doesn't account for the non numerical content? Any help is appreciated. Traceback (most recent call last): |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @cyberbeach33 - I can't recreate this issue directly which has me wondering if it may be a date format or regional setting on the host. (That's just a guess.) Let's try removing the problematic part altogether. If you replace line 147 with the following, does the code execute without error when you target a Windows host? incoming = datetime.strptime(incoming[:incoming.find("+")][:incoming.find(".")], "%Y%m%d%H%M%S") |
Beta Was this translation helpful? Give feedback.
Hi @cyberbeach33 -
I can't recreate this issue directly which has me wondering if it may be a date format or regional setting on the host. (That's just a guess.) Let's try removing the problematic part altogether.
If you replace line 147 with the following, does the code execute without error when you target a Windows host?