Skip to content

Commit 213fa5d

Browse files
committed
fix bgw210-700_to_graphite for new uptime format
1 parent 6f25221 commit 213fa5d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bgw210-700_to_graphite.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
3636
2018-09-01 Jason Antman <[email protected]>:
3737
- initial version of script
38+
39+
2025-05-29 Jason Antman <[email protected]>:
40+
- fix for uptime now being a number of seconds instead of a string
3841
"""
3942

4043
import logging
@@ -293,10 +296,8 @@ def _broadband_stats(self):
293296
def _sysinfo(self):
294297
tree = self._get_page('http://%s/cgi-bin/sysinfo.ha' % self.ip)
295298
info = self._do_kv_table(tree.xpath('//table')[0])
296-
parts = [int(x) for x in info['Time Since Last Reboot'].split(':')]
297299
return {
298-
'uptime_sec': parts[0] * 86400 + parts[1] * 3600 +
299-
parts[2] * 60 + parts[3]
300+
'uptime_sec': int(info['Time Since Last Reboot'])
300301
}
301302

302303

0 commit comments

Comments
 (0)