Module: check_mk
Branch: master
Commit: 7b8447ec7f0a9dec074272fffb6f4d9d3217a919
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b8447ec7f0a9d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 9 10:16:42 2014 +0100
#1724 FIX emc_datadomain_temps: convert to new standard check output, add PNP template
---
.werks/1724 | 9 +++++++++
ChangeLog | 1 +
checks/emc_datadomain_temps | 7 ++++---
pnp-templates/template-temperature.php | 6 ++++--
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/.werks/1724 b/.werks/1724
new file mode 100644
index 0000000..3944218
--- /dev/null
+++ b/.werks/1724
@@ -0,0 +1,9 @@
+Title: emc_datadomain_temps: convert to new standard check output, add PNP template
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418116579
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index f770d56..d101aa1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -137,6 +137,7 @@
* 1695 FIX: brocade_vdx_status: Is now not bein inventorized anymore for devices not
supporting the check
* 1722 FIX: lnx_thermal: fix invalid zero temperature if mode file is missing
* 1696 FIX: cisco_temp_sensor: Value reported of check was not always correct
(precision was wrong)...
+ * 1724 FIX: emc_datadomain_temps: convert to new standard check output, add PNP
template
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/emc_datadomain_temps b/checks/emc_datadomain_temps
index f62c4b4..e889635 100644
--- a/checks/emc_datadomain_temps
+++ b/checks/emc_datadomain_temps
@@ -45,9 +45,10 @@ def check_emc_datadomain_temps(item, _no_params, info):
dev_state = line[4]
dev_state_str = state_table.get(dev_state, ("Unknown",3))[0]
dev_state_rc = state_table.get(dev_state, ("Unknown",3))[1]
- infotext = "%s Temperature %sC Status %s" % ( dev_descr, dev_temp,
dev_state_str )
- perfdata = [('temp', dev_temp+"C" )]
- return dev_state_rc, infotext,perfdata
+ yield 0, "Temperature: %s °C (%s)" % (dev_temp, dev_descr),
[('temp', dev_temp)]
+ if dev_state_rc != 0:
+ yield dev_state_rc, dev_state_str
+
check_info["emc_datadomain_temps"] = {
"check_function" : check_emc_datadomain_temps,
diff --git a/pnp-templates/template-temperature.php
b/pnp-templates/template-temperature.php
index a6fb205..5d693d2 100644
--- a/pnp-templates/template-temperature.php
+++ b/pnp-templates/template-temperature.php
@@ -31,6 +31,8 @@ $def[1] .= "GPRINT:var1:LAST:\"%2.0lfC\" ";
$def[1] .= "LINE1:var1#000080:\"\" ";
$def[1] .= "GPRINT:var1:MAX:\"(Max\: %2.0lfC,\" ";
$def[1] .= "GPRINT:var1:AVERAGE:\"Avg\: %2.0lfC)\" ";
-$def[1] .= "HRULE:$WARN[1]#FFFF00:\"Warning\: $WARN[1]C\" ";
-$def[1] .= "HRULE:$CRIT[1]#FF0000:\"Critical\: $CRIT[1]C\" ";
+if ($WARN[1] != "") {
+ $def[1] .= "HRULE:$WARN[1]#FFFF00:\"Warning\: $WARN[1]C\" ";
+ $def[1] .= "HRULE:$CRIT[1]#FF0000:\"Critical\: $CRIT[1]C\" ";
+}
?>