Module: check_mk
Branch: master
Commit: 337e1d3eb904f46c37a0a14903473d40a5caad29
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=337e1d3eb904f4…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Thu Jun 5 15:45:08 2014 +0200
adva_fsp_current: new check for the power supply units of the ADVA FSP 3000 scalable optical transport solution
---
.werks/618 | 8 +++++
ChangeLog | 1 +
checkman/adva_fsp_current | 22 ++++++++++++
checks/adva_fsp_current | 69 ++++++++++++++++++++++++++++++++++++
web/plugins/perfometer/check_mk.py | 18 ++++++++++
5 files changed, 118 insertions(+)
diff --git a/.werks/618 b/.werks/618
new file mode 100644
index 0000000..d36160b
--- /dev/null
+++ b/.werks/618
@@ -0,0 +1,8 @@
+Title: adva_fsp_current: new check for the power supply units of the ADVA FSP 3000 scalable optical transport solution
+Level: 1
+Component: checks
+Version: 1.2.5i4
+Date: 1401975873
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 7b44c82..dca2aa4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
* 0814 Agent versions can now be checked with "at least version X" parameters...
* 0815 mysql_slave: New check for monitoring MySQL slave sync state
* 0617 adva_fsp_if: new check to monitor interfaces of the ADVA FSP 3000 scalable optical transport solution
+ * 0618 adva_fsp_current: new check for the power supply units of the ADVA FSP 3000 scalable optical transport solution
* 0616 FIX: brocade.fan, brocade.power, brocade.temp: will now only discover services which are not marked as absent
* 0992 FIX: zfs_arc_cache: returns OK even if values of arc meta are missing...
diff --git a/checkman/adva_fsp_current b/checkman/adva_fsp_current
new file mode 100644
index 0000000..e28913f
--- /dev/null
+++ b/checkman/adva_fsp_current
@@ -0,0 +1,22 @@
+title: Adva FSP 3000 Optical Transport: Current of Power Supplies
+catalog: hw/network/adva
+agents: snmp
+license: GPL
+distribution: check_mk
+description:
+ This checks monitors the current measured for power supplies of the
+ ADVA FSP 3000 scalable optical transport solution.
+
+ No limits are set in the check, since limits are configured in the
+ device itself. The upper limit for the current is
+ read from the device. If the current value is outside the allowed
+ range the check is {CRIT}, otherwise it is {OK}.
+
+item:
+ The name of the power supply module
+
+perfdata:
+ One variable: the current in Ampere
+
+inventory:
+ All connected power supply units are detected
diff --git a/checks/adva_fsp_current b/checks/adva_fsp_current
new file mode 100644
index 0000000..4f29cba
--- /dev/null
+++ b/checks/adva_fsp_current
@@ -0,0 +1,69 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | 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.
+
+def inventory_adva_fsp_current(info):
+ inventory = []
+ for line in info:
+ # Ignore non-connected sensors
+ if len(line) == 5 and line[4] != "" and line[2] != "":
+ inventory.append( (line[4], None) )
+ return inventory
+
+def check_adva_fsp_current(item, _no_params, info):
+ for line in info:
+ if len(line) == 5 and line[4] == item:
+ current, high, power, descr = line[0:4]
+ current = float(current)/1000
+ high = float(high)/1000
+
+ infotext = "%.3f A (limit at %.3f A) at %s" % (current, high, descr)
+ perfdata = [ ("current", current, "", str(high), ) ]
+
+ if current <= 0:
+ return(3, "Invalid Sensor Data")
+ elif current >= high:
+ return (2, "%s" % infotext, perfdata)
+ else:
+ return (0, "%s" % infotext, perfdata)
+
+ return (3, "Sensor %s not found in SNMP data" % item)
+
+check_info['adva_fsp_current'] = {
+ "inventory_function" : inventory_adva_fsp_current,
+ "check_function" : check_adva_fsp_current,
+ "service_description" : "Power Supply %s",
+ "has_perfdata" : True,
+ "snmp_info" : ( ".1.3.6.1.4.1.2544", [
+ "1.11.2.4.2.2.1.1", # currentDiagnosticsAmpere
+ "1.11.2.4.2.2.1.2", # currentDiagnosticsUpperThres
+ "1.11.2.4.2.2.1.3", # currentDiagnosticsPsuOutputPower
+ "2.5.5.1.1.1", # inventoryUnitName
+ "2.5.5.2.1.5", # entityIndexAid
+ ]),
+ "snmp_scan_function" : lambda oid:
+ oid(".1.3.6.1.2.1.1.1.0") == "Fiber Service Platform F7",
+ #"group" : "temperature_auto",
+}
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index d049ea4..16dfe17 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -335,6 +335,7 @@ perfometers["check_mk-cmciii.temp"] = perfometer_temperature
perfometers["check_mk-ibm_svc_enclosurestats.temp"] = perfometer_temperature
perfometers["check_mk-wagner_titanus_topsense.temp"] = perfometer_temperature
perfometers["check_mk-enterasys_temp"] = perfometer_temperature
+perfometers["check_mk-adva_fsp_temp"] = perfometer_temperature
def perfometer_temperature_multi(row, check_command, perf_data):
display_value = -1
@@ -1017,3 +1018,20 @@ def perfometer_cache_hit_ratio(row, check_command, perf_data):
perfometers["check_mk-zfs_arc_cache"] = perfometer_cache_hit_ratio
perfometers["check_mk-zfs_arc_cache.l2"] = perfometer_cache_hit_ratio
+def perfometer_current(row, check_command, perf_data):
+ display_color = "#50f020"
+
+ value=savefloat(perf_data[0][1])
+ crit=savefloat(perf_data[0][4])
+ warn=savefloat(perf_data[0][3])
+ current_perc = value/crit*90 # critical is at 90% to allow for more than crit
+
+ if value > warn:
+ display_color = "#FDC840"
+ if value > crit:
+ display_color = "#FF0000"
+
+ display_string = "%.1f Ampere" % value
+ return display_string, perfometer_linear(current_perc, display_color)
+
+perfometers["check_mk-adva_fsp_current"] = perfometer_current
Module: check_mk
Branch: master
Commit: 2a099689384d67601ff84e04dc8036f856039c3b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a099689384d67…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Thu Jun 5 14:19:02 2014 +0200
FIX zfs_arc_cache: returns OK even if values of arc meta are missing
If a ZFS does not report any data about arc meta, the check up to now did
return UNKNOWN state. Now in this case it returns OK, because this is a valid
state for a ZFS too.
Additional adding PNP templates for the graphs.
---
.werks/992 | 12 ++++
ChangeLog | 1 +
checkman/zfs_arc_cache | 5 +-
checks/zfs_arc_cache | 8 +--
pnp-templates/check_mk-zfs_arc_cache.l2.php | 63 ++++++++++++++++++
pnp-templates/check_mk-zfs_arc_cache.php | 96 +++++++++++++++++++++++++++
6 files changed, 178 insertions(+), 7 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=2a09968938…
Module: check_mk
Branch: master
Commit: dc303d29a64707cd8e531de063546f39f866a4eb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc303d29a64707…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 5 11:41:05 2014 +0200
Added PNP-template for new mysql_slave check
---
checks/mysql_slave | 2 +-
pnp-templates/check_mk-mysql_slave.php | 34 ++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/checks/mysql_slave b/checks/mysql_slave
index 56868d1..cf413d6 100644
--- a/checks/mysql_slave
+++ b/checks/mysql_slave
@@ -82,7 +82,7 @@ check_info['mysql_slave'] = {
"check_function" : check_mysql_slave,
"inventory_function" : inventory_mysql_slave,
"service_description" : "MySQL DB Slave",
- "has_perfdata" : False,
+ "has_perfdata" : True,
"group" : "mysql_slave",
}
diff --git a/pnp-templates/check_mk-mysql_slave.php b/pnp-templates/check_mk-mysql_slave.php
new file mode 100644
index 0000000..2161e65
--- /dev/null
+++ b/pnp-templates/check_mk-mysql_slave.php
@@ -0,0 +1,34 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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 'Seconds' -l0 --title \"Seconds behind master\" ";
+
+$def[1] = "DEF:sec=$RRDFILE[1]:$DS[1]:MAX ";
+$def[1] .= "AREA:sec#80f000:\"Slave lag\" ";
+$def[1] .= "LINE:sec#408000 ";
+$def[1] .= "GPRINT:sec:LAST:\"%7.2lf sec LAST\" ";
+$def[1] .= "GPRINT:sec:MAX:\"%7.2lf sec MAX\" ";
+
+?>