Module: check_mk
Branch: master
Commit: 08820697e5c2504dcef4024e156b12119250f549
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=08820697e5c250…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Thu Aug 4 23:53:17 2011 +0200
Add new checks to changelog
---
ChangeLog | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 730b4e4..4a021c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,8 @@
the running state, number of sessions and number of requests now. Can be
extended via agent configuration (j4p.cfg).
* Added some preflight checks to --scan-parents code
+ * New checks netapp_cluster, netapp_vfiler for checking NetAPP filer
+ running as cluster or running vfilers.
Multisite:
* FIX: make non-Ascii characters in services names work again
Module: check_mk
Branch: master
Commit: 310a84dbf60fff457ec6f414eb843c6e5d8dfadf
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=310a84dbf60fff…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Mon Aug 1 17:31:43 2011 +0200
New Checks: netapp_cluster and netapp_vfiler for monitoring Network Appliance Metroclusters and virtual filer instances
---
checkman/netapp_cluster | 20 ++++++++
checkman/netapp_vfiler | 17 +++++++
checks/netapp_cluster | 112 +++++++++++++++++++++++++++++++++++++++++++++++
checks/netapp_vfiler | 72 ++++++++++++++++++++++++++++++
4 files changed, 221 insertions(+), 0 deletions(-)
diff --git a/checkman/netapp_cluster b/checkman/netapp_cluster
new file mode 100644
index 0000000..26c8800
--- /dev/null
+++ b/checkman/netapp_cluster
@@ -0,0 +1,20 @@
+title: Check MetroCluster status on NetAPP Ontap filers
+agents: snmp
+author: Florian Heigl <fh(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the status of NetAPP MetroCluster. It verifies the heartbeat interconnect status, the
+ Partner status and the software defined failover state.
+ It will return WARNING smaller issues (e.g. only one interconnect failure) and CRITICAL on anything that
+ has immediate impact (e.g. being in takeover already)
+
+
+inventory:
+ The check creates one service per Cluster which will be named "Cluster w(ith) Partner_Name".
+
+item:
+ A string named after our Cluster partner.
+
+perfdata:
+ The check does not generate perfdata.
diff --git a/checkman/netapp_vfiler b/checkman/netapp_vfiler
new file mode 100644
index 0000000..9d74089
--- /dev/null
+++ b/checkman/netapp_vfiler
@@ -0,0 +1,17 @@
+title: Check vFiler status on NetAPP Ontap filers
+agents: snmp
+author: Florian Heigl <fh(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the status of any vFiler instances on a NetAPP filer.
+ It alerts the user if one of them is not in status "running" (will be in critical state)
+
+inventory:
+ The check creates one service per vFiler found.
+
+item:
+ A string naming the vFiler as defined on the Filer.
+
+perfdata:
+ The check does not generate perfdata.
diff --git a/checks/netapp_cluster b/checks/netapp_cluster
new file mode 100644
index 0000000..c89c750
--- /dev/null
+++ b/checks/netapp_cluster
@@ -0,0 +1,112 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2010 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.
+
+
+
+
+
+# netappFiler(1)
+# netappClusteredFiler(3)
+# sysStat(2) cf(3) cfSettings(1)
+# cfState(2)
+# cfCannotTakeoverCause(3)
+# cfPartnerStatus(4)
+# cfPartnerName(6)
+# cfInterconnectStatus(8)
+# SNMPv2-SMI::enterprises.789.1.2.3.1.0 = INTEGER: 2
+# SNMPv2-SMI::enterprises.789.1.2.3.2.0 = INTEGER: 2
+# SNMPv2-SMI::enterprises.789.1.2.3.3.0 = INTEGER: 1
+# SNMPv2-SMI::enterprises.789.1.2.3.4.0 = INTEGER: 2
+# SNMPv2-SMI::enterprises.789.1.2.3.6.0 = STRING: "ZMUCFB"
+# SNMPv2-SMI::enterprises.789.1.2.3.8.0 = INTEGER: 4
+
+
+
+def inventory_netapp_cluster(checkname, info):
+
+ inventory = []
+
+ # only inventorizes clusters that dont have takeover disabled.
+ cfSettings, cfState, cfCannotTakeoverCause, cfPartnerStatus, cfPartnerName, cfInterconnectStatus = info[0]
+ if int(cfSettings) not in [1, 3]:
+ # Include the cluster partner name in inventory (value added data)
+ inventory.append ([cfPartnerName, None])
+ return inventory
+
+def check_netapp_cluster(item, _no_params, info):
+
+ cfSettings, cfState, cfCannotTakeoverCause, cfPartnerStatus, cfPartnerName, cfInterconnectStatus = info[0]
+
+
+ # first handle all critical states.
+ # "dead" and "thisNodeDead"
+ if cfState == "1" or cfSettings == "5":
+ return (2, "CRIT - Node is declared dead by cluster")
+ elif cfPartnerStatus in [1, 3]:
+ return (2, "CRIT - Partner Status is dead or maybeDown")
+ elif cfInterconnectStatus == "2":
+ return (2, "CRIT - Cluster Interconnect failure")
+
+
+ # then handle warnings.
+ elif cfSettings in [3, 4] or cfState == "3":
+ return (1, "WARN - Cluster takeover is disabled")
+ elif cfInterconnectStatus == "partialFailure":
+ return (1, "WARN - Cluster interconnect partially failed")
+
+ # if the partner name has changed, we'd like to issue a warning
+ if cfPartnerName != item:
+ return (1, "WARN - Partner Name %s instead of %s") % (cfPartnerName, item)
+
+ # OK - Cluster enabled, Cluster can takeover and the partner is OK and the
+ # infiniband interconnect is working.
+ if cfSettings == "2" and cfState == "2" \
+ and cfCannotTakeoverCause == "1" and cfPartnerStatus == "2" \
+ and cfInterconnectStatus == "4":
+ return (0, "OK - Cluster Status is OK")
+
+ # if we reach here, we hit an unknown case.
+ return (3, "UNKNOWN")
+
+
+
+snmp_info["netapp_cluster"] = \
+ ( ".1.3.6.1.4.1.789.1.2.3", [
+ "1", # cfSettings
+ "2", # cfState
+ "3", # cfCannotTakeoverCause
+ "4", # cfPartnerStatus
+ "6", # cfPartnerName
+ "8" # cfInterconnectStatus
+ ])
+
+
+check_info["netapp_cluster"] = (check_netapp_cluster, "metrocluster_w_%s", 0, inventory_netapp_cluster)
+
+
+# Run inventory only on Data Ontap OS with cluster enabled
+snmp_scan_functions["netapp_cluster"] = \
+ lambda oid: "netapp release" in oid(".1.3.6.1.2.1.1.1.0").lower()
diff --git a/checks/netapp_vfiler b/checks/netapp_vfiler
new file mode 100644
index 0000000..b1de250
--- /dev/null
+++ b/checks/netapp_vfiler
@@ -0,0 +1,72 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2010 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.
+
+
+
+
+
+
+# netappFiler(1) vfiler(16) vfTable (3) vfEntry (1) vfName (2)
+# vfState(9)
+
+
+def inventory_netapp_vfiler(checkname, info):
+
+ inventory = []
+ for line in info:
+ # If we find an entry consisting of name and status, add it to inventory.
+ # otherwise we dont inventorize anything.
+ if len(info) == 2:
+ inventory.append([line[0], None])
+
+ return inventory
+
+def check_netapp_vfiler(item, _no_params, info):
+
+ for vfEntry in info:
+ vfName, vfState = vfEntry
+ if vfName == item:
+ if vfState == "2":
+ return (0, "OK - vFiler is running")
+ elif vfState == "1":
+ return (2, "CRIT - vFiler is stopped!!")
+ else:
+ return (3, "UNKOWN - vFiler status unknown")
+ return (3, "UNKNOWN - vFiler not found in SNMP output")
+
+
+# get the vfName and vfState from the vfEntry table
+snmp_info["netapp_vfiler"] = \
+ ( ".1.3.6.1.4.1.789.1.16.3.1", [
+ "2", "9", ])
+
+
+check_info["netapp_vfiler"] = (check_netapp_vfiler, "vFiler Status %s", 0, inventory_netapp_vfiler)
+
+
+snmp_scan_functions["netapp_vfiler"] = \
+ lambda oid: "netapp release" in oid("1.3.6.1.2.1.1.1.0").lower()
+