This commit is contained in:
Cyberes 2024-04-09 21:28:58 -06:00
parent 6d41b7a2c6
commit 5f4c06992b
1 changed files with 3 additions and 4 deletions

View File

@ -7,7 +7,6 @@ import requests
from checker import nagios
from checker.result import quit_check
from checker.string import strip_non_numbers
def main(args):
@ -38,15 +37,15 @@ def main(args):
}
used_percent_float = float(data['disk.used_percent'])
warn_percent = args.size_warn_percent * 100
crit_percent = args.size_crit_percent * 100
warn_percent = args.size_warn_percent
crit_percent = args.size_crit_percent
exit_str = f"{data['disk.used_percent']}% disk used ({data['disk.used'].upper()} / {data['disk.total'].upper()}). {data['disk.avail'].upper()} available."
exit_code = nagios.STATE_OK
if used_percent_float >= crit_percent:
exit_code = nagios.STATE_CRIT
elif used_percent_float >= warn_percent:
exit_code = nagios.STATE_CRIT
exit_code = nagios.STATE_WARN
quit_check(exit_str, exit_code, perfdata)