Module: check_mk
Branch: master
Commit: 6d39081515766b140ed0d8446026c038e1da67aa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d39081515766b…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Sep 26 15:15:36 2016 +0200
3747 epson_beamer_lamp: New check to monitor the lamp operation time of Epson beamers
---
.werks/3747 | 9 ++++++
ChangeLog | 1 +
checkman/epson_beamer_lamp | 10 ++++++
checks/epson_beamer_lamp | 60 ++++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 14 +++++++++
5 files changed, 94 insertions(+)
diff --git a/.werks/3747 b/.werks/3747
new file mode 100644
index 0000000..e4e7afd
--- /dev/null
+++ b/.werks/3747
@@ -0,0 +1,9 @@
+Title: epson_beamer_lamp: New check to monitor the lamp operation time of Epson beamers
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1474895699
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index c9c0568..9de7d78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -171,6 +171,7 @@
* 3878 apc_symmetra: divided into several checks...
NOTE: Please refer to the migration notes!
* 3879 ipmi, ipmi_sensors: unified ipmi checks which now work the same way...
+ * 3747 epson_beamer_lamp: New check to monitor the lamp operation time of Epson
beamers
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checkman/epson_beamer_lamp b/checkman/epson_beamer_lamp
new file mode 100644
index 0000000..521bf66
--- /dev/null
+++ b/checkman/epson_beamer_lamp
@@ -0,0 +1,10 @@
+title: Lamp runtime of Epson beamers
+agents: snmp
+catalog: hw/environment/epson
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the lamp runtime of Epson beamers.
+
+inventory:
+ One service per beamer is created.
diff --git a/checks/epson_beamer_lamp b/checks/epson_beamer_lamp
new file mode 100644
index 0000000..994c51a
--- /dev/null
+++ b/checks/epson_beamer_lamp
@@ -0,0 +1,60 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2016 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-
+# tails. 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.
+
+epson_beamer_lamp_default_levels = (1000*3600, 1500*3600)
+
+
+def inventory_epson_beamer_lamp(info):
+ if info:
+ return [ (None, "epson_beamer_lamp_default_levels") ]
+
+
+def check_epson_beamer_lamp(_no_item, params, info):
+ lamp_hrs = int(info[0][0])
+ lamp_time = lamp_hrs * 3600
+ status = 0
+ infotext = "Operation time: %d h" % lamp_hrs
+ if params:
+ warn, crit = params
+ levelstext = " (warn/crit at %.0f/%.0f hours)" % tuple(map(lambda x:
x/3600.0, params))
+ if lamp_time >= crit:
+ status = 2
+ elif lamp_time >= warn:
+ status = 1
+ if status:
+ infotext += levelstext
+ return status, infotext
+
+
+
+check_info['epson_beamer_lamp'] = {
+ "inventory_function" : inventory_epson_beamer_lamp,
+ "check_function" : check_epson_beamer_lamp,
+ "service_description" : "Beamer Lamp",
+ "snmp_info" : (".1.3.6.1.4.1.1248.4.1.1.1.1", [
"0" ]),
+ "snmp_scan_function" : lambda oid: "1248" in
oid(".1.3.6.1.2.1.1.2.0").lower(),
+ "group" : "lamp_operation_time",
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 4581310..d018160 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3238,6 +3238,20 @@ register_check_parameters(
match_type = "dict"
)
+
+register_check_parameters(
+ subgroup_environment,
+ "lamp_operation_time",
+ _("Beamer lamp operation time"),
+ Tuple(
+ elements = [
+ Age(title = _("Warning at"), default_value = 1000*3600, display = [
"hours" ]),
+ Age(title = _("Critical at"), default_value = 1500*3600, display =
[ "hours" ]),
+ ]),
+ None,
+ match_type = "first",
+)
+
#.
# .--Storage-------------------------------------------------------------.
# | ____ _ |