Module: check_mk
Branch: master
Commit: 861fc2f64ea1d4839ce80714cc50f9fbfcd81d80
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=861fc2f64ea1d4…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Feb 21 12:01:08 2017 +0100
4347 packeteer_{fan,ps}_status: Two checks for Blue Coat Packet Shaper devices
Change-Id: I95d13e2a5dbb94d0eab3cff81b809f996480f5ba
---
.werks/4347 | 10 +++++++++
checkman/packeteer_fan_status | 10 +++++++++
checkman/packeteer_ps_status | 10 +++++++++
checks/packeteer_fan_status | 50 +++++++++++++++++++++++++++++++++++++++++++
checks/packeteer_ps_status | 47 ++++++++++++++++++++++++++++++++++++++++
5 files changed, 127 insertions(+)
diff --git a/.werks/4347 b/.werks/4347
new file mode 100644
index 0000000..304559c
--- /dev/null
+++ b/.werks/4347
@@ -0,0 +1,10 @@
+Title: packeteer_{fan,ps}_status: Two checks for Blue Coat Packet Shaper devices
+Level: 1
+Component: checks
+Class: feature
+Compatible: compat
+State: unknown
+Version: 1.5.0i1
+Date: 1487674799
+
+
diff --git a/checkman/packeteer_fan_status b/checkman/packeteer_fan_status
new file mode 100644
index 0000000..3bdbfbd
--- /dev/null
+++ b/checkman/packeteer_fan_status
@@ -0,0 +1,10 @@
+title: Blue Coat Packet Shaper: Fan Status
+agents: snmp
+catalog: hw/network/bluecoat
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of fans as described in the Packeteer MIB.
+
+inventory:
+ One check for each fan will be created.
diff --git a/checkman/packeteer_ps_status b/checkman/packeteer_ps_status
new file mode 100644
index 0000000..034a362
--- /dev/null
+++ b/checkman/packeteer_ps_status
@@ -0,0 +1,10 @@
+title: Blue Coat Packet Shaper: Power Supply Status
+agents: snmp
+catalog: hw/network/bluecoat
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of power supplies as described in the Packeteer MIB.
+
+inventory:
+ One check for each device will be created.
diff --git a/checks/packeteer_fan_status b/checks/packeteer_fan_status
new file mode 100644
index 0000000..51099dc
--- /dev/null
+++ b/checks/packeteer_fan_status
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2017 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.
+
+
+def inventory_packeteer_fan_status(info):
+ for nr, fan_status in enumerate(info[0]):
+ if fan_status in [ u"1", u"2" ]:
+ yield ("%d" % nr, None)
+
+
+def check_packeteer_fan_status(item, _no_params, info):
+ fan_status = info[0][int(item)]
+ if fan_status == u"1":
+ return 0, "OK"
+ elif fan_status == u"2":
+ return 2, "Not OK"
+ elif fan_status == u"3":
+ return 2, "Not present"
+
+
+check_info["packeteer_fan_status"] = {
+ "inventory_function" : inventory_packeteer_fan_status,
+ "check_function" : check_packeteer_fan_status,
+ "service_description" : "Fan Status",
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.2334"),
+ "snmp_info" : ( ".1.3.6.1.4.1.2334.2.1.5", [
"12", "14", "22", "24" ]),
+}
diff --git a/checks/packeteer_ps_status b/checks/packeteer_ps_status
new file mode 100644
index 0000000..1ea140f
--- /dev/null
+++ b/checks/packeteer_ps_status
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2017 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.
+
+
+def inventory_packeteer_ps_status(info):
+ if info:
+ return [ (None, None) ]
+
+
+def check_packeteer_ps_status(_no_item, _no_params, info):
+ for nr, ps_status in enumerate(info[0]):
+ if ps_status == u"1":
+ yield 0, "Power Supply %d okay" % nr
+ else:
+ yield 2, "Power Supply %d not okay" % nr
+
+
+check_info["packeteer_ps_status"] = {
+ "inventory_function" : inventory_packeteer_ps_status,
+ "check_function" : check_packeteer_ps_status,
+ "service_description" : "Power Supply Status",
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.2334"),
+ "snmp_info" : ( ".1.3.6.1.4.1.2334.2.1.5", [
"8", "10" ]),
+}