问题
I've implemented curl_jason plugin to recolect and send LoadBalancer metrics to my RabbitMQ to be graphed in Graphite. Thing is, it's not sending any data, while it is working just fine (and great) with other plugins like memory, cpu, df root, network, etc. I've tried to troubleshoot following this suggestion: https://serverfault.com/questions/499378/collectd-stores-nan-instead-of-correct-value-in-ubuntu-12-04, but there're no issues coming out.
Here's my collectd.conf: https://gist.github.com/Mariano-gon/8732467
Here're the last lines of collectd.log when I start it: https://gist.github.com/Mariano-gon/8732488
The request is made against Rackspace API where my LoadBalancer is located, and if run manually, the curl gets me a json response perfectly normal.
Here's a snippet of it: https://gist.github.com/Mariano-gon/8732518
I've tried to add a new header in collectd.conf: Header "Accept: /", but didn't work.
Finally, collectd does not create any new folders besides network, df, memory, cpu, etc (all plugins that are correctly working and sending data) when started.
Hope this info helps and any comment will be really appreciated. Thanks!
回答1:
I had same issue, but managed to solve it. Decided to add my solution, to save knowledge.
I'm running collectd
on Debian Jessie with network plugin(data sent to one master server). If you have another OS update commands and paths accordingly.
Personally I had few issues. In curl_json
plugin configuration I used single quotes instead of double quotes. I've found this with
journalctl -u collectd.service
Next issue was related to plugin documentation. Which I read not carefully enough. You MUST add all "type" fields you used in plugin configuration to types.db to ALL servers where data from this plugin will be used:
TypesDB "/usr/share/collectd/types.db"
TypesDB "/etc/collectd/my_types.db"
In my case, I had to add custom types.db to original server where data is collectd and master server to which data is sent for storage.
Keep in mind that you cannot mention in collectd.conf
only custom types.db
. You'll need both.
来源:https://stackoverflow.com/questions/21853369/collectds-curl-json-plugin-not-sending-data-to-graphite