Telegraf: Creating custom RPMs with my own Plugins



I’m trying to create a custom Telegraf RPM that works with my own custom plugin. The plugin itself works properly. My goal is to deploy Telegraf with my Plugin across multiple servers.

I build the RPM by running:
./scripts/ --package --platform=linux

When I try to install this RPM on a server, the default plugins work but my custom plugin doesn’t. It doesn’t cause any errors such as “Unrecognized Plugin” but it still doesn’t do what my plugin should be doing. My plugin configuration file just gets ignored.

What could be the cause of this?


Try starting Telegraf with the --debug flag and make sure it is loading the expected file:

2017/08/15 19:02:27 I! Using config file: /home/dbn/.telegraf/telegraf.conf

If that is working as expected next thing to look for is the plugin being loaded:

2017-08-16T02:02:27Z I! Loaded outputs: file
2017-08-16T02:02:27Z I! Loaded inputs: inputs.logparser


How to create custom RPM


You will need to install Go, dep, and fpm first, then run:

./scripts/ --package --platform=linux --arch=amd64

If all goes well the rpm should be in a directory named build in the source tree.


Thanks @daniel
When I check this file ./telegraf/etc/telegraf/telegraf.conf (Created by Extracting telegraf-1.9.0~91741bd_linux_amd64.tar.gz), I can’t see my custom changes config of my plugin.
I changed Aerospike plugin for my custom expetation