diff options
author | Yoann QUERET <yoann@queret.net> | 2021-01-18 11:03:37 +0100 |
---|---|---|
committer | Yoann QUERET <yoann@queret.net> | 2021-01-18 11:03:37 +0100 |
commit | c1d33594ca424b56a34200a6e525cdb1317bad69 (patch) | |
tree | f248fba93e2d658b259b67cf7abaac3906a0eebb /doc/stats_dabmux_munin.py | |
parent | 30f4852883b1a048f3b3db58b6756bcd7af9915b (diff) | |
download | dabmux-c1d33594ca424b56a34200a6e525cdb1317bad69.tar.gz dabmux-c1d33594ca424b56a34200a6e525cdb1317bad69.tar.bz2 dabmux-c1d33594ca424b56a34200a6e525cdb1317bad69.zip |
Make stats_dabmux_munin.py python3 comptabile
Diffstat (limited to 'doc/stats_dabmux_munin.py')
-rwxr-xr-x | doc/stats_dabmux_munin.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/stats_dabmux_munin.py b/doc/stats_dabmux_munin.py index c750d5b..1d08321 100755 --- a/doc/stats_dabmux_munin.py +++ b/doc/stats_dabmux_munin.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # # present statistics from dabmux Stats Server and ZeroMQ RC # to munin. Expects Stats server on port 12720 and ZeroMQ RC @@ -121,7 +121,7 @@ class RCException(Exception): def do_transaction(command, sock): """To a send + receive transaction, quit whole program on timeout""" - sock.send(command) + sock.send(command.encode("utf-8")) poller = zmq.Poller() poller.register(sock, zmq.POLLIN) @@ -129,7 +129,7 @@ def do_transaction(command, sock): socks = dict(poller.poll(1000)) if socks: if socks.get(sock) == zmq.POLLIN: - return sock.recv() + return sock.recv().decode("utf-8") sys.stderr.write("Could not receive data for command '{}'\n".format(command)) sys.exit(1) |