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