[collectd] Counter metrics with the Python plugin

Marc Tardif marc at interunion.ca
Tue Apr 29 22:04:59 CEST 2014


Hi folks,

I'm using collectd 5.4 to create counter type metrics using the Python
plugin but I only see NaN values in the file generated by the CSV
plugin. Here is the relevant code inspired by
https://github.com/mleinart/collectd-haproxy/blob/master/haproxy.py:

def read_callback():
    offsets = get_offsets()
    for name,value in offsets.items():
        val = collectd.Values(plugin="foo", type="counter")
        val.type_instance = name
        val.values = [int(value)]
        val.dispatch()

collectd.register_read(read_callback)

I know for sure that the value for a given name increases once in a
while but I only see NaN.

-- 
Marc Tardif



More information about the collectd mailing list