mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 10:39:53 +00:00
Plugin prosody_: interprete input as utf-8
Previously only ascii was accepted. See: https://github.com/munin-monitoring/contrib/pull/1040#issuecomment-780824064 Thanks, msebald!
This commit is contained in:
parent
d5dffef840
commit
c5daa06dde
1 changed files with 5 additions and 5 deletions
|
@ -58,13 +58,13 @@ def main():
|
||||||
telnet = telnetlib.Telnet(host, port)
|
telnet = telnetlib.Telnet(host, port)
|
||||||
telnet.write(b"c2s:show_secure()\n")
|
telnet.write(b"c2s:show_secure()\n")
|
||||||
telnet_response = telnet.read_until(b"secure client connections", 5)
|
telnet_response = telnet.read_until(b"secure client connections", 5)
|
||||||
parsed_info = connection_count_re.findall(telnet_response.decode('ascii'))
|
parsed_info = connection_count_re.findall(telnet_response.decode())
|
||||||
secure_client_connections = int(parsed_info[0])
|
secure_client_connections = int(parsed_info[0])
|
||||||
print("secure_client_connections.value %s" % secure_client_connections)
|
print("secure_client_connections.value %s" % secure_client_connections)
|
||||||
|
|
||||||
telnet.write(b"c2s:show_insecure()\n")
|
telnet.write(b"c2s:show_insecure()\n")
|
||||||
telnet_response = telnet.read_until(b"insecure client connections", 5)
|
telnet_response = telnet.read_until(b"insecure client connections", 5)
|
||||||
parsed_info = connection_count_re.findall(telnet_response.decode('ascii'))
|
parsed_info = connection_count_re.findall(telnet_response.decode())
|
||||||
insecure_client_connections = int(parsed_info[0])
|
insecure_client_connections = int(parsed_info[0])
|
||||||
print("insecure_client_connections.value %s" % insecure_client_connections)
|
print("insecure_client_connections.value %s" % insecure_client_connections)
|
||||||
all_client_connections = secure_client_connections + insecure_client_connections
|
all_client_connections = secure_client_connections + insecure_client_connections
|
||||||
|
@ -86,7 +86,7 @@ def main():
|
||||||
telnet = telnetlib.Telnet(host, port)
|
telnet = telnetlib.Telnet(host, port)
|
||||||
telnet.write(b"s2s:show()\n")
|
telnet.write(b"s2s:show()\n")
|
||||||
telnet_response = telnet.read_until(b"connections", 5)
|
telnet_response = telnet.read_until(b"connections", 5)
|
||||||
parsed_info = server_connections_re.findall(telnet_response.decode('ascii'))
|
parsed_info = server_connections_re.findall(telnet_response.decode())
|
||||||
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(b"quit\n")
|
telnet.write(b"quit\n")
|
||||||
|
@ -109,7 +109,7 @@ def main():
|
||||||
telnet = telnetlib.Telnet(host, port)
|
telnet = telnetlib.Telnet(host, port)
|
||||||
telnet.write(b"c2s:show()\n")
|
telnet.write(b"c2s:show()\n")
|
||||||
telnet_response = telnet.read_until(b"clients", 5)
|
telnet_response = telnet.read_until(b"clients", 5)
|
||||||
parsed_info = client_presence_re.findall(telnet_response.decode('ascii'))
|
parsed_info = client_presence_re.findall(telnet_response.decode())
|
||||||
print("available.value %s" % parsed_info.count("available"))
|
print("available.value %s" % parsed_info.count("available"))
|
||||||
print("chat.value %s" % (parsed_info.count("chat")))
|
print("chat.value %s" % (parsed_info.count("chat")))
|
||||||
print("away.value %s" % (parsed_info.count("away")))
|
print("away.value %s" % (parsed_info.count("away")))
|
||||||
|
@ -137,7 +137,7 @@ def main():
|
||||||
telnet = telnetlib.Telnet(host, port)
|
telnet = telnetlib.Telnet(host, port)
|
||||||
telnet.write(b"server:uptime()\n")
|
telnet.write(b"server:uptime()\n")
|
||||||
telnet_response = telnet.read_until(b"minutes (", 5)
|
telnet_response = telnet.read_until(b"minutes (", 5)
|
||||||
parsed_info = uptime_re.findall(telnet_response.decode('ascii'))
|
parsed_info = uptime_re.findall(telnet_response.decode())
|
||||||
uptime_value = (float(parsed_info[0]) + float(parsed_info[1]) / 24
|
uptime_value = (float(parsed_info[0]) + float(parsed_info[1]) / 24
|
||||||
+ float(parsed_info[2]) / 60 / 24)
|
+ float(parsed_info[2]) / 60 / 24)
|
||||||
print("uptime.value %s" % (uptime_value))
|
print("uptime.value %s" % (uptime_value))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue