From c6cb2b634db50faaacb6546a6cc84b506465e815 Mon Sep 17 00:00:00 2001 From: Pall Sigurdsson Date: Mon, 2 Sep 2013 10:50:48 +0000 Subject: [PATCH] check_eva - minor bugfixes --- check_eva/check_eva.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/check_eva/check_eva.py b/check_eva/check_eva.py index f2eeb65..5a9f74b 100644 --- a/check_eva/check_eva.py +++ b/check_eva/check_eva.py @@ -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): if not perfdata_fields: - perfdata_fields = ['good'] + perfdata_fields = [] if not longserviceoutputfields: longserviceoutputfields = [] global perfdata @@ -493,7 +493,7 @@ def check_generic(command="ls disk full",namefield="objectname", perfdata_fields for field in perfdata_fields: 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 if command == "ls disk_group full": @@ -697,10 +697,9 @@ elif mode == 'check_diskgroups': elif mode == 'check_disks': check_generic(command="ls disk full",namefield="objectname") elif mode == 'check_diskshelfs' or mode == 'check_diskshelves': - check_generic(command="ls diskshelf full",namefield="diskshelfname",longserviceoutputfields=[], perfdata_fields=[]) + check_generic(command="ls diskshelf full", namefield="diskshelfname", longserviceoutputfields=[], perfdata_fields=[]) else: print "* Error: Mode %s not found" % mode print_help() print "* Error: Mode %s not found" % mode exit(unknown) -