mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
remove trailing whitespace
This commit is contained in:
parent
0ecf76cda6
commit
855c31d8ba
@ -25,7 +25,7 @@ import os
|
||||
import telnetlib
|
||||
import re
|
||||
|
||||
def main():
|
||||
def main():
|
||||
try:
|
||||
mode = sys.argv[1]
|
||||
except IndexError:
|
||||
@ -33,7 +33,7 @@ def main():
|
||||
wildcard = sys.argv[0].split("prosody_")[1].split("_")[0]
|
||||
host = os.environ.get('host', 'localhost')
|
||||
port = int(os.environ.get('port', 5582))
|
||||
|
||||
|
||||
if mode == "suggest":
|
||||
print "c2s"
|
||||
print "s2s"
|
||||
@ -47,7 +47,7 @@ def main():
|
||||
print "graph_title Prosody C2S Connections"
|
||||
print "graph_vlabel users"
|
||||
print "graph_category Prosody"
|
||||
|
||||
|
||||
print "all_client_connections.label client connections"
|
||||
print "secure_client_connections.label secure client connections"
|
||||
print "insecure_client_connections.label insecure client " \
|
||||
@ -64,7 +64,7 @@ def main():
|
||||
secure_client_connections = int(parsed_info[0])
|
||||
print "secure_client_connections.value %s" % \
|
||||
(secure_client_connections)
|
||||
|
||||
|
||||
telnet.write("c2s:show_insecure()\n")
|
||||
telnet_response = telnet.read_until("insecure client connections",
|
||||
5)
|
||||
@ -76,18 +76,18 @@ def main():
|
||||
insecure_client_connections
|
||||
print "all_client_connections.value %s" % (all_client_connections)
|
||||
telnet.write("quit")
|
||||
|
||||
|
||||
elif wildcard == "s2s":
|
||||
if mode == "config":
|
||||
print "graph_title Prosody S2S Connections"
|
||||
print "graph_vlabel servers"
|
||||
print "graph_category Prosody"
|
||||
|
||||
|
||||
print "outgoing_connections.label outgoing connections"
|
||||
print "incoming_connections.label incoming connections"
|
||||
sys.exit(0)
|
||||
|
||||
else:
|
||||
|
||||
else:
|
||||
server_connections_re = re.compile(r"(\d+) outgoing, (\d+)")
|
||||
telnet = telnetlib.Telnet(host, port)
|
||||
telnet.write("s2s:show()\n")
|
||||
@ -96,7 +96,7 @@ def main():
|
||||
print "outgoing_connections.value %s" % (parsed_info[0][0])
|
||||
print "incoming_connections.value %s" % (parsed_info[0][1])
|
||||
telnet.write("quit")
|
||||
|
||||
|
||||
elif wildcard == "presence":
|
||||
if mode == "config":
|
||||
print "graph_title Prosody Client Presence"
|
||||
@ -110,7 +110,7 @@ def main():
|
||||
print "dnd.label Do Not Disturb Clients"
|
||||
sys.exit(0)
|
||||
|
||||
else:
|
||||
else:
|
||||
client_presence_re = re.compile(r"- (.*?)\(\d+\)")
|
||||
telnet = telnetlib.Telnet(host, port)
|
||||
telnet.write("c2s:show()\n")
|
||||
|
Loading…
Reference in New Issue
Block a user