From 3f44b6bf01a5853920371056ec39729b22a7c0dd Mon Sep 17 00:00:00 2001 From: gitmopp Date: Wed, 5 Feb 2014 10:19:14 +0100 Subject: [PATCH] Added performance counter for mode check_disks mode check_disks will output performance data "| 'Good Disks'=60" It just counts all disks with operationalstate == good --- check_eva/check_eva.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/check_eva/check_eva.py b/check_eva/check_eva.py index 43b89ea..d206f41 100644 --- a/check_eva/check_eva.py +++ b/check_eva/check_eva.py @@ -497,6 +497,7 @@ def check_generic(command="ls disk full", namefield="objectname", perfdata_field usedstoragespacegb = 0 occupancyalarmlvel = 0 warninggb = 0 + gooddisks = 0 for i in objects: systemname = i['systemname'] # Some versions of commandview use "objectname" instead of namefield @@ -528,6 +529,12 @@ def check_generic(command="ls disk full", namefield="objectname", perfdata_field add_perfdata("'%s%s'=%s " % (identifier, field, i.get(field, None))) + # Count disks with operationalstate good + if command == "ls disk full": + if i['operationalstate'] == 'good': + gooddisks += 1 + perfdata = "'Good Disks'=" + str(gooddisks) + # Disk group gets a special perfdata treatment if command == "ls disk_group full": totalstoragespacegb = float(i['totalstoragespacegb'])