From a9d071bdfaca936fc27b839c8247a9c3895dee15 Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Mon, 17 Jan 2011 15:26:55 +0100 Subject: [PATCH] naf: Added cache size to "extcache*" Signed-off-by: Sven Velt --- check_naf.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/check_naf.py b/check_naf.py index 052b912..42c3953 100755 --- a/check_naf.py +++ b/check_naf.py @@ -182,8 +182,9 @@ class CheckNAF(SNMPMonitoringPlugin): ec_usage = float(ec_usedsize) / float(ec_size) * 100.0 ec_hitpct = float(ec_hits) / float(ec_hits + ec_miss) * 100.0 + ec_size_human = self.value_to_human_binary(ec_size, unit='B') - output = 'Cache usage %5.2f%%, total hits %5.2f%% ' % (ec_usage, ec_hitpct) + output = 'Cache size %s, cache usage %5.2f%%, total hits %5.2f%% ' % (ec_size_human, ec_usage, ec_hitpct) returncode = 0 perfdata = [] perfdata.append({'label':'nacache_usage', 'value':float('%5.2f' % ec_usage), 'unit':'%'}) @@ -199,9 +200,12 @@ class CheckNAF(SNMPMonitoringPlugin): def check_extcache_info(self): ec_type = self.SNMPGET(self.OID['extcache_Type']) ec_subtype = self.SNMPGET(self.OID['extcache_SubType']) + ec_size = long(self.SNMPGET(self.OID['extcache_Size'])) ec_options = self.SNMPGET(self.OID['extcache_Options']) - output = 'Cache type: "' + ec_type + '/' + ec_subtype + '", options: "' + ec_options + '"' + ec_size_human = self.value_to_human_binary(ec_size, unit='B') + + output = 'Cache type: "' + ec_type + '/' + ec_subtype + '", size: ' + ec_size_human + ', options: "' + ec_options + '"' returncode = 0 return self.remember_check('extcache_info', returncode, output)