[collectd] How to monitor multiple instances of something with the same python module?

Finn, Dan dfinn at ea.com
Fri Feb 20 21:29:02 CET 2015


I'll be using python modules to get metrics on various things, for example mongo and redis.  On each server that we have we run multiple instances of both of those daemons.  I am trying to setup collectd to monitor all of them but am running into an issue.  I'm configuring my python module like so:


<Plugin python>
    ModulePath "/var/lib/collectd/plugins/python"
    Import "mongodb"

    <Module mongodb>
        Host "127.0.0.1"
        Port 26001
        Database "admin" "local"
    </Module>

    <Module mongodb>
        Host "127.0.0.1"
        Port 26002
        Database "admin" "local"
    </Module>

    <Module mongodb>
        Host "127.0.0.1"
        Port 26003
        Database "admin" "local"
    </Module>

    <Module mongodb>
        Host "127.0.0.1"
        Port 26004
        Database "admin" "local"
    </Module>
</Plugin>

This doesn't give any errors but it seems to only collect metrics for the last instance referenced in the config, the one on port 26004 in this example.  I tried setting this up a couple of different ways in the config without any luck, I also tried having multiple <Plugin></Plugin> stanzas for each instance but that didn't work either.

What is the correct way to accomplish this?

Thanks,
Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20150220/0e22d503/attachment.html>


More information about the collectd mailing list