Default check "global", fail with unknown check

Signed-off-by: Sven Velt <sven@velt.de>
This commit is contained in:
Sven Velt 2011-01-17 15:14:22 +01:00
parent 0b4f0015ac
commit f9465dc932

View file

@ -344,7 +344,7 @@ def main():
checks.append(tuple([check, target, quad[2], quad[3]])) checks.append(tuple([check, target, quad[2], quad[3]]))
if len(checks) == 0: if len(checks) == 0:
plugin.back2nagios(3, 'No check specified!') checks = [('global','','','')]
for quad in checks: for quad in checks:
(check, target, warn, crit) = tuple(quad) (check, target, warn, crit) = tuple(quad)
@ -367,6 +367,9 @@ def main():
result = plugin.check_vol_inode(volume=target, warn=warn, crit=crit) result = plugin.check_vol_inode(volume=target, warn=warn, crit=crit)
elif check =='vol_files': elif check =='vol_files':
result = plugin.check_vol_files(volume=target, warn=warn, crit=crit) result = plugin.check_vol_files(volume=target, warn=warn, crit=crit)
else:
result = plugin.remember_check(check, plugin.RETURNCODE['UNKNOWN'], 'Unknown check "' + check + '"!')
# from pprint import pprint # from pprint import pprint
# pprint(plugin.dump_brain()) # pprint(plugin.dump_brain())