Module: check_mk
Branch: master
Commit: dc5a372cb6464c2e1c4d754ad82b1682791c6a1e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc5a372cb6464c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Oct 29 14:31:23 2015 +0100
Fixed agent output downloading
---
modules/automation.py | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/modules/automation.py b/modules/automation.py
index d9b1223..6b8f8e3 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -1212,21 +1212,21 @@ def automation_bake_agents():
def automation_get_agent_output(args):
hostname, ty = args
- if ty == "agent":
- return get_plain_hostinfo(hostname)
+ success = True
+ output = ""
+ agent_data = ""
- else:
- path = snmpwalks_dir + "/" + hostname
- success = True
- output = ""
- agent_data = ""
- try:
+ try:
+ if ty == "agent":
+ agent_data = get_plain_hostinfo(hostname)
+ else:
+ path = snmpwalks_dir + "/" + hostname
do_snmpwalk_on(hostname, snmpwalks_dir + "/" + hostname)
agent_data = file(snmpwalks_dir + "/" + hostname).read()
- except Exception, e:
- success = False
- output = "Error walking %s: %s\n" % (hostname, e)
- if opt_debug:
- raise
+ except Exception, e:
+ success = False
+ output = "Failed to fetch data from %s: %s\n" % (hostname, e)
+ if opt_debug:
+ raise
- return success, output, agent_data
+ return success, output, agent_data