Module: check_mk
Branch: master
Commit: 2438c7987adffd3dd461b612ad528310af7305aa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2438c7987adffd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Oct 7 20:25:33 2013 +0200
FIX: netapp_volumes: better output when volume is missing
---
ChangeLog | 7 ++++---
checks/netapp_volumes | 38 ++++++++++++++++++--------------------
2 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 381be12..404710a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,12 +13,13 @@
Checks & Agents:
* windows_agent: increased maximum plugin output buffer size to 2MB
* check_icmp: New WATO rule for custom PING checks
+ * agent_vsphere: now able to handle < > & ' " in login
credentials
+ * if/if64 and friends: add 95% percentiles to graphs
* FIX: windows_agent: fixed bug in cleanup of open thread handles
* FIX: cups default printer is now monitored again in linux agent
- * FIX: host notification email in html format: fixed formating error
+ * FIX: host notification email in html format: fixed formating error
(typo in tag)
- * agent_vsphere: now able to handle < > & ' " in login
credentials
- * if/if64 and friends: add 95% percentiles to graphs
+ * FIX: netapp_volumes: better output when volume is missing
Multisite:
* FIX: add missing service icons to view "All Services with this descr..."
diff --git a/checks/netapp_volumes b/checks/netapp_volumes
index 0f67920..1e7b6d3 100644
--- a/checks/netapp_volumes
+++ b/checks/netapp_volumes
@@ -91,30 +91,28 @@ def inventory_netapp_volumes(info):
return [ (line[0], None) for line in info if netapp_volumes_owner.get(line[2],
'') == 'local' ]
def check_netapp_volumes(item, _not_used, info):
- info = [ line for line in info if line[0] == item ][0]
+ for line in info:
+ if line[0] == item:
+ name, fsid, owner, state, status = line
- if len(info) != 5:
- return (3, "Invalid SNMP response")
+ output = 'FSID: %s, Owner: %s, ' % (fsid,
netapp_volumes_owner.get(owner, 'UNKNOWN'))
- name, fsid, owner, state, status = info
+ ret_state = 0
+ output += 'State: %s' % state
+ if state == 'offline':
+ ret_state = 1
+ output += '(!)'
- output = 'FSID: %s, Owner: %s, ' % (fsid, netapp_volumes_owner.get(owner,
'UNKNOWN'))
+ output += ', Status: %s' % status
+ if status == 'reconstructing':
+ ret_state = 1
+ output += '(!)'
+ elif status.split(',')[0] not in [ 'normal',
'raid_dp', 'raid0', 'raid0, mirrored', 'raid4' ]:
+ ret_state = 2
+ output += '(!!)'
- ret_state = 0
- output += 'State: %s' % state
- if state == 'offline':
- ret_state = 1
- output += '(!)'
-
- output += ', Status: %s' % status
- if status == 'reconstructing':
- ret_state = 1
- output += '(!)'
- elif status.split(',')[0] not in [ 'normal', 'raid_dp',
'raid0', 'raid0, mirrored', 'raid4' ]:
- ret_state = 2
- output += '(!!)'
-
- return (ret_state, output)
+ return (ret_state, output)
+ return 3, "Volume not found"
check_info["netapp_volumes"] = {
'check_function': check_netapp_volumes,