Module: check_mk
Branch: master
Commit: a528b5bfc1f02d9d1f0c3c1d4715ebad3ac98066
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a528b5bfc1f02d…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jan 11 17:30:35 2017 +0100
4010 FIX netapp_api_qtree_quota: now only includes quota where disk-limits are set
Change-Id: I327312f88fa0c71989cbf2c566db99b1da9c5471
---
.werks/4010 | 10 ++++++++++
ChangeLog | 1 +
checks/netapp_api_qtree_quota | 8 ++++++--
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/.werks/4010 b/.werks/4010
new file mode 100644
index 0000000..37ad526
--- /dev/null
+++ b/.werks/4010
@@ -0,0 +1,10 @@
+Title: netapp_api_qtree_quota: now only includes quotas where disk-limits are set
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1484152189
+Class: fix
+
+
+
diff --git a/ChangeLog b/ChangeLog
index 066ab3e..1d8cd99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,7 @@
* 4273 FIX: innovaphone_temp: Fixed missing include of temperature.include
* 4274 FIX: eltek_outdoor_temp: Fixed non working default levels
* 4275 FIX: ibm_imm_voltage: Fixed not working perfdata processing
+ * 4010 FIX: netapp_api_qtree_quota: now only includes quotas where disk-limits are
set
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/netapp_api_qtree_quota b/checks/netapp_api_qtree_quota
index 24e49f3..b820631 100644
--- a/checks/netapp_api_qtree_quota
+++ b/checks/netapp_api_qtree_quota
@@ -33,7 +33,7 @@
def inventory_netapp_api_qtree_quota(parsed):
for qtree, attrs in parsed.items():
- if attrs.get("quota-type") == "tree":
+ if attrs.get("quota-type") == "tree" and
attr.get("disk-limit").isdigit():
yield qtree, {}
def check_netapp_api_qtree_quota(item, params, parsed):
@@ -42,7 +42,11 @@ def check_netapp_api_qtree_quota(item, params, parsed):
if not qtree:
return 3, "Qtree not found in agent output"
- size_total = int(qtree.get("disk-limit")) / 1024.0
+ disk_limit = qtree.get("disk-limit")
+ if not disk_limit.is_digit():
+ return 3, "Qtree has no disk limit set"
+
+ size_total = int(disk_limit) / 1024.0
size_avail = size_total - int(qtree.get("disk-used")) / 1024.0
if qtree.get("files-used", "").isdigit() and
qtree.get("file-limit", "").isdigit():
inodes_total = int(qtree.get("file-limit"))