Module: check_mk
Branch: master
Commit: eb1afcc4d851f47cbdee269f8cc274ef5bc705f1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eb1afcc4d851f4…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Aug 14 16:49:52 2014 +0200
Added missing PNP templates
---
pnp-templates/check_mk-canon_pages.php | 1 +
pnp-templates/check_mk-printer_pages.php | 32 ++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/pnp-templates/check_mk-canon_pages.php b/pnp-templates/check_mk-canon_pages.php
new file mode 120000
index 0000000..81ff691
--- /dev/null
+++ b/pnp-templates/check_mk-canon_pages.php
@@ -0,0 +1 @@
+check_mk-printer_pages.php
\ No newline at end of file
diff --git a/pnp-templates/check_mk-printer_pages.php b/pnp-templates/check_mk-printer_pages.php
new file mode 100644
index 0000000..c9c519d
--- /dev/null
+++ b/pnp-templates/check_mk-printer_pages.php
@@ -0,0 +1,32 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+$opt[1] = "--vertical-label 'Pages printed' -X0 -l0 --title \"$servicedesc\" ";
+$def[1] = "DEF:pages=$RRDFILE[1]:$DS[1]:MAX ";
+$def[1] .= "AREA:pages#808080:\"Pages printed\" ";
+$def[1] .= "LINE:pages#404040 ";
+$def[1] .= "GPRINT:pages:MIN:\"%7.3lf %s first\" ";
+$def[1] .= "GPRINT:pages:LAST:\"%7.3lf %s last\" ";
+?>
Module: check_mk
Branch: master
Commit: 8ac44d091401c6f0c04f95dd0736d25a4040aa4a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ac44d091401c6…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Aug 13 17:17:47 2014 +0200
fixed some wording and tabs
---
checks/cisco_temp_sensor | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/checks/cisco_temp_sensor b/checks/cisco_temp_sensor
index 2a1d8f1..66cdff4 100644
--- a/checks/cisco_temp_sensor
+++ b/checks/cisco_temp_sensor
@@ -130,11 +130,10 @@ def parse_cisco_temp_sensor(info):
# Create main dictionary (only of temperature sensors)
sensors = []
for id, sensortype, value, sensorstate in state_info:
- # poor try to find temperature values
- # who are given in tens of degress.
- # Seems that some new firmware show this behavier.
- # A normal Temperature Sensor has only a range up to
- # 60 degree, so i choiced 70.
+ # Poor try to find temperature values, which are given in tenths of degrees.
+ # Seems that some new firmware shows this behaviour.
+ # A normal temperature sensor has only a range up to
+ # 60 degree, so we've chosen 70.
value = saveint(value)
if value > 70:
value = value / 10
@@ -165,18 +164,20 @@ def check_cisco_temp_sensor(item, params, info):
levels = " (warn/crit at %.1f/%.1f °C)" % (warn, crit)
perfdata = [ ( "temperature", temp, warn, crit ) ]
state = 0
- if sensorstate == "2":
- return (3, "data from sensor currently not available")
- elif sensorstate == "3":
- return (3, "sensor is broken")
- if temp >= crit:
- state = 2
- infotext += levels
- elif temp >= warn:
- state = 1
- infotext += levels
- return state, infotext, perfdata
- return (3, "sensor not found in SNMP data")
+
+ if sensorstate == "2":
+ return (3, "Data from sensor currently not available")
+ elif sensorstate == "3":
+ return (3, "Sensor is broken")
+
+ if temp >= crit:
+ state = 2
+ infotext += levels
+ elif temp >= warn:
+ state = 1
+ infotext += levels
+ return state, infotext, perfdata
+ return (3, "Sensor not found in SNMP data")
check_info['cisco_temp_sensor'] = {
Module: check_mk
Branch: master
Commit: 70fea83a663d3a7b20166991cac19b4477f7c9d3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=70fea83a663d3a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Aug 13 17:12:55 2014 +0200
fixed exception in cisco_temp_sensor
---
checks/cisco_temp_sensor | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/checks/cisco_temp_sensor b/checks/cisco_temp_sensor
index 06cc9cd..2a1d8f1 100644
--- a/checks/cisco_temp_sensor
+++ b/checks/cisco_temp_sensor
@@ -119,13 +119,13 @@ def parse_cisco_temp_sensor(info):
for id, sensortype, value, sensorstate in state_info:
thresholds.setdefault(id, [])
- for endoid, level in levels_info:
+ for endoid, levels in levels_info:
# endoid is e.g. 21549.9 or 21459.10
level = saveint(levels)
if level > 70:
level = level / 10
id, subid = endoid.split('.')
- thresholds.setdefault(id, []).append(level)
+ thresholds.setdefault(id, []).append(levels)
# Create main dictionary (only of temperature sensors)
sensors = []
@@ -134,7 +134,7 @@ def parse_cisco_temp_sensor(info):
# who are given in tens of degress.
# Seems that some new firmware show this behavier.
# A normal Temperature Sensor has only a range up to
- # 60 degree, so i choiced 70.
+ # 60 degree, so i choiced 70.
value = saveint(value)
if value > 70:
value = value / 10