Module: check_mk
Branch: master
Commit: 2d9efaae7d9dcf48d857db87e4a4f3f47446c2bb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2d9efaae7d9dcf…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Thu Mar 2 16:49:56 2017 +0100
8664 FIX prefer ucd_mem over hr_mem in case of pfSense monitoring
If monitoring pfSense firewalls the hr_mem check does not provide the right data. Because
of this ucd_mem is preferred here.
The change is incompatible because you have to rediscover the affected hosts so ucd_mem is
used instead of hr_mem.
Change-Id: I876a1f5e8aff8677ab3f78b902dfad687e98b559
---
.werks/8664 | 14 ++++++++++++++
checks/hr_mem | 3 ++-
checks/ucd_mem | 4 +++-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/.werks/8664 b/.werks/8664
new file mode 100644
index 0000000..e730219
--- /dev/null
+++ b/.werks/8664
@@ -0,0 +1,14 @@
+Title: prefer ucd_mem over hr_mem in case of pfSense monitoring
+Level: 1
+Component: checks
+Class: fix
+Compatible: incomp
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1488466566
+
+If monitoring pfSense firewalls the hr_mem check does not provide the right data. Because
of this ucd_mem is preferred here.
+
+The change is incompatible because you have to rediscover the affected hosts so ucd_mem
is used instead of hr_mem.
+
diff --git a/checks/hr_mem b/checks/hr_mem
index e21e426..0a78ecc 100644
--- a/checks/hr_mem
+++ b/checks/hr_mem
@@ -115,6 +115,7 @@ check_info["hr_mem"] = {
]),
# HOST-RESOURCES-MIB::hrSystemUptime.0
'snmp_scan_function': lambda oid: \
- not not oid('.1.3.6.1.2.1.25.1.1.0'),
+ not not oid('.1.3.6.1.2.1.25.1.1.0') and
+ "pfsense" not in oid(".1.3.6.1.2.1.1.1.0").lower(),
'group': 'memory',
}
diff --git a/checks/ucd_mem b/checks/ucd_mem
index 54d9f94..905c8b0 100644
--- a/checks/ucd_mem
+++ b/checks/ucd_mem
@@ -58,7 +58,9 @@ check_info['ucd_mem'] = {
"5", # memTotal -> kB
"6", # memAvailable -> kB
]),
- 'snmp_scan_function' : prefer_hr_scan_function,
+ 'snmp_scan_function' : lambda oid: \
+ "pfsense" in
oid(".1.3.6.1.2.1.1.1.0").lower() or
+ prefer_hr_scan_function,
'default_levels_variable' : 'ucd_mem_default_levels',
'group' : 'memory_simple',
'includes' : [ "ucd.include",
"memory.include" ],