change overdue state to unknown anfetr 7 days

This commit is contained in:
2016-06-27 20:52:55 +02:00
parent 7e122aa2d1
commit c8a5948353
2 changed files with 13 additions and 1 deletions
+3
View File
@@ -55,6 +55,7 @@ verbose = False
INTERVAL = 10
GRACE = 2
DROPOVERDUE = 7*24*3600
os.environ['TZ'] = 'EST5EDT'
@@ -305,6 +306,8 @@ def checkoverdue():
if conn.state == Connection.up and (now - conn.lastbeat) > timeout:
conn.newstate(Connection.overdue, now, grace)
pmsg.append(conn.afam)
if conn.state == Connection.overdue and (now - conn.lastbeat) > DROPOVERDUE:
conn.newstate(Connection.unknown, conn.lastbeat)
if pmsg != []:
if h in watchhosts:
email("overdue", "%s overdue" % " and ".join(pmsg))