Dynamically add and remove devices for SNMP agent_host=r1,r2,r3

Hi Team,

Version 1.19

I’m liking the product so far. I am currently however struggling to come up with a solution for dynamically adding and removing monitored network devices to the variable agent_host of the [[input.snmp]] plugin. Our current model utilizes Telegraf as a producer agent that collects SNMP traffic from our network devices. Forwarding to a Kafka broker and then consumed by an additional Telegraf agent to be munged by a script, and forwarded to an Influxdb instance.

Our ideal state is that the Telegraf producer is running a [[Input.exec]] script that poles our Network database API every x minutes and pulls a list of the latest approved monitoring devices. This will allow us to automatically onboard them.

I tried using Environment variables to add the devices on the fly however the telegraf.conf file is stored in-memory on start-up.

I’m guessing there have been others who have had this problem in the past, so I thought I’d ask the community.

Any guidance would be greatly appreciated.



Love your use case.

Unfortunately, Telegraf does not currently have any live-reload configuration functionality. If a configuration change needs to occur, it requires a restart of Telegraf itself.

This is something we have been looking into, however, it is a pretty major change in terms of the flow of Telegraf, so it is not something that will happen quickly. You might take a look at https://github.com/influxdata/telegraf/issues/802 for some of the back and forth on possible ideas.


Hi jpowers,

Thanks for your response. I managed to create a semi hacky solution using input.exec to run a SIGHUP command after a predefined delay period. Seems to do the trick.