mirror of
https://github.com/FreifunkFranken/fff-monitoring.git
synced 2024-06-15 20:04:03 +02:00
api/alfred: Only log reboot if uptime difference greater than 5 min
If we have two gateways per hood, uptime may vary and cause frequent logged reboots. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
de7c5b2874
commit
c3adf5fd68
|
@ -265,7 +265,7 @@ def import_nodewatcher_xml(mysql, mac, xml, banned, netifdict):
|
||||||
if olddata:
|
if olddata:
|
||||||
# fire events
|
# fire events
|
||||||
with suppress(KeyError, TypeError, UnboundLocalError):
|
with suppress(KeyError, TypeError, UnboundLocalError):
|
||||||
if olddata["sys_uptime"] > router_update["sys_uptime"]:
|
if (olddata["sys_uptime"] - 300) > router_update["sys_uptime"]:
|
||||||
events_append(mysql,router_id,"reboot","")
|
events_append(mysql,router_id,"reboot","")
|
||||||
|
|
||||||
with suppress(KeyError, TypeError, UnboundLocalError):
|
with suppress(KeyError, TypeError, UnboundLocalError):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user