Révision c5daa06d
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!
| plugins/prosody/prosody_ | ||
|---|---|---|
| 58 | 58 |
telnet = telnetlib.Telnet(host, port) |
| 59 | 59 |
telnet.write(b"c2s:show_secure()\n") |
| 60 | 60 |
telnet_response = telnet.read_until(b"secure client connections", 5) |
| 61 |
parsed_info = connection_count_re.findall(telnet_response.decode('ascii'))
|
|
| 61 |
parsed_info = connection_count_re.findall(telnet_response.decode()) |
|
| 62 | 62 |
secure_client_connections = int(parsed_info[0]) |
| 63 | 63 |
print("secure_client_connections.value %s" % secure_client_connections)
|
| 64 | 64 |
|
| 65 | 65 |
telnet.write(b"c2s:show_insecure()\n") |
| 66 | 66 |
telnet_response = telnet.read_until(b"insecure client connections", 5) |
| 67 |
parsed_info = connection_count_re.findall(telnet_response.decode('ascii'))
|
|
| 67 |
parsed_info = connection_count_re.findall(telnet_response.decode()) |
|
| 68 | 68 |
insecure_client_connections = int(parsed_info[0]) |
| 69 | 69 |
print("insecure_client_connections.value %s" % insecure_client_connections)
|
| 70 | 70 |
all_client_connections = secure_client_connections + insecure_client_connections |
| ... | ... | |
| 86 | 86 |
telnet = telnetlib.Telnet(host, port) |
| 87 | 87 |
telnet.write(b"s2s:show()\n") |
| 88 | 88 |
telnet_response = telnet.read_until(b"connections", 5) |
| 89 |
parsed_info = server_connections_re.findall(telnet_response.decode('ascii'))
|
|
| 89 |
parsed_info = server_connections_re.findall(telnet_response.decode()) |
|
| 90 | 90 |
print("outgoing_connections.value %s" % (parsed_info[0][0]))
|
| 91 | 91 |
print("incoming_connections.value %s" % (parsed_info[0][1]))
|
| 92 | 92 |
telnet.write(b"quit\n") |
| ... | ... | |
| 109 | 109 |
telnet = telnetlib.Telnet(host, port) |
| 110 | 110 |
telnet.write(b"c2s:show()\n") |
| 111 | 111 |
telnet_response = telnet.read_until(b"clients", 5) |
| 112 |
parsed_info = client_presence_re.findall(telnet_response.decode('ascii'))
|
|
| 112 |
parsed_info = client_presence_re.findall(telnet_response.decode()) |
|
| 113 | 113 |
print("available.value %s" % parsed_info.count("available"))
|
| 114 | 114 |
print("chat.value %s" % (parsed_info.count("chat")))
|
| 115 | 115 |
print("away.value %s" % (parsed_info.count("away")))
|
| ... | ... | |
| 137 | 137 |
telnet = telnetlib.Telnet(host, port) |
| 138 | 138 |
telnet.write(b"server:uptime()\n") |
| 139 | 139 |
telnet_response = telnet.read_until(b"minutes (", 5)
|
| 140 |
parsed_info = uptime_re.findall(telnet_response.decode('ascii'))
|
|
| 140 |
parsed_info = uptime_re.findall(telnet_response.decode()) |
|
| 141 | 141 |
uptime_value = (float(parsed_info[0]) + float(parsed_info[1]) / 24 |
| 142 | 142 |
+ float(parsed_info[2]) / 60 / 24) |
| 143 | 143 |
print("uptime.value %s" % (uptime_value))
|
Formats disponibles : Unified diff