Module: check_mk
Branch: master
Commit: e58625e116c21b241b061bf8a8aad4161b42cb6c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e58625e116c21b…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Jan 17 15:30:58 2014 +0100
emcvnx_info: New info check providing Model, Revision and Serial Number of EMC VNX storage
systems
---
.werks/459 | 8 ++++
ChangeLog | 1 +
agents/special/agent_emcvnx | 6 ++-
checkman/emcvnx_info | 16 ++++++++
checks/emcvnx_info | 86 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 116 insertions(+), 1 deletion(-)
diff --git a/.werks/459 b/.werks/459
new file mode 100644
index 0000000..1654ff5
--- /dev/null
+++ b/.werks/459
@@ -0,0 +1,8 @@
+Title: emcvnx_info: New info check providing Model, Revision and Serial Number of EMC VNX
storage systems
+Level: 2
+Component: checks
+Version: 1.2.5i1
+Date: 1389969007
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 670e51e..3690dbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -51,6 +51,7 @@
* 0457 hitachi_hnas_volume: New check for Usage and Status of Volumes in Hitachi HNAS
storage systems
* 0450 mem.used: Add information about shared memory (on Linux hosts)
* 0458 hitachi_hnas_fc_if: New check for FibreChannel Interfaces in Hitachi HNAS
storage systems
+ * 0459 emcvnx_info: New info check providing Model, Revision and Serial Number of EMC
VNX storage systems
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/agents/special/agent_emcvnx b/agents/special/agent_emcvnx
index b401499..2d5b76f 100755
--- a/agents/special/agent_emcvnx
+++ b/agents/special/agent_emcvnx
@@ -159,12 +159,13 @@ cmd=basecmd + "-sp"
if opt_debug:
sys.stderr.write("executing external command: %s\n" % cmd)
+cmdout = []
for line in os.popen(cmd).readlines():
line = line.strip()
+ cmdout.append(line)
tokens = re.split("\s+", line)
if tokens[0] == "Agent" and tokens[1] == "Rev:":
emcvnx_version = "_".join(tokens[2:])
- break
print "Version: %s" % emcvnx_version
@@ -173,6 +174,9 @@ print "Version: %s" % emcvnx_version
# other commandline argument
#print "AgentOs: %s " % emcvnx_model
+print "<<<emcvnx_info>>>"
+for line in cmdout:
+ print line
#
# all other sections of agent output
diff --git a/checkman/emcvnx_info b/checkman/emcvnx_info
new file mode 100644
index 0000000..d37855e
--- /dev/null
+++ b/checkman/emcvnx_info
@@ -0,0 +1,16 @@
+title: EMC VNX Storage: Info about Model, Revision and Serial Number
+agents: emc
+catalog: hw/storagehw/emc
+license: GPL
+distribution: check_mk
+description:
+ Reports information about Model, Revision and Serial Number on EMC VNX
+ storage systems.
+
+ The check always returns {OK}.
+
+ The information is retriefed by the special agent agent_emcvnx which uses
+ EMC's command line tool naviseccli.
+
+inventory:
+ Finds exactly one check on every EMC VNX storage system called EMC VNX Info
diff --git a/checks/emcvnx_info b/checks/emcvnx_info
new file mode 100644
index 0000000..2f2c295
--- /dev/null
+++ b/checks/emcvnx_info
@@ -0,0 +1,86 @@
+#!/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:
+# <<<emcvnx_info>>>
+#
+#
+# Server IP Address: 10.1.36.13
+# Agent Rev: 7.32.25 (1.56)
+#
+#
+# Agent/Host Information
+# -----------------------
+#
+#
+#
+# Agent Rev: 7.32.25 (1.56)
+# Name: K10
+# Desc:
+# Node: A-CKM00114701225
+# Physical Node: K10
+# Signature: 3195192
+# Peer Signature: 3187006
+# Revision: 05.32.000.5.201
+# SCSI Id: 0
+# Model: VNX5300
+# Model Type: Rackmount
+# Prom Rev: 7.00.00
+# SP Memory: 8192
+# Serial No: CKM00114701225
+# SP Identifier: A
+# Cabinet: DPE7
+#
+# Name of the software package: -Compression
+# Revision of the software package: -
+# Commit Required: NO
+# Revert Possible: NO
+# Active State: YES
+# Is installation completed: YES
+# Is this System Software: NO
+#
+# [... more software packages follow ...]
+
+
+def inventory_emcvnx_info(info):
+ return [ (None, None) ]
+
+
+def check_emcvnx_info(item, _no_params, info):
+ message = ""
+ for line in info:
+ if len(line) > 1 and line[0] in ("Revision:", "Model:",
"Serial"):
+ if message != "":
+ message += ", "
+ message += " ".join(line)
+ return 0, message
+
+
+check_info['emcvnx_info'] = {
+ "inventory_function" : inventory_emcvnx_info,
+ "check_function" : check_emcvnx_info,
+ "service_description" : "EMC VNX Info"
+}