Module: check_mk
Branch: master
Commit: 57f46d682234cff23dd505299abf328629af9276
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=57f46d682234cf…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Tue Dec 10 16:39:46 2013 +0100
raritan_pdu_plugs: new check for Raritan PX-2000 family PDUs
This check monitors the state of the plugs of the Raritan PDUs
---
.werks/74 | 8 ++++
ChangeLog | 1 +
checkman/raritan_pdu_plugs | 20 ++++++++
checks/raritan_pdu_plugs | 85 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 40 ++++++++++++++++
5 files changed, 154 insertions(+)
diff --git a/.werks/74 b/.werks/74
new file mode 100644
index 0000000..07300ad
--- /dev/null
+++ b/.werks/74
@@ -0,0 +1,8 @@
+Title: raritan_pdu_plugs: new check for Raritan PX-2000 family PDUs
+Level: 1
+Component: checks
+Version: 1.2.3i8
+Date: 1386689897
+Class: feature
+
+This check monitors the state of the plugs of the Raritan PDUs
diff --git a/ChangeLog b/ChangeLog
index a8429ce..8a6d57f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
* 0105 apc_humidity: New Check for humidity levels on APC Devices
* 0106 3ware_units: The verifying state is now handled as ok...
* 0086 timemachine: new check checking the age of latest backup by timemachine on MAC
OS
+ * 0074 raritan_pdu_plugs: new check for Raritan PX-2000 family PDUs...
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/raritan_pdu_plugs b/checkman/raritan_pdu_plugs
new file mode 100644
index 0000000..f7268c2
--- /dev/null
+++ b/checkman/raritan_pdu_plugs
@@ -0,0 +1,20 @@
+title: Raritan PX-2000 family PDU plug state
+agents: snmp
+catalog: hw/other
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of the plugs of the Raritan PX-2000
+ family of intelligent rack power distribution units (iPDUs).
+ It has been tested with the model PX2-2180CR.
+ As default plugs which are switched {on} are in the state {OK},
+ other states are in the state {CRIT}.
+ The required state can be configured to {off}. Then these plugs are in
+ the state {OK} when they are switched off, 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/raritan_pdu_plugs b/checks/raritan_pdu_plugs
new file mode 100644
index 0000000..8b7145b
--- /dev/null
+++ b/checks/raritan_pdu_plugs
@@ -0,0 +1,85 @@
+#!/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.
+
+raritan_pdu_plugs_default = '"on"'
+
+def inventory_raritan_pdu_plugs(info):
+ inventory = []
+ for line in info:
+ if saveint(line[0]) != 0:
+ inventory.append((line[0], raritan_pdu_plugs_default) )
+ return inventory
+
+def check_raritan_pdu_plugs(item, params, info):
+ required_state = params
+ states = {
+ -1 : "unavailable",
+ 0 : "open",
+ 1 : "closed",
+ 2 : "belowLowerCritical",
+ 3 : "belowLowerWarning",
+ 4 : "normal",
+ 5 : "aboveUpperWarning",
+ 6 : "aboveUpperCritical",
+ 7 : "on",
+ 8 : "off",
+ 9 : "detected",
+ 10: "notDetected",
+ 11: "alarmed",
+ }
+ state = 3
+ message = "Sensor not found"
+
+ for line in info:
+ if line[0] == item:
+ outletLabel = line[0] # Outlet-Label (Index) (PDU identifier of the outlet)
+ outletName = line[1] # OutletName (vergebene Bezeichnung für den Ausgang)
+ outletState = int(line[2]) # The Outlet state at present (sh.
outlet_state_info)
+
+ if states[outletState] == required_state:
+ state = 0
+ else:
+ state = 2
+
+ message = outletName + ": " + states[outletState]
+
+ return (state, message)
+
+check_info['raritan_pdu_plugs'] = {
+ "inventory_function" : inventory_raritan_pdu_plugs,
+ "check_function" : check_raritan_pdu_plugs,
+ "service_description" : "Plug %s",
+ "group" : "plugs",
+ "has_perfdata" : False,
+ "snmp_info" : (".1.3.6.1.4.1.13742.6", [
+ "3.5.3.1.2", # Outlet-Label (Index) (PDU identifier of the
outlet)
+ "3.5.3.1.3", # OutletName (eigene vergebene Bezeichnung für den
Ausgang)
+ "4.1.2.1.3", # Outlet state at present (sh.o. outlet_state_info im
check)
+ ]),
+ "snmp_scan_function" : lambda oid: \
+
oid(".1.3.6.1.4.1.13742.6.3.2.1.1.3.1").startswith("PX2-2")
+
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 914ce58..f6c35b1 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3242,6 +3242,26 @@ register_check_parameters(
register_check_parameters(
subgroup_environment,
+ "plugs",
+ _("State of PDU Plugs"),
+ DropdownChoice(
+ help = _("This rule sets the required state of a PDU plug. It is meant to
"
+ "be independent of the hardware manufacturer."),
+ title = _("Required plug state"),
+ choices = [
+ ( "on", "Plug is ON" ),
+ ( "off", "Plug is OFF" ),
+ ],
+ default_value = "on"
+ ),
+ TextAscii(
+ title = _("Plug Item ID number"),
+ allow_empty = True),
+ None
+)
+
+register_check_parameters(
+ subgroup_environment,
"room_temperature",
_("Room temperature (external thermal sensors)"),
Tuple(
@@ -4138,6 +4158,26 @@ register_check_parameters(
"first"
)
+register_check_parameters(
+ subgroup_applications,
+ "windows_updates",
+ _("WSUS"),
+ Tuple(
+ title = _("Parameters for the Windows Update Check with WSUS"),
+ elements = [
+ Integer(title = _("Warning level for important updates")),
+ Integer(title = _("Critical level for important updates")),
+ Integer(title = _("Warning level for optional updates")),
+ Integer(title = _("Critical level for optional updates")),
+ Age(title = _("Warning level for time until forced reboot"),
default_value = 604800),
+ Age(title = _("Critical level for time until forced reboot"),
default_value = 172800),
+ Checkbox(title = _("display all important updates verbosely"),
default_value = True),
+ ],
+ ),
+ None,
+ "first"
+)
+
register_check_parameters(subgroup_applications,
"logwatch_ec",
_('Logwatch Event Console Forwarding'),