# How can I add thousands of SNMP agent to telegraf

**URL:** https://community.influxdata.com/t/how-can-i-add-thousands-of-snmp-agent-to-telegraf/22295
**Category:** Telegraf
**Tags:** snmp
**Created:** [October 28, 2021, 9:24am UTC](https://community.influxdata.com/t/how-can-i-add-thousands-of-snmp-agent-to-telegraf/22295 "2021-10-28T09:24:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Jordan\_Dubu](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jordan_dubu/32/6086_2.png) [@Jordan\_Dubu](https://community.influxdata.com/u/Jordan_Dubu)
#### Post date: [October 28, 2021, 9:24am UTC](https://community.influxdata.com/t/how-can-i-add-thousands-of-snmp-agent-to-telegraf/22295/1 "2021-10-28T09:24:35Z")

</div>

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 ?

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

```

---

<div class="post-metadata">

### Author: ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.influxdata.com/u/Pooh)
#### Post date: [October 28, 2021, 9:44am UTC](https://community.influxdata.com/t/how-can-i-add-thousands-of-snmp-agent-to-telegraf/22295/2 "2021-10-28T09:44:48Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Jordan\_Dubu](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jordan_dubu/32/6086_2.png) [@Jordan\_Dubu](https://community.influxdata.com/u/Jordan_Dubu)
#### Post date: [October 28, 2021, 9:56am UTC](https://community.influxdata.com/t/how-can-i-add-thousands-of-snmp-agent-to-telegraf/22295/3 "2021-10-28T09:56:17Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Hipska](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/hipska/32/3877_2.png) [@Hipska](https://community.influxdata.com/u/Hipska)
#### Post date: [April 22, 2022, 10:33am UTC](https://community.influxdata.com/t/how-can-i-add-thousands-of-snmp-agent-to-telegraf/22295/4 "2022-04-22T10:33:16Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![Dan\_Denson](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dan_denson/32/10640_2.png) [@Dan\_Denson](https://community.influxdata.com/u/Dan_Denson)
#### Post date: [July 31, 2022, 2:14am UTC](https://community.influxdata.com/t/how-can-i-add-thousands-of-snmp-agent-to-telegraf/22295/5 "2022-07-31T02:14:34Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Chaoxing\_Xian](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/chaoxing_xian/32/10636_2.png) [@Chaoxing\_Xian](https://community.influxdata.com/u/Chaoxing_Xian)
#### Post date: [July 31, 2022, 9:27am UTC](https://community.influxdata.com/t/how-can-i-add-thousands-of-snmp-agent-to-telegraf/22295/7 "2022-07-31T09:27:53Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Hipska](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/hipska/32/3877_2.png) [@Hipska](https://community.influxdata.com/u/Hipska)
#### Post date: [August 1, 2022, 10:40am UTC](https://community.influxdata.com/t/how-can-i-add-thousands-of-snmp-agent-to-telegraf/22295/8 "2022-08-01T10:40:13Z")

</div>

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](https://www.influxdata.com/blog/telegraf-best-practices-snmp-plugin/)
