Module: check_mk
Branch: master
Commit: 292d29f825daa717b937eb67f9a18399bac88f29
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=292d29f825daa7…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Sep 5 16:34:39 2014 +0200
Hivemanger: use ip instead of hostaname to connect to the hivemanager
---
agents/special/agent_hivemanager | 6 +++---
checks/agent_hivemanager | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/agents/special/agent_hivemanager b/agents/special/agent_hivemanager
index e6cae61..80bfb40 100755
--- a/agents/special/agent_hivemanager
+++ b/agents/special/agent_hivemanager
@@ -29,11 +29,11 @@ from urllib2 import urlopen
import urllib2, base64, json
try:
- host = sys.argv[1]
+ ip = sys.argv[1]
user = sys.argv[2]
password = sys.argv[3]
except:
- print "Usage: agent_hivemanager <HOST> <USERNAME>
<PASSWORD>"
+ print "Usage: agent_hivemanager <IP> <USERNAME>
<PASSWORD>"
sys.exit(2)
def get_url(address):
@@ -52,7 +52,7 @@ print "Version: 1.2.5"
print "AgentOs: Hivemanager"
print "<<<hivemanager_devices:sep(124)>>>"
-address = "https://%s/hm/api/v1/devices" % host
+address = "https://%s/hm/api/v1/devices" % ip
for line in json.loads(get_url(address).read()):
if line['upTime'] == '':
line['upTime'] = "down"
diff --git a/checks/agent_hivemanager b/checks/agent_hivemanager
index 5cfe427..4cfd87d 100644
--- a/checks/agent_hivemanager
+++ b/checks/agent_hivemanager
@@ -26,6 +26,6 @@
def agent_hivemanager_arguments(params, hostname, ipaddress):
# User, Password
- return "'%s' %s %s" % ( hostname, quote_shell_string(params[0]),
quote_shell_string(params[1]) )
+ return "'%s' %s %s" % ( ipaddress, quote_shell_string(params[0]),
quote_shell_string(params[1]) )
special_agent_info['hivemanager'] = agent_hivemanager_arguments