X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=contrib%2Fcollectd_network.py;h=cb328f2b23a69166036793a6e40a12b96ac74e2e;hb=0976eb7abb1c17134ad82ed7ac8d07f4000ce174;hp=9c1e9fb1ba7aad1877ba90bb3cb5bf86315d1d06;hpb=0bdc3011ce40cbbd23dd62aff56a150d5b921fb9;p=collectd.git diff --git a/contrib/collectd_network.py b/contrib/collectd_network.py index 9c1e9fb1..cb328f2b 100644 --- a/contrib/collectd_network.py +++ b/contrib/collectd_network.py @@ -16,7 +16,7 @@ Collectd network protocol implementation. """ -import socket,struct,sys +import socket,struct import platform if platform.python_version() < '2.8.0': # Python 2.7 and below io.StringIO does not like unicode @@ -81,7 +81,7 @@ def decode_network_values(ptype, plen, buf): assert double.size == number.size result = [] - for dstype in buf[header.size+short.size:off]: + for dstype in [ord(x) for x in buf[header.size+short.size:off]]: if dstype == DS_TYPE_COUNTER: result.append((dstype, number.unpack_from(buf, off)[0])) off += valskip