Module: check_mk
Branch: master
Commit: 32ef11a0877057b0e1c4317606e375a9e1d80737
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=32ef11a0877057…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jul 24 14:38:24 2014 +0200
Fixed missing space in help text
---
web/plugins/wato/check_mk_configuration.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 654504b..f6e8637 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1092,7 +1092,7 @@ register_configvar(group,
),
title = _("Log exceptions in check plugins"),
help = _("If this option is enabled Check_MK will create a debug logfile at "
- "<tt>%s/chrashed-checks.log</tt>"
+ "<tt>%s/chrashed-checks.log</tt> "
"containing details about failed checks (those which have the state <i>UNKNOWN "
"and the output UNKNOWN - invalid output from plugin</i>...) Per default no "
"logfile is written.") % defaults.log_dir,
Module: check_mk
Branch: master
Commit: a19011bb5904d804bb1a7b3864d69c8d40c17168
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a19011bb5904d8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 24 11:40:25 2014 +0200
FIX SMS notifications: correctly handling spaces in phone numbers
A user might add a phone number with spaces, because the input is
not validated (formalized). This is a quick fix to prevent sendsms
to send messages to wrong numbers.
---
.werks/1061 | 10 ++++++++++
ChangeLog | 3 ++-
notifications/sms | 2 +-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/1061 b/.werks/1061
new file mode 100644
index 0000000..7da0ce0
--- /dev/null
+++ b/.werks/1061
@@ -0,0 +1,10 @@
+Title: SMS notifications: correctly handling spaces in phone numbers
+Level: 1
+Component: notifications
+Version: 1.2.5i5
+Date: 1406194717
+Class: fix
+
+A user might add a phone number with spaces, because the input is
+not validated (formalized). This is a quick fix to prevent sendsms
+to send messages to wrong numbers.
diff --git a/ChangeLog b/ChangeLog
index 4f05f54..cb4a500 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,8 +38,8 @@
* 1133 qlogic_sanbox_fabric_element: New Check for Fabric Elements in QLogic SANbox Fibre Channel Switches
* 1134 bintec_sensors.fan: New Check for Fan Speed of Bintec Routers
* 1135 bintec_sensors.voltage, bintec_sensors.temp: New Checks for Voltage and Temperature Sensors of Bintec Routers
- * 1136 bintec_brrp_status: New Check for BRRP States on Bintec Routers
* 1048 mem.win: support predictive levels...
+ * 1136 bintec_brrp_status: New Check for BRRP States on Bintec Routers
* 0994 FIX: agent plugin smart: fixed syntax error
* 0989 FIX: logwatch.ec: Fix forwarding multiple messages via syslog/TCP...
* 0943 FIX: if.include: fixed incorrect traffic percentage values in the check output of if checks...
@@ -94,6 +94,7 @@
Notifications:
* 1042 Rule based notifications: allow matching on host groups...
* 0828 FIX: Mails sent with mail/asciimail plugin now really set the from address
+ * 1061 FIX: SMS notifications: correctly handling spaces in phone numbers...
Reporting & Availability:
* 0991 FIX: Availability: optionally show time stamps as UNIX epoch time...
diff --git a/notifications/sms b/notifications/sms
index 0a1dc82..ba310f2 100755
--- a/notifications/sms
+++ b/notifications/sms
@@ -54,7 +54,7 @@ if os.environ['NOTIFY_WHAT'] == 'SERVICE':
else:
message += "is " + os.environ['NOTIFY_HOSTSTATE']
-empf = os.environ['NOTIFY_CONTACTPAGER']
+empf = os.environ['NOTIFY_CONTACTPAGER'].replace( " ", "")
if 0 == os.system("%s %s '%s'" % (send_path, empf, message[:160])):
sys.exit(0)
else:
Module: check_mk
Branch: master
Commit: 3bf97166bd44ccea17eea7f653726b48f000cb43
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3bf97166bd44cc…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Jul 24 11:36:20 2014 +0200
sentry_pdu: New check to monitor plugs of sentry PDUs
---
.werks/183 | 8 ++++
ChangeLog | 3 +-
checkman/sentry_pdu | 18 +++++++++
checks/sentry_pdu | 73 ++++++++++++++++++++++++++++++++++
web/plugins/perfometer/check_mk.py | 13 +++---
web/plugins/wato/check_parameters.py | 3 +-
6 files changed, 111 insertions(+), 7 deletions(-)
diff --git a/.werks/183 b/.werks/183
new file mode 100644
index 0000000..5e76128
--- /dev/null
+++ b/.werks/183
@@ -0,0 +1,8 @@
+Title: sentry_pdu: New check to monitor plugs of sentry PDUs
+Level: 1
+Component: checks
+Version: 1.2.5i5
+Date: 1406194542
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 4f05f54..34be56d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,8 +38,9 @@
* 1133 qlogic_sanbox_fabric_element: New Check for Fabric Elements in QLogic SANbox Fibre Channel Switches
* 1134 bintec_sensors.fan: New Check for Fan Speed of Bintec Routers
* 1135 bintec_sensors.voltage, bintec_sensors.temp: New Checks for Voltage and Temperature Sensors of Bintec Routers
- * 1136 bintec_brrp_status: New Check for BRRP States on Bintec Routers
* 1048 mem.win: support predictive levels...
+ * 1136 bintec_brrp_status: New Check for BRRP States on Bintec Routers
+ * 0183 sentry_pdu: New check to monitor plugs of sentry PDUs
* 0994 FIX: agent plugin smart: fixed syntax error
* 0989 FIX: logwatch.ec: Fix forwarding multiple messages via syslog/TCP...
* 0943 FIX: if.include: fixed incorrect traffic percentage values in the check output of if checks...
diff --git a/checkman/sentry_pdu b/checkman/sentry_pdu
new file mode 100644
index 0000000..018b902
--- /dev/null
+++ b/checkman/sentry_pdu
@@ -0,0 +1,18 @@
+title: Sentry PDU Devices
+agents: snmp
+catalog: hw/other
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of the plugs of Sentry PDUs.
+ As default the state of the time from inventory will result in the state {OK},
+ other states are in the state {CRIT}.
+ The required state can be configured to {on} or {off}. Then these plugs are in
+ the state {OK} when they are in the configured state, and {CRIT} otherwise.
+
+item:
+ The ID Number of the plug as given by the device
+
+inventory:
+ One service per plug will be created
+
diff --git a/checks/sentry_pdu b/checks/sentry_pdu
new file mode 100644
index 0000000..63d279c
--- /dev/null
+++ b/checks/sentry_pdu
@@ -0,0 +1,73 @@
+#!/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_sentry_pdu(info):
+ for line in info:
+ yield line[0], int(line[1])
+
+def check_sentry_pdu(item, params, info):
+ states = {
+ 0: "off",
+ 1: "on",
+ 2: "offWait",
+ 3: "onWait",
+ 4: "offError",
+ 5: "onError",
+ 6: "noComm",
+ }
+ for name, state, power in info:
+ if item == name:
+ required_state = params
+ # The Wato rule returns eighter on or off
+ if required_state == 'on':
+ required_state = 1
+ elif required_state == 'off':
+ required_state = 0
+ state = int(state)
+ power = int(power)
+ infotext = "State is %s" % states[state]
+ if state != required_state:
+ yield 2, infotext
+ else:
+ yield 0, infotext
+
+ infotext = "Current consumption %s Watt" % power
+ perfdata = [ ('power', power )]
+ yield 0, infotext, perfdata
+ return
+
+ yield 3, 'Phase information not found'
+ return
+
+check_info["sentry_pdu"] = {
+ "check_function" : check_sentry_pdu,
+ "inventory_function" : inventory_sentry_pdu,
+ "service_description" : "Plug %s",
+ "group" : "plugs",
+ "snmp_info" : ( ".1.3.6.1.4.1.1718.3.2.2.1", [ 3, 5, 12 ] ),
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0") == ".1.3.6.1.4.1.1718.3",
+}
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 74e6ac6..69a44c9 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -381,6 +381,14 @@ perfometers["check_mk-dell_chassis_power"] = perfometer_power
perfometers["check_mk-dell_chassis_powersupplies"] = perfometer_power
perfometers["check_mk-hp-proliant_power"] = perfometer_power
+def perfometer_power_simple(row, check_command, perf_data):
+ watt = int(perf_data[0][1])
+ text = "%s Watt" % watt
+ return text, perfometer_logarithmic(watt, 150, 2, "#60f020")
+
+perfometers["check_mk-ibm_svc_enclosurestats.power"] = perfometer_power_simple
+perfometers["check_mk-sentry_pdu"] = perfometer_power_simple
+
def perfometer_users(row, check_command, perf_data):
state = row["service_state"]
color = "#39f"
@@ -1008,11 +1016,6 @@ def perfometer_check_mk_ibm_svc_cache(row, check_command, perf_data):
perfometers["check_mk-ibm_svc_nodestats.cache"] = perfometer_check_mk_ibm_svc_cache
perfometers["check_mk-ibm_svc_systemstats.cache"] = perfometer_check_mk_ibm_svc_cache
-def perfometer_check_mk_ibm_svc_power(row, check_command, perf_data):
- watt = int(perf_data[0][1])
- text = "%s Watt" % watt
- return text, perfometer_logarithmic(watt, 150, 2, "#60f020")
-perfometers["check_mk-ibm_svc_enclosurestats.power"] = perfometer_check_mk_ibm_svc_power
def perfometer_licenses_percent(row, check_command, perf_data):
licenses = float(perf_data[0][1])
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 33b2a89..73a2ff4 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3982,7 +3982,8 @@ register_check_parameters(
default_value = "on"
),
TextAscii(
- title = _("Plug Item ID number"),
+ title = _("Plug Item number or name"),
+ help = _("If you need the number or the name depends on the check. Just take a look to the service description. "),
allow_empty = True),
None
)