mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-22 10:23:46 +01:00
Bugfix, no longer returns problem when not all powermodules are installed (thanks Davide Gandolfi)
This commit is contained in:
parent
bf9ecb7777
commit
38c56fe3d8
@ -226,12 +226,16 @@ def check_powermodules():
|
||||
status = 3
|
||||
details = 4
|
||||
num_ok = 0
|
||||
num_no = 0
|
||||
for i in powermodules.values():
|
||||
myIndex = i[index]
|
||||
myStatus = i[status]
|
||||
myDetails = i[details]
|
||||
myExists = i[exists]
|
||||
if myIndex == opts.exclude: continue
|
||||
if myExists == "0":
|
||||
num_no = num_no + 1
|
||||
else:
|
||||
if myStatus != "1":
|
||||
nagios_status(warning)
|
||||
add_summary( 'Powermodule "%s" status "%s". %s. ' % (myIndex,myStatus,myDetails) )
|
||||
@ -239,7 +243,7 @@ def check_powermodules():
|
||||
num_ok = num_ok + 1
|
||||
add_long('Powersupply "%s" status "%s". %s. ' % (myIndex,myStatus,myDetails) )
|
||||
add_summary( "%s out of %s powermodules are healthy" % (num_ok, len(powermodules) ) )
|
||||
add_perfdata( "'Number of powermodules'=%s" % (len(powermodules) ) )
|
||||
add_perfdata( "'Number of powermodules'=%s" % (len(powermodules) - num_no ) )
|
||||
|
||||
|
||||
nagios_status(ok)
|
||||
|
Loading…
Reference in New Issue
Block a user