Module: check_mk
Branch: master
Commit: 0f2148533b7d38e12d7b88fbffcc71c5bb9506bc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0f2148533b7d38…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Nov 13 14:32:34 2015 +0100
#2789 netapp_api_snapvault: No longer monitors uninitialized volumes
The lag-time information is not available for uninitialized volumes.
---
.werks/2789 | 10 ++++++++++
ChangeLog | 1 +
checks/netapp_api_snapvault | 11 ++++++++---
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/.werks/2789 b/.werks/2789
new file mode 100644
index 0000000..bb696a1
--- /dev/null
+++ b/.werks/2789
@@ -0,0 +1,10 @@
+Title: netapp_api_snapvault: No longer monitors uninitialized volumes
+Level: 1
+Component: checks
+Class: feature
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1447421423
+
+The lag-time information is not available for uninitialized volumes.
diff --git a/ChangeLog b/ChangeLog
index 73c43a8..2b7786e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,7 @@
* 2787 netapp_api_snapvaults: Clustermode supported, netapp_api_disks: fixed invalid
total disk space...
* 2788 ESX Monitoring, esx_vsphere_vm subchecks: VM templates are now excluded...
* 2833 isc_dhcpd, win_dhcp_pools: lower levels for used dhcp leases are now
configurable...
+ * 2789 netapp_api_snapvault: No longer monitors uninitialized volumes...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checks/netapp_api_snapvault b/checks/netapp_api_snapvault
index 556ed9c..c73f951 100644
--- a/checks/netapp_api_snapvault
+++ b/checks/netapp_api_snapvault
@@ -31,8 +31,9 @@
# snapvault /vol/ipb_vol0/ status idle state snapvaulted lag-time 97011
source-system 172.31.12.15
def inventory_netapp_api_snapvault(parsed):
- for snapvault in parsed:
- yield snapvault, {}
+ for snapvault, values in parsed.items():
+ if "lag-time" in values:
+ yield snapvault, {}
def check_netapp_api_snapvault(item, params, parsed):
snapvault = parsed.get(item)
@@ -44,7 +45,11 @@ def check_netapp_api_snapvault(item, params, parsed):
if what in snapvault:
yield 0, "%s: %s" % (what.title(), snapvault[what])
- lag_time = int(snapvault["lag-time"])
+ lag_time = snapvault.get("lag-time")
+ if not lag_time:
+ return
+
+ lag_time = int(lag_time)
state = 0
if params:
levels = None