Module: check_mk
Branch: master
Commit: 97f3ea3acca6c09831fe6e1e64a2e3351621449d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=97f3ea3acca6c0…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Mon Feb 3 14:59:25 2014 +0100
emcvnx_info: now reports information about Model an Revision correctly. It retrieves this
information by an additional call of naviseccli with getagent option
---
agents/special/agent_emcvnx | 29 +++++++++++++++++++++++------
checkman/emcvnx_info | 8 ++++++++
web/plugins/wato/datasource_programs.py | 1 +
3 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/agents/special/agent_emcvnx b/agents/special/agent_emcvnx
index 887ba29..35e5e89 100755
--- a/agents/special/agent_emcvnx
+++ b/agents/special/agent_emcvnx
@@ -65,9 +65,9 @@ OPTIONS:
-i MODULES, --modules MODULES Modules to query. This is a comma separated list of
which may contain the keywords "disks",
"hba", "hwstatus",
- "raidgroups" or "all" to define which
information should
- be queried from the SP. You can define to use only view
of
- them to optimize performance. The default is
"all".
+ "raidgroups", "agent" or
"all" to define which information
+ should be queried from the SP. You can define to use
only
+ view of them to optimize performance. The default is
"all".
""")
@@ -93,6 +93,7 @@ host_address = None
user = None
password = None
mortypes = [ 'all' ]
+fetch_agent_info = False
naviseccli_options = {
"disks" : {"cmd_option" : "-disk",
"active" : False},
@@ -135,6 +136,7 @@ for module in naviseccli_options.keys():
try:
if mortypes.index("all") >= 0:
naviseccli_options[module]["active"] = True
+ fetch_agent_info = True
except ValueError:
pass
@@ -144,19 +146,24 @@ for module in naviseccli_options.keys():
except ValueError:
pass
+try:
+ if mortypes.index("agent") >= 0:
+ fetch_agent_info = True
+except ValueError:
+ pass
#############################################################################
# fetch information by calling naviseccli
#############################################################################
-basecmd="naviseccli -h %s -User %s -Password '%s' -Scope 0 getall " %
(host_address, user, password)
+basecmd="naviseccli -h %s -User %s -Password '%s' -Scope 0 " %
(host_address, user, password)
#
# check_mk section of agent output
#
print "<<<check_mk>>>"
-cmd=basecmd + "-sp"
+cmd=basecmd + "getall -sp"
if opt_debug:
sys.stderr.write("executing external command: %s\n" % cmd)
@@ -179,13 +186,23 @@ print "<<<emcvnx_info>>>"
for line in cmdout:
print line
+# if module "agent" was requested, fetch additional information about the
+# agent, e. g. Model and Revision
+if fetch_agent_info:
+ cmd=basecmd + "getagent"
+ if opt_debug:
+ sys.stderr.write("executing external command: %s\n" % cmd)
+
+ for line in os.popen(cmd).readlines():
+ print line,
+
#
# all other sections of agent output
#
for module in naviseccli_options.keys():
if naviseccli_options[module]["active"] == True:
print "<<<emcvnx_%s>>>" % module
- cmd=basecmd + naviseccli_options[module]["cmd_option"]
+ cmd=basecmd + "getall " +
naviseccli_options[module]["cmd_option"]
if opt_debug:
sys.stderr.write("executing external command: %s\n" % cmd)
for line in os.popen(cmd).readlines():
diff --git a/checkman/emcvnx_info b/checkman/emcvnx_info
index d37855e..a85329c 100644
--- a/checkman/emcvnx_info
+++ b/checkman/emcvnx_info
@@ -12,5 +12,13 @@ description:
The information is retriefed by the special agent agent_emcvnx which uses
EMC's command line tool naviseccli.
+ The full information is only available if you did switch on the "Model and
+ Revsion" switch in the WATO rule "Check state of EMC VNX storage systems"
or
+ did call the special agent (as datasource program) with --modules option
+ including "agent" module. If you are not interested in Model and Revision of
+ your Storage device you can switch this off and save one call of naviseccli in
+ every check interval. In this case the Check reports only the serial number
+ of the SP.
+
inventory:
Finds exactly one check on every EMC VNX storage system called EMC VNX Info
diff --git a/web/plugins/wato/datasource_programs.py
b/web/plugins/wato/datasource_programs.py
index 60f39f5..9989cbc 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -193,6 +193,7 @@ register_rule(group,
( "hba", _("iSCSI HBAs") ),
( "hwstatus", _("Hardware Status") ),
( "raidgroups", _("RAID Groups") ),
+ ( "agent", _("Model and Revsion")
),
],
default_value = [ "disks", "hba",
"hwstatus", ],
allow_empty = False,