1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-31 21:33:43 +00:00

Merge pull request #705 from clarkspark/master

update presence for prosody 0.10
This commit is contained in:
Stig Sandbeck Mathisen 2016-03-22 22:55:00 +01:00
commit 2b3fc28c45

View file

@ -75,7 +75,7 @@ def main():
all_client_connections = secure_client_connections + \
insecure_client_connections
print "all_client_connections.value %s" % (all_client_connections)
telnet.write("quit")
telnet.write("quit\n")
elif wildcard == "s2s":
if mode == "config":
@ -95,7 +95,7 @@ def main():
parsed_info = server_connections_re.findall(telnet_response)
print "outgoing_connections.value %s" % (parsed_info[0][0])
print "incoming_connections.value %s" % (parsed_info[0][1])
telnet.write("quit")
telnet.write("quit\n")
elif wildcard == "presence":
if mode == "config":
@ -111,7 +111,7 @@ def main():
sys.exit(0)
else:
client_presence_re = re.compile(r"- (.*?)\(\d+\)")
client_presence_re = re.compile(r"[-\]] (.*?)\(\d+\)")
telnet = telnetlib.Telnet(host, port)
telnet.write("c2s:show()\n")
telnet_response = telnet.read_until("clients", 5)
@ -121,7 +121,7 @@ def main():
print "away.value %s" % (parsed_info.count("away"))
print "xa.value %s" % (parsed_info.count("xa"))
print "dnd.value %s" % (parsed_info.count("dnd"))
telnet.write("quit")
telnet.write("quit\n")
elif wildcard == "uptime":
if mode == "config":
@ -147,7 +147,7 @@ def main():
uptime_value = float(parsed_info[0]) + float(parsed_info[1])/24 +\
float(parsed_info[2])/60/24
print "uptime.value %s" % (uptime_value)
telnet.write("quit")
telnet.write("quit\n")
elif wildcard == "users":
if mode == "config":