Module: check_mk
Branch: master
Commit: ab6394529db1232cdbf8e33569540363ec363a67
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab6394529db123…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Wed Aug 14 17:20:20 2013 +0200
performance data of apc_symmetra extended by runtime, pnp template polished
---
checks/apc_symmetra | 4 +--
pnp-templates/check_mk-apc_symmetra.php | 49 +++++++++++++++++++------------
2 files changed, 32 insertions(+), 21 deletions(-)
diff --git a/checks/apc_symmetra b/checks/apc_symmetra
index a06f959..1dda539 100644
--- a/checks/apc_symmetra
+++ b/checks/apc_symmetra
@@ -121,10 +121,10 @@ def check_apc(item, params, info):
single_states.append( (0, "output current %dA" % AdvOutputCurrent,
("current", AdvOutputCurrent)) )
# 8. run time remaining
- # RunTimeRemaining == "0:0:26:00.00"
+ # RunTimeRemaining formatiert == "26:00.00"
hrs = int(RunTimeRemaining) / 3600
mins, secs = divmod(int(RunTimeRemaining) % 3600, 60)
- single_states.append( (0, "run time remaining: %02d:%02d:%02d" % (hrs,
mins, secs), None) )
+ single_states.append( (0, "run time remaining: %02d:%02d:%02d" % (hrs,
mins, secs), ("runtime", RunTimeRemaining/60)) )
# create summary state
worst_state = max([x[0] for x in single_states])
diff --git a/pnp-templates/check_mk-apc_symmetra.php
b/pnp-templates/check_mk-apc_symmetra.php
index fe18dc2..fa6de89 100644
--- a/pnp-templates/check_mk-apc_symmetra.php
+++ b/pnp-templates/check_mk-apc_symmetra.php
@@ -23,26 +23,28 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-$opt[1] = "--vertical-label \"Celsius\" -l 0 -u 60 --title \"Battery
temperature\" ";
-
$color = sprintf("ff%02x80", $ACT[2] * 3, $ACT[2] * 2);
-$def[1] = "DEF:var1=$RRDFILE[2]:$DS[2]:MAX ";
-$def[1] .= "AREA:var1#$color:\"Temperature\:\" ";
-$def[1] .= "GPRINT:var1:LAST:\"%2.0lfC\" ";
-$def[1] .= "LINE1:var1#800040:\"\" ";
-$def[1] .= "GPRINT:var1:MAX:\"(Max\: %2.0lfC,\" ";
-$def[1] .= "GPRINT:var1:AVERAGE:\"Avg\: %2.0lfC)\" ";
-$def[1] .= "HRULE:$CRIT[2]#FF0000:\"Critical\: $CRIT[2]C\" ";
-
-$opt[2] = "--vertical-label \"Percent\" -l 0 -u 100 --title \"Battery
Capacity\" ";
-$def[2] = "DEF:var2=$RRDFILE[1]:$DS[1]:MIN ";
-$def[2] .= "AREA:var2#80e0c0:\"Capacity\:\" ";
-$def[2] .= "GPRINT:var2:LAST:\"%2.0lf%%\" ";
-$def[2] .= "LINE1:var2#008040:\"\" ";
-$def[2] .= "GPRINT:var2:MAX:\"(Max\: %2.0lf%%,\" ";
-$def[2] .= "GPRINT:var2:AVERAGE:\"Avg\: %2.0lf%%)\" ";
-$def[2] .= "HRULE:$CRIT[1]#FF0000:\"Critical\: $CRIT[1]%\" ";
+$opt[1] = "--vertical-label \"Percent\" -u 100 --title \"Battery
Capacity\" ";
+$def[1] = "DEF:var2=$RRDFILE[1]:$DS[1]:MIN ";
+$def[1] .= "AREA:var2#80e0c0:\"Capacity\:\" ";
+$def[1] .= "GPRINT:var2:LAST:\"%2.0lf%%\" ";
+$def[1] .= "LINE1:var2#008040:\"\" ";
+$def[1] .= "GPRINT:var2:MIN:\"(Min\: %2.0lf%%,\" ";
+$def[1] .= "GPRINT:var2:MAX:\"Max\: %2.0lf%%,\" ";
+$def[1] .= "GPRINT:var2:AVERAGE:\"Avg\: %2.0lf%%)\" ";
+$def[1] .= "HRULE:$CRIT[1]#FF0000:\"Critical\: $CRIT[1]%\" ";
+
+$opt[2] = "--vertical-label \"Celsius\" -u 60 --title \"Battery
temperature\" ";
+$def[2] = "DEF:var1=$RRDFILE[2]:$DS[2]:MAX ";
+$def[2] .= "AREA:var1#$color:\"Temperature\:\" ";
+$def[2] .= "GPRINT:var1:LAST:\"%2.0lfC\" ";
+$def[2] .= "LINE1:var1#800040:\"\" ";
+$def[2] .= "GPRINT:var1:MIN:\"(min\: %2.0lfC,\" ";
+$def[2] .= "GPRINT:var1:MAX:\"max\: %2.0lfC,\" ";
+$def[2] .= "GPRINT:var1:AVERAGE:\"Avg\: %2.0lfC)\" ";
+$def[2] .= "HRULE:$CRIT[2]#FF0000:\"Critical\: $CRIT[2]C\" ";
+
$opt[3] = "--vertical-label \"Ampere\" -l -0 --title
\"Currencies\" ";
$def[3] = "DEF:batcur=$RRDFILE[3]:$DS[3]:MAX ";
@@ -52,7 +54,7 @@ $def[3] .= "GPRINT:batcur:LAST:\"%2.0lfA\" ";
$def[3] .= "LINE:outcur#00c0c0:\"Output Currency\:\" ";
$def[3] .= "GPRINT:outcur:LAST:\"%2.0lfA\" ";
-$opt[4] = "--vertical-label \"Volt\" -l 0 -u 250 --title \"Output
Voltage\" ";
+$opt[4] = "--vertical-label \"Volt\" -u 250 --title \"Output
Voltage\" ";
$def[4] = "DEF:volt=$RRDFILE[4]:$DS[4]:MIN ";
$def[4] .= "GPRINT:volt:LAST:\"%2.0lfV\" ";
$def[4] .= "LINE1:volt#408040:\"\" ";
@@ -60,4 +62,13 @@ $def[4] .= "GPRINT:volt:MIN:\"(min\: %2.0lfV,\" ";
$def[4] .= "GPRINT:volt:AVERAGE:\"avg\: %2.0lfV)\" ";
$def[4] .= "HRULE:$CRIT[4]#FF0000:\"Critical\: $CRIT[4]V\" ";
+$opt[5] = "--vertical-label \"Time\" --title \"Remaining
Runtime\" ";
+$def[5] = "DEF:minutes=$RRDFILE[6]:$DS[6]:MIN ";
+$def[5] .= "GPRINT:minutes:LAST:\"%2.0lfmin\" ";
+$def[5] .= "LINE1:minutes#408040:\"\" ";
+$def[5] .= "GPRINT:minutes:MIN:\"(min\: %2.0lfmin,\" ";
+$def[5] .= "GPRINT:minutes:MAX:\"max\: %2.0lfmin,\" ";
+$def[5] .= "GPRINT:minutes:AVERAGE:\"avg\: %2.0lfmin)\" ";
+#$def[5] .= "HRULE:$CRIT[4]#FF0000:\"Critical\: $CRIT[4]V\" ";
+
?>