mirror of
https://github.com/FAUSheppy/icinga-webhook-gateway
synced 2025-12-06 15:31:38 +01:00
fix: handle second_last in first request
This commit is contained in:
@@ -412,7 +412,8 @@ def record_and_check_smart(service, timestamp, smart):
|
|||||||
spare_change), "WARNING")
|
spare_change), "WARNING")
|
||||||
|
|
||||||
# unsafe_shutdowns +1 #
|
# unsafe_shutdowns +1 #
|
||||||
if smart_second_last.unsafe_shutdowns - smart_last.unsafe_shutdowns >= 1:
|
if(smart_second_last and
|
||||||
|
smart_second_last.unsafe_shutdowns - smart_last.unsafe_shutdowns >= 1):
|
||||||
return ("Disk had {} unsafe shutdowns".format(smart_last.unsafe_shutdowns),
|
return ("Disk had {} unsafe shutdowns".format(smart_last.unsafe_shutdowns),
|
||||||
"WARNING")
|
"WARNING")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user