Module: check_mk
Branch: master
Commit: 0227914547c5b138c714f41cd797a1b586472487
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0227914547c5b1…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Apr 4 13:48:48 2014 +0200
ibm_svc_eventlog: New Check for Messages in Event log of IBM SVC / V7000 devices
---
.werks/801 | 8 ++++
ChangeLog | 1 +
agents/special/agent_ibmsvc | 15 +++++---
checkman/ibm_svc_eventlog | 13 +++++++
checks/ibm_svc_eventlog | 61 +++++++++++++++++++++++++++++++
web/plugins/wato/datasource_programs.py | 1 +
6 files changed, 94 insertions(+), 5 deletions(-)
diff --git a/.werks/801 b/.werks/801
new file mode 100644
index 0000000..9c7742b
--- /dev/null
+++ b/.werks/801
@@ -0,0 +1,8 @@
+Title: ibm_svc_eventlog: New Check for Messages in Event log of IBM SVC / V7000 devices
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1396612089
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index a7cb5fd..8f71b33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
NOTE: Please refer to the migration notes!
* 0799 ibm_svc_systemstats.cpu_util: New check for CPU Utilization of an IBM SVC /
V7000 device in total
* 0800 ibm_svc_nodestats.cache, ibm_svc_systemstats.cache: New checks for Cache Usage
of IBM SVC / V7000 devices
+ * 0801 ibm_svc_eventlog: New Check for Messages in Event log of IBM SVC / V7000
devices
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
Multisite:
diff --git a/agents/special/agent_ibmsvc b/agents/special/agent_ibmsvc
index 3598a1e..4a61a04 100755
--- a/agents/special/agent_ibmsvc
+++ b/agents/special/agent_ibmsvc
@@ -61,10 +61,10 @@ OPTIONS:
-i MODULES, --modules MODULES Modules to query. This is a comma separated list of
which may contain the keywords "lshost",
"lslicense",
"lsmdisk", "lsmdiskgrp",
"lsnode", "lsnodestats",
- "lssystem", "lssystemstats" or
"all" to define which
- information should be queried from the device. You can
- define to use only view of them to optimize performance.
- The default is "all".
+ "lssystem", "lssystemstats",
"lseventlog" or "all" to
+ define which information should be queried from the
+ device. You can define to use only view of them to
+ optimize performance. The default is "all".
""")
@@ -100,6 +100,7 @@ command_options = {
"lsnodestats" : {"section_header" :
"ibm_svc_nodestats", "active" : False},
"lssystem" : {"section_header" : "ibm_svc_system",
"active" : False},
"lssystemstats" : {"section_header" :
"ibm_svc_systemstats", "active" : False},
+ "lseventlog" : {"section_header" :
"ibm_svc_eventlog", "active" : False},
}
for o,a in opts:
@@ -156,7 +157,11 @@ cmd = "ssh -o ConnectTimeout=%s %s %s@%s '" %
(opt_timeout, opt_any_hostkey, use
for module in command_options.keys():
if command_options[module]["active"] == True:
- cmd += "echo \<\<\<%s:sep\(58\)\>\>\>; %s -nohdr -delim
:;" % (command_options[module]["section_header"], module)
+ cmd += "echo \<\<\<%s:sep\(58\)\>\>\>;" %
command_options[module]["section_header"]
+ if module == "lseventlog":
+ cmd += "lseventlog -expired no -fixed no -monitoring no -order severity
-message no -delim : -nohdr;"
+ else:
+ cmd += "%s -nohdr -delim :;" % module
cmd += "'"
diff --git a/checkman/ibm_svc_eventlog b/checkman/ibm_svc_eventlog
new file mode 100644
index 0000000..5b6fc24
--- /dev/null
+++ b/checkman/ibm_svc_eventlog
@@ -0,0 +1,13 @@
+title: IBM SVC / V7000: Messages in Event log
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the event log of IBM SVC / V7000 devices for messsages not expired
+ and not yet fixed. Returns {WARN} if there is at least one and {OK} if
+ there is none.
+
+inventory:
+ Creates exactly one check on every IBM SVC / V7000 device named
+ IBM SVC Eventlog.
diff --git a/checks/ibm_svc_eventlog b/checks/ibm_svc_eventlog
new file mode 100644
index 0000000..7d6f893
--- /dev/null
+++ b/checks/ibm_svc_eventlog
@@ -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.
+
+# Example output from agent:
+# <<<ibm_svc_eventlog:sep(58)>>>
+# 588:120404112526:mdiskgrp:6:md07_sas10k::alert:no:989001::Managed Disk Group space
warning
+# 589:120404112851:mdiskgrp:7:md08_nlsas7k_1t::alert:no:989001::Managed Disk Group space
warning
+# 590:120404112931:mdiskgrp:8:md09_nlsas7k_1t::alert:no:989001::Managed Disk Group space
warning
+# 591:120404113001:mdiskgrp:9:md10_nlsas7k_1t::alert:no:989001::Managed Disk Group space
warning
+# 592:120404113026:mdiskgrp:10:md11_nlsas7k_1t::alert:no:989001::Managed Disk Group space
warning
+# 593:120404113111:mdiskgrp:11:md12_nlsas7k_1t::alert:no:989001::Managed Disk Group space
warning
+# 1690:130801070656:drive:59:::alert:no:981020::Managed Disk error count warning
threshold met
+# 2058:131030112416:drive:42:::alert:no:981020::Managed Disk error count warning
threshold met
+
+def inventory_ibm_svc_eventlog(info):
+ return [ (None, None) ]
+
+def check_ibm_svc_eventlog(item, _no_params, info):
+ messagecount = 0
+ last_err = ""
+
+ for sequence_number, last_timestamp, object_type, object_id, object_name, copy_id,
status, fixed, event_id, error_code, description in info:
+ messagecount += 1
+ last_err = description
+
+ if messagecount > 0:
+ return 1, "%d messages not expired and not yet fixed found in event log,
last was: %s" % \
+ (messagecount, last_err)
+
+ return 0, "No messages not expired and not yet fixed found in event log"
+
+check_info["ibm_svc_eventlog"] = {
+ "check_function" : check_ibm_svc_eventlog,
+ "inventory_function" : inventory_ibm_svc_eventlog,
+ "service_description" : "IBM SVC Eventlog",
+ "has_perfdata" : False,
+}
+
diff --git a/web/plugins/wato/datasource_programs.py
b/web/plugins/wato/datasource_programs.py
index 90f9077..990095a 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -273,6 +273,7 @@ register_rule(group,
( "lsnodestats", _("Node Stats") ),
( "lssystem", _("System Info") ),
( "lssystemstats", _("System Stats") ),
+ ( "lseventlog", _("Event Log") ),
],
default_value = [ "lshost", "lslicense",
"lsmdisk", "lsmdiskgrp", "lsnode",
"lsnodestats", "lssystem",
"lssystemstats", ],