up to now it is only able to check power supplies in Brocade MLX Series
routers
Message-ID: <526a6c34.FU3nwFy1HWuzFA45%bs(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 98333628750ca51d80abac1c82d9d2127eda0989
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=98333628750ca5…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Oct 25 15:03:42 2013 +0200
initial release of brocade_mlx check: up to now it is only able to check power supplies in
Brocade MLX Series routers
---
checks/brocade_mlx | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/checks/brocade_mlx b/checks/brocade_mlx
new file mode 100644
index 0000000..24973cf
--- /dev/null
+++ b/checks/brocade_mlx
@@ -0,0 +1,61 @@
+#!/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.
+
+brocade_mlx_info = ('.1.3.6.1.4.1.1991.1.1.1.2.1.1', [ 1, 2, 3 ])
+
+def inventory_brocade_mlx_power(info):
+ inventory = []
+ for power_id, power_descr, power_state in info:
+ if power_descr == "":
+ power_item = power_id
+ else:
+ power_item = "%s %s" % (power_id, power_descr)
+ inventory.append( (power_item, None) )
+ return inventory
+
+def check_brocade_mlx_power(item, _no_params, info):
+ for power_id, power_descr, power_state in info:
+ if power_descr == "":
+ power_item = power_id
+ else:
+ power_item = "%s %s" % (power_id, power_descr)
+ if power_item == item:
+ if power_state == "2":
+ return 0, "Power supply reports status 2 (normal)"
+ elif power_state == "3":
+ return 2, "Power supply reports status 3 (failure)"
+ else:
+ return 3, "Power supply reports unidentified status %s" %
power_state
+ return 3, "Power supply %s not found" % item
+
+check_info["brocade_mlx.power"] = {
+ "check_function" : check_brocade_mlx_power,
+ "inventory_function" : inventory_brocade_mlx_power,
+ "service_description" : "Power supply %s",
+ "snmp_info" : brocade_mlx_info,
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.1991.1."),
+ "has_perfdata" : False,
+}