Module: check_mk
Branch: master
Commit: e68541ebdfaaf8dad630e190e25074ffbba48e56
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e68541ebdfaaf8…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Fri Oct 21 15:32:38 2016 +0200
3949 ucd_cpu_load: Genugate devices are now displaying CPU load
Genugate devices are only using some parts of the UCD MIB for the CPU load. This is now
implemented.
---
.werks/3949 | 9 +++++++++
ChangeLog | 1 +
checks/ucd.include | 1 +
checks/ucd_cpu_load | 25 +++++++++++++++++++++++--
4 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/.werks/3949 b/.werks/3949
new file mode 100644
index 0000000..7f5c66b
--- /dev/null
+++ b/.werks/3949
@@ -0,0 +1,9 @@
+Title: ucd_cpu_load: Genugate devices are now displaying CPU load
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i2
+Date: 1477056627
+Class: feature
+
+Genugate devices are only using some parts of the UCD MIB for the CPU load. This is now
implemented.
diff --git a/ChangeLog b/ChangeLog
index e337c41..5e31742 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
* 3956 fileinfo.groups: now allows regular expressions within include and exclude
patterns each beginning with a tilde
* 3947 mssql_blocked_sessions: thresholds for wait time can be set now...
* 3830 netapp_api_luns: new check to monitor the filesystem usage of LUNs
+ * 3949 ucd_cpu_load: Genugate devices are now displaying CPU load...
* 3894 FIX: mkeventd_status: Fixed bug in case Event Console is not running
* 3907 FIX: oracle_tablespaces: simplyfied free space calculation depending on
version...
* 3819 FIX: windows agent: fixed 2 bugs related to mrpe...
diff --git a/checks/ucd.include b/checks/ucd.include
index e337cd0..3c7eb6f 100644
--- a/checks/ucd.include
+++ b/checks/ucd.include
@@ -37,6 +37,7 @@ def ucd_scan_function(oid):
"HP Onboard Administrator" in oid(".1.3.6.1.2.1.1.1.0")
or \
# for barracuda spam firewall appliance
"barracuda" in oid(".1.3.6.1.2.1.1.1.0").lower() or \
+ "genugate" in oid(".1.3.6.1.2.1.1.1.0") or \
# for artec email archiv appliance
( oid('.1.3.6.1.2.1.1.2.0') == '.1.3.6.1.4.1.8072.3.2.10' and
\
"version" in oid('.1.3.6.1.2.1.1.1.0').lower() and \
diff --git a/checks/ucd_cpu_load b/checks/ucd_cpu_load
index 04bfae0..c5f303f 100644
--- a/checks/ucd_cpu_load
+++ b/checks/ucd_cpu_load
@@ -25,6 +25,14 @@
# Boston, MA 02110-1301 USA.
+# .1.3.6.1.4.1.2021.10.1.5.1 691 1 min
+# .1.3.6.1.4.1.2021.10.1.5.2 855 5 min
+# .1.3.6.1.4.1.2021.10.1.5.3 895 15 min
+# .1.3.6.1.4.1.2021.10.1.6.1 1.350000 1 min
+# .1.3.6.1.4.1.2021.10.1.6.2 1.250000 5 min
+# .1.3.6.1.4.1.2021.10.1.6.3 1.240000 15 min
+
+
cpuload_default_levels = (5.0, 10.0)
@@ -34,8 +42,18 @@ def inventory_ucd_cpu_load(info):
def check_ucd_cpu_load(item, params, info):
+ # Some devices provide only one table. We prefer float table
+ this_cpu_load_table = []
+ for int_cpu_load_str, float_cpu_load_str in info:
+ if float_cpu_load_str:
+ this_cpu_load_table.append( float(float_cpu_load_str.replace(",",
".")) )
+ elif int_cpu_load_str:
+ this_cpu_load_table.append( float(int_cpu_load_str)/100.0 )
+ else:
+ this_cpu_load_table.append( 0 )
+
# Note: Some dump devices send 12,540000 instead of 12.540000
- return check_cpu_load_generic(params, [ float(l[0].replace(",",
".")) for l in info ])
+ return check_cpu_load_generic( params, this_cpu_load_table )
check_info["ucd_cpu_load"] = {
@@ -43,7 +61,10 @@ check_info["ucd_cpu_load"] = {
'inventory_function': inventory_ucd_cpu_load,
'service_description': 'CPU load',
'has_perfdata': True,
- 'snmp_info': ('.1.3.6.1.4.1.2021.10.1', [6]),
+ 'snmp_info': ('.1.3.6.1.4.1.2021.10.1', [
+ "5", # UCD-SNMP-MIB::laLoadInt Int
table
+ "6", # UCD-SNMP-MIB::laLoadFloat
Float table
+ ]),
# 'CPU load' is not available in the HR-MIB
# thus we cannot use 'prefer_hr_scan_function'
'snmp_scan_function': ucd_scan_function,