influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.51k stars 5.56k forks source link

How can I add thousands of SNMP agent to telegraf #10022

Closed jordandubu closed 2 years ago

jordandubu commented 2 years ago

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.

Any idea ?

Does an agent manager exist ?

One more question, do I have to restart telegraf service each time i add a router ?

############################
#Edgrouter Inputs ##########
##
## EdgeRouter devices
##
 [[inputs.snmp]]
   # List of agents to poll
   agents = [
  "pubIP",
  "pubIP",] + ~ thousands of routers to add
telegraf-tiger[bot] commented 2 years ago

Hello! I recommend posting this question in our Community Slack or Community Page, we have a lot of talented community members there who could help answer your question more quickly. Heads up, this issue will be automatically closed after 7 days of inactivity. Thank you!

srebhan commented 2 years ago

@jordandubu would it be an option to add a new config file to the config-directory with every new router you want to add? The file should then contain the inputs.snmp section for the new device...

jordandubu commented 2 years ago

@jordandubu would it be an option to add a new config file to the config-directory with every new router you want to add? The file should then contain the inputs.snmp section for the new device...

Yes, i searched that and it is faster, thanks for the hint :)

jordandubu commented 2 years ago

I just wonder how to correctly do that? should i let the beginning of the telegraf.conf file until the input plugins ?

Should i copy all my input plugins ( 200 lines ) and paste it in a file and doing that for each ip address

like this : /etc/telegraf/telegraf.d/192.168.1.1 /etc/telegraf/telegraf.d/router2

Would it be possible someday to have a telegraf userfriendly local website to manage the conf ?

srebhan commented 2 years ago

Exactly, make each plugin an own file.

Would it be possible someday to have a telegraf userfriendly local website to manage the conf?

What do you mean? You can already specify a http/https address for telegraf to fetch the config...

telegraf-tiger[bot] commented 2 years ago

Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you!