Skip to content
Snippets Groups Projects
Commit 871b93ff authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Warn if no activity for 1.5 hours. Fix messages.

parent b75fbb3e
No related branches found
No related tags found
No related merge requests found
...@@ -43,11 +43,11 @@ def check_host(hostname): ...@@ -43,11 +43,11 @@ def check_host(hostname):
print "CRITICAL - no activity within the last 14 days" print "CRITICAL - no activity within the last 14 days"
sys.exit(2) sys.exit(2)
age = time.time() - statval.st_mtime age = time.time() - statval.st_mtime
if age > 10 * 3600: if age > 1.5 * 3600:
print "WARNING - no activity for %.1g hours" % (age / 3600.0) print "WARNING - no activity for %.1f hours" % (age / 3600.0)
sys.exit(1) sys.exit(1)
else: else:
print "OK - activity %.2g hours ago" % (age / 3600.0) print "OK - activity %.2f minutes ago" % (age / 60.0)
if __name__ == '__main__': if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment