1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-22 02:13:44 +01:00

check_eva - minor bugfixes

This commit is contained in:
Pall Sigurdsson 2013-09-02 10:50:48 +00:00
parent 92a6643a4b
commit c6cb2b634d

View File

@ -447,7 +447,7 @@ def check_operationalstate(my_object, print_failed_objects=False,namefield='obje
def check_generic(command="ls disk full",namefield="objectname", perfdata_fields=None, longserviceoutputfields=None, detailedsummary=False): def check_generic(command="ls disk full",namefield="objectname", perfdata_fields=None, longserviceoutputfields=None, detailedsummary=False):
if not perfdata_fields: if not perfdata_fields:
perfdata_fields = ['good'] perfdata_fields = []
if not longserviceoutputfields: if not longserviceoutputfields:
longserviceoutputfields = [] longserviceoutputfields = []
global perfdata global perfdata
@ -493,7 +493,7 @@ def check_generic(command="ls disk full",namefield="objectname", perfdata_fields
for field in perfdata_fields: for field in perfdata_fields:
if field == '': continue if field == '': continue
add_perfdata( "'%s%s'=%s " % (identifier, field, i[field]) ) add_perfdata( "'%s%s'=%s " % (identifier, field, i.get(field,None) ))
# Disk group gets a special perfdata treatment # Disk group gets a special perfdata treatment
if command == "ls disk_group full": if command == "ls disk_group full":
@ -703,4 +703,3 @@ else:
print_help() print_help()
print "* Error: Mode %s not found" % mode print "* Error: Mode %s not found" % mode
exit(unknown) exit(unknown)