Group snmp router per town on my grafana dashboard

Hello, sorry to bother you.

I am trying to group my snmp router per town on my grafana dashboard

I would like to add a variable but i have no idea how to do that.
I have a json full of city name and their ip adress.

I tried the input file plugin but i’m not sure if its the right way
image

Here is what my var look like :


(site name is router name)
(sorry for bad english)

You need a Processor plugin. I think this should be possible with the processors.enum or processors.regex plugin - if it is only a few routers. If we are talking about hundreds or thousands of routers, I would use a processors.execd plugin.

https://docs.influxdata.com/telegraf/v1.20/plugins/#enum

Thank you for your answer ! , it’s more about hundreds of routers.
I am very new to telegraf, i’m trying to understand what your idea is. So i did that in my telegraf but it dosen’t work… I cant find any example how to do it with execd.
I have a config file per router
image

and in each config file i assign them a group, i have no idea what to put in the command feild, so i typed echo…
image

Can you give me an example how to do that ?

I’m not sure I fully understood your setup, so my answers may lead you into a wrong direction…

If you have a separate config file or inputs.snmp section for each of your hundreds of routers, you could simply add a static tag with the city.

[[inputs.snmp]]
  # snmp config here
  # .....
  [inputs.snmp.tags]
    city = "London"

I assume, this won’t work because you need a processors plugin, not an inputs plugin.

The

[inputs.snmp.tags]

Is exactly what i wanted, thank you !

Thank you for your help :slight_smile:

1 Like