Module: check_mk
Branch: master
Commit: 0ce732116d025c020dae3bbb417ca8c7609fb931
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0ce732116d025c…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue May 26 10:53:40 2015 +0200
alcatel_fans: New check to monitor fans on alcatel switches
---
checkman/alcatel_fans | 12 ++++++++++++
checks/alcatel_fans | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+)
diff --git a/checkman/alcatel_fans b/checkman/alcatel_fans
new file mode 100644
index 0000000..e9e97eb
--- /dev/null
+++ b/checkman/alcatel_fans
@@ -0,0 +1,12 @@
+title: Alcatel switches: Fan Status
+agents: snmp
+catalog: hw/network/alcatel
+license: GPL
+distribution: check_mk
+description:
+ This Check Monitors all Fans on Alcatel switches supporting the
ALCATEL-IND1-CHASSIS-MIB.
+ The status is automaticly reported by the device, so no configuration is needed
+
+inventory:
+ One check is created for each fan
+
diff --git a/checks/alcatel_fans b/checks/alcatel_fans
new file mode 100644
index 0000000..37dc370
--- /dev/null
+++ b/checks/alcatel_fans
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | 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.
+
+def inventory_alcatel_fan(info):
+ for nr, value in enumerate(info, start=1):
+ yield nr, None
+
+def check_alcatel_fan(item, _no_params, info):
+ fan_states = {
+ 0 : "has no Status",
+ 1 : "Not running",
+ 2 : "Running",
+ }
+ for nr, value in enumerate(info, start=1):
+ if nr == item:
+ fan_state = int(value[0])
+ state = 0
+ if fan_state != 2:
+ state = 2
+ return state, "Fan " + fan_states[fan_state]
+
+check_info["alcatel_fan"] = {
+ "check_function" : check_alcatel_fan,
+ "inventory_function" : inventory_alcatel_fan,
+ "service_description" : "Fan %s",
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.6486.800"),
+ "snmp_info" :
(".1.3.6.1.4.1.6486.800.1.1.1.3.1.1.11.1", [ 2 ]),
+}