Module: check_mk
Branch: master
Commit: 81c47459c128c9493cc8b5c701075cee1de56651
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=81c47459c128c9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 14 12:56:53 2014 +0100
FIX fortigate_memory: Fix inventory, do not add check if no info available
Previously a check would be added if you do an explicity inventory. Now the
inventory function only creates an item if there is really data available
via SNMP.
---
.werks/447 | 11 +++++++++++
ChangeLog | 1 +
checks/fortigate_memory | 6 +++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/447 b/.werks/447
new file mode 100644
index 0000000..cd5c10d
--- /dev/null
+++ b/.werks/447
@@ -0,0 +1,11 @@
+Title: fortigate_memory: Fix inventory, do not add check if no info available
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1389700548
+
+Previously a check would be added if you do an explicity inventory. Now the
+inventory function only creates an item if there is really data available
+via SNMP.
diff --git a/ChangeLog b/ChangeLog
index a549ea7..13ebe1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -103,6 +103,7 @@
* 0119 FIX: stulz_humidity: Fixed lower thresholds...
* 0565 FIX: windows_updates: fix for some cases when forced_reboot is not set
* 0255 FIX: windows_agent: now able to handle the removal of local/plugin scripts
during runtime...
+ * 0447 FIX: fortigate_memory: Fix inventory, do not add check if no info
available...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/fortigate_memory b/checks/fortigate_memory
index fe2617a..fd2c382 100644
--- a/checks/fortigate_memory
+++ b/checks/fortigate_memory
@@ -26,6 +26,10 @@
fortigate_memory_default_levels = (70, 80)
+def inventory_fortigate_memory(info):
+ if info:
+ return [(None, "fortigate_memory_default_levels")]
+
def check_fortigate_memory(item, params, info):
# This check does not yet support averaging. We need to
# convert it to mem.include
@@ -48,7 +52,7 @@ def check_fortigate_memory(item, params, info):
check_info["fortigate_memory"] = {
"check_function" : check_fortigate_memory,
- "inventory_function" : lambda info: [(None,
"fortigate_memory_default_levels")],
+ "inventory_function" : inventory_fortigate_memory,
"service_description" : "Memory usage",
"has_perfdata" : True,
"group" : "memory",