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()
+
Module: check_mk
Branch: master
Commit: 04c399c1431431b26907191825c30e41a02b29a9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=04c399c1431431…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jul 29 09:51:39 2011 +0200
WATO: add helper function for checking ip address
---
web/htdocs/wato.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a1ea3ab..be5b457 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2566,6 +2566,18 @@ class IPAddressAttribute(TextAttribute):
return value.lower().startswith(crit.lower().strip("*"))
+# Helper function for checking if an ip address is valid
+def is_valid_ip_address(ip):
+ try:
+ parts = ip.split('.')
+ if len(parts) != 4:
+ raise Exception()
+ for x in parts:
+ if int(x) < 0 or int(x) > 255:
+ raise Exception()
+ except:
+ return False
+ return True
# A text attribute that is stored in a Nagios custom macro
class NagiosTextAttribute(TextAttribute):
Module: check_mk
Branch: master
Commit: 34d07a9a24586e7993c36a9fed9cdee62c666efe
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=34d07a9a24586e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jul 27 18:40:33 2011 +0200
WATO: fix permsissions bug in i18n
---
web/htdocs/config.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index e9a2c83..997c2b4 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -262,7 +262,7 @@ def role_of_user(u):
def may(permname):
# handle case where declare_permission is done after login
# and permname also not contained in save configuration
- if permname not in permissions:
+ if permname not in user_permissions:
perm = permissions_by_name.get(permname)
if not perm: # Object does not exists, e.g. sidesnap.multisite if not is_multisite()
return False
Module: check_mk
Branch: master
Commit: ce28d8b1134fd410ec3294835abb27ca96650f70
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ce28d8b1134fd4…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jul 27 18:40:10 2011 +0200
Add debug code for Multisite
---
web/htdocs/config.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index b65111f..e9a2c83 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -24,6 +24,16 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+# The following debug code can be used to tackle a mod_python
+# problem when using the local hierarchy for plugins that refer
+# to the config module.
+# import time, os
+# fn = "/tmp/config.load.%d" % os.getpid()
+# if os.path.exists(fn):
+# raise Exception("Mist: config zweimal geladen!!")
+#
+# file(fn, "a").write("[%d] Geladen: %s\n" % (os.getpid(), time.time()))
+
import os, pprint, glob
from lib import *
import defaults
Module: check_mk
Branch: master
Commit: 3fbfeaafc0322b646e610411d1e23d3fdcdf26d7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3fbfeaafc0322b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jul 26 14:21:18 2011 +0200
WATO API: handle special return code False
---
web/htdocs/wato.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 5c446b0..5afddd5 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -114,8 +114,15 @@ def page_handler():
else:
newmode = result
+ # If newmode is False, then we shall immediately abort.
+ # This is e.g. the case, if the page outputted non-HTML
+ # data, such as a tarball (in the export function). We must
+ # be sure not to output *any* further data in that case.
+ if newmode == False:
+ return
+
# if newmode is not None, then the mode has been changed
- if newmode != None:
+ elif newmode != None:
if newmode == "": # no further information: configuration dialog, etc.
if action_message:
html.message(action_message)