Module: check_mk
Branch: master
Commit: f1f536e87490031301f54fd77ce2a6afec203345
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f1f536e8749003…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Nov 2 14:43:57 2016 +0100
added graphing for checks using data of fans
---
checks/bintec_sensors | 1 +
checks/brocade | 3 ++-
checks/bvip_fans | 1 +
checks/climaveneta_fan | 1 +
checks/emc_isilon_fans | 7 ++++---
checks/entity_sensors | 1 +
checks/fan.include | 8 +++++---
checks/fsc_fans | 15 ++++++++-------
checks/netextreme_fan | 1 +
checks/netscaler_health | 5 +++--
web/plugins/metrics/check_mk.py | 26 ++++++++++++++++++++++++++
11 files changed, 53 insertions(+), 16 deletions(-)
diff --git a/checks/bintec_sensors b/checks/bintec_sensors
index 8ea003d..e813430 100644
--- a/checks/bintec_sensors
+++ b/checks/bintec_sensors
@@ -66,6 +66,7 @@ check_info["bintec_sensors.fan"] = {
"service_description" : "%s",
"snmp_info" : bintec_sensors_info,
"snmp_scan_function" : bintec_sensors_scan,
+ "has_perfdata" : True,
"default_levels_variable" :
"bintec_sensors_fan_default_levels",
"group" : "hw_fans",
"includes" : [ "fan.include" ],
diff --git a/checks/brocade b/checks/brocade
index e1fa5da..29adf53 100644
--- a/checks/brocade
+++ b/checks/brocade
@@ -77,7 +77,8 @@ check_info["brocade.fan"] = {
"service_description" : "FAN %s",
"group" : "hw_fans",
"snmp_info" : brocade_info,
- 'snmp_scan_function' : brocade_scan,
+ "snmp_scan_function" : brocade_scan,
+ "has_perfdata" : True,
"includes" : [ "fan.include" ],
}
diff --git a/checks/bvip_fans b/checks/bvip_fans
index ac17904..fe5b1bb 100644
--- a/checks/bvip_fans
+++ b/checks/bvip_fans
@@ -43,6 +43,7 @@ check_info["bvip_fans"] = {
"service_description" : "Fan %s",
"snmp_scan_function" : bvip_scan_function,
"snmp_info" : (".1.3.6.1.4.1.3967.1.1.8.1", [OID_END,
1 ]),
+ "has_perfdata" : True,
"includes" : [ 'bvip.include', 'fan.include'
],
"group" : "hw_fans",
}
diff --git a/checks/climaveneta_fan b/checks/climaveneta_fan
index 5fde683..85a4058 100644
--- a/checks/climaveneta_fan
+++ b/checks/climaveneta_fan
@@ -46,6 +46,7 @@ check_info["climaveneta_fan"] = {
"service_description" : "Fan %s",
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0") == "pCO Gateway",
"snmp_info" : (".1.3.6.1.4.1.9839.2.1.2", [ 42, 43
] ),
+ "has_perfdata" : True,
"default_levels_variable" : "climaveneta_fan_default_levels",
"group" : "hw_fans",
"includes" : [ "fan.include" ],
diff --git a/checks/emc_isilon_fans b/checks/emc_isilon_fans
index cc74b9b..6db3def 100644
--- a/checks/emc_isilon_fans
+++ b/checks/emc_isilon_fans
@@ -59,7 +59,8 @@ check_info["emc_isilon_fans"] = {
4, # ISILON-MIB::fanSpeed,
]),
'snmp_scan_function' : lambda oid: "isilon" in
oid('.1.3.6.1.2.1.1.1.0').lower(),
- "group" : "hw_fans",
- "default_levels_variable" : "emc_isilon_fan_default_levels",
- "includes" : [ 'fan.include' ],
+ 'has_perfdata' : True,
+ 'group' : "hw_fans",
+ 'default_levels_variable' : "emc_isilon_fan_default_levels",
+ 'includes' : [ 'fan.include' ],
}
diff --git a/checks/entity_sensors b/checks/entity_sensors
index f297788..d17ef8c 100644
--- a/checks/entity_sensors
+++ b/checks/entity_sensors
@@ -238,6 +238,7 @@ check_info['entity_sensors.fan'] = {
'inventory_function' : lambda parsed: inventory_entity_sensors(parsed,
"fan"),
'check_function' : check_entity_sensors_fan,
'service_description' : 'Fan %s',
+ 'has_perfdata' : True,
'default_levels_variable' :
'entity_sensors_fan_default_variables',
'group' : 'hw_fans',
'includes' : ['fan.include'],
diff --git a/checks/fan.include b/checks/fan.include
index 6ca538f..c345bb1 100644
--- a/checks/fan.include
+++ b/checks/fan.include
@@ -36,12 +36,14 @@ def check_fan(rpm, params):
levelstext = levelstext[:-1] + \
" and at or above %s/%s RPM)" % (warn_upper, crit_upper)
+ perfdata = [ ("fan", rpm, warn, crit, warn_upper, crit_upper)]
+
# Note that None < int
if rpm < crit or crit_upper != None and rpm >= crit_upper:
message += levelstext
- return 2, message
+ return 2, message, perfdata
elif rpm < warn or warn_upper != None and rpm >= warn_upper:
message += levelstext
- return 1, message
+ return 1, message, perfdata
else:
- return 0, message
+ return 0, message, perfdata
diff --git a/checks/fsc_fans b/checks/fsc_fans
index 014bf66..10e9369 100644
--- a/checks/fsc_fans
+++ b/checks/fsc_fans
@@ -40,11 +40,12 @@ def check_fsc_fans(item, params, info):
check_info["fsc_fans"] = {
- 'check_function': check_fsc_fans,
- 'inventory_function': inventory_fsc_fans,
- 'group': "hw_fans",
- 'service_description': 'FSC %s',
- 'snmp_info': ('.1.3.6.1.4.1.231.2.10.2.2.5.2.2.1', [16,
8]),
- 'snmp_scan_function': lambda oid:
oid(".1.3.6.1.4.1.231.2.10.2.1.1.0"),
- 'includes': [ 'fan.include' ],
+ 'inventory_function' : inventory_fsc_fans,
+ 'check_function' : check_fsc_fans,
+ 'service_description' : 'FSC %s',
+ 'snmp_info' : ('.1.3.6.1.4.1.231.2.10.2.2.5.2.2.1', [16,
8]),
+ 'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.4.1.231.2.10.2.1.1.0"),
+ 'has_perfdata' : True,
+ 'group' : "hw_fans",
+ 'includes' : [ 'fan.include' ],
}
diff --git a/checks/netextreme_fan b/checks/netextreme_fan
index 4c957cd..e1c9a9a 100644
--- a/checks/netextreme_fan
+++ b/checks/netextreme_fan
@@ -58,6 +58,7 @@ check_info['netextreme_fan'] = {
"4", # extremeFanSpeed (RPM)
]),
'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.1916.2"),
+ 'has_perfdata' : True,
'group' : 'hw_fans',
'default_levels_variable' : 'netextreme_fan_default_levels',
'includes' : [ "fan.include" ],
diff --git a/checks/netscaler_health b/checks/netscaler_health
index 8ea511b..3b5cafc 100644
--- a/checks/netscaler_health
+++ b/checks/netscaler_health
@@ -77,13 +77,14 @@ def check_netscaler_health_fan(item, params, info):
return check_fan(int(value), params)
check_info["netscaler_health.fan"] = {
- "check_function" : check_netscaler_health_fan,
"inventory_function" : inventory_netscaler_health_fan,
+ "check_function" : check_netscaler_health_fan,
"service_description" : "FAN %s",
- "group" : "hw_fans",
"snmp_info" : netscaler_health_info,
"snmp_scan_function" : netscaler_health_scan,
+ "has_perfdata" : True,
"default_levels_variable" :
"netscaler_health_fan_default_levels",
+ "group" : "hw_fans",
"includes" : [ "fan.include" ],
}
#.
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index e73ae02..b2623ae 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -216,6 +216,12 @@ unit_info["l/s"] = {
"render" : lambda v: physical_precision(v, 3, _("l/s")),
}
+unit_info["rpm"] = {
+ "title" : _("Rounds Per Minute"),
+ "symbol" : _("rpm"),
+ "render" : lambda v: physical_precision(v, 4, _("rpm")),
+}
+
#.
# .--Metrics-------------------------------------------------------------.
# | __ __ _ _ |
@@ -3745,6 +3751,12 @@ metric_info["filehandler_perc"] = {
"color" : "#4800ff",
}
+metric_info["fan"] = {
+ "title" : _("Fan speed"),
+ "unit" : "rpm",
+ "color" : "16/b"
+}
+
#.
# .--Checks--------------------------------------------------------------.
# | ____ _ _ |
@@ -5702,6 +5714,13 @@ perfometer_info.append({
"total" : 100.0,
})
+perfometer_info.append({
+ "type" : "logarithmic",
+ "metric" : "fan",
+ "half_value": 3000,
+ "exponent" : 2,
+})
+
#.
# .--Graphs--------------------------------------------------------------.
# | ____ _ |
@@ -5724,6 +5743,13 @@ perfometer_info.append({
# ('tablespace_used', 'area')
graph_info.append({
+ "title" : _("Fan speed"),
+ "metrics" : [
+ ( "fan_speed", "area" ),
+ ]
+})
+
+graph_info.append({
"title" : _("Context switches"),
"metrics" : [
( "vol_context_switches", "area" ),