Module: check_mk
Branch: master
Commit: 27ac6960a9c5cbc16b2066e4bef06c66c1dea96f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27ac6960a9c5cb…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Mon Aug 5 15:28:37 2013 +0200
agent_emcvnx: implemented --debug option
---
agents/special/agent_emcvnx | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/agents/special/agent_emcvnx b/agents/special/agent_emcvnx
index e13c05e..a18c2ce 100755
--- a/agents/special/agent_emcvnx
+++ b/agents/special/agent_emcvnx
@@ -58,9 +58,8 @@ OPTIONS:
-h, --help Show this help message and exit
-u USER, --user USER Username for EMC VNX login
-p PASSWORD, --password PASSWORD Password for EMC VNX login
- -t, --timeout SECS Set the timeout for naviseccli command execution to SECS
- seconds. The default is 60 sec.
- --debug Debug mode: let Python exceptions come through
+ --debug Debug mode: write some debug messages,
+ let Python exceptions come through
--profile Enable performance profiling in Python source code
@@ -157,7 +156,11 @@ basecmd="naviseccli -h %s -User %s -Password %s -Scope0 getall
" % (host_address
# check_mk section of agent output
#
-cmd=basecmd + " -sp"
+print "<<<check_mk>>>"
+cmd=basecmd + "-sp"
+if opt_debug:
+ sys.stderr.write("executing external command: %s\n" % cmd)
+
for line in os.popen(cmd).readlines():
line = line.strip()
tokens = re.split("\s+", line)
@@ -165,7 +168,6 @@ for line in os.popen(cmd).readlines():
emcvnx_version = "_".join(tokens[2:])
break
-print "<<<check_mk>>>"
print "Version: %s" % emcvnx_version
# maybe we could fill AgentOs: by reading "Model:" line of naviseccli output
@@ -181,6 +183,8 @@ for module in naviseccli_options.keys():
if naviseccli_options[module]["active"] == True:
print "<<<emcvnx_%s>>>" % module
cmd=basecmd + naviseccli_options[module]["cmd_option"]
+ if opt_debug:
+ sys.stderr.write("executing external command: %s\n" % cmd)
for line in os.popen(cmd).readlines():
print line,