How can I add thousands of SNMP agent to telegraf

Hello,
I am wondering how to add multiple agent to telegraf easily. We’re adding like one router per day, and my team and I don’t wanna go to the config file to add a router to telegraf.

I’ve been thinking of using an environment variable, but there is a size limit.
Or creating a php website to add or delete an ip adress.
Or a bash script
It has to be userfriendly a bit

To add more context, I am a student and i have the project of replace my company monitoring solutions with grafana and telegraf.

Is there a way to add snmp agent throught grafana ?

Any idea ?
Does an agent manager exist ?

############################
#Edgrouter Inputs ##########
##
## EdgeRouter devices
##
 [[inputs.snmp]]
   # List of agents to poll
   agents = [
  "pubIP",
  "pubIP",] + ~ thousands of routers to add

I assume that with that number of devices, and that rate of changes, you are
using some type of Configuration Management System to set up and manage the
devices in the first place, so that’s where I would start with looking for a
way to get it to update telegraf at the same time, instead of creating another
tool to do (part of) the same job.

Antony.

1 Like

Thank you for your reply !
To add more context, I am a student and i have the project of replace my company monitoring solutions with grafana and telegraf.
We don’t have any configuration management system, we do it by hand but I think its a good idea. I’ll try to do it.

1 Like

I’m doing that with Ansible playbooks.

But I would suggest to use a separate [[inputs.snmp]] config for each router, as if one has connectivity issues, it would otherwise impact all the others… Also that way each can have its own community string as well…

1 Like

Can you point me to how you’re doing this? I’m not an experienced ansible user.

Do you think it ok to manage telegraf.conf by some kind of configuration center like ETCD?

I am facing the same problem that to solve the data collecting problem of my company’s around 20 thousand network devices, the first thing orrur to my head is like one [[input.snmp]] per device and then run a daemon to watch all configurations that come from ETCD.

Looking forward to your answers, thanks.

Yes sure, any config management solution will do.

I would not put all those inputs.snmp config in the same telegraf.conf file, but create separate file(s) in the telegraf.d directory.

See also this blog post: Telegraf Best Practices: SNMP Plugin | InfluxData