0

I wrote custom python plugin for collectd:

import collectd
import random

def read_callback():
    value = random.randint(0, 1500)
    val = collectd.Values()
    val.plugin = 'test'
    val.plugin_instance = 'random'
    val.type = 'counter'
    val.type_instance = 'random'
    val.values = [value]
    val.dispatch()

collectd.register_read(read_callback)

So I expected to see values from 0 to 1500 in graphite, but got the following list of floats with value much more than 1500:

enter image description here

I don`t have any problems with basic plugins and their metrics, but here very strange behavior. Does any one know why and how I can fix it?

1

The problem was in collectd-graphite flag StoreRates it was set to True, that is why collectd send diff value from the previous and if the new value was less the previous I got weird behaviour.

How to fix same problem: set StoreRates to false.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.