Is this an issue with Telegraf/Influx or Grafana?

Hello,

Why can’t I get the ‘agent_host’ to show in Grafana, it does on other Grafana, Influx, Telegraf setups I’ve used in the past.

Is it me?

My telegraf file: (I’ve altered some of the info for the post due to sensitivity)

 [[inputs.snmp]]
  agents = [ "10.100.32.69:161" ]
  version = 2
  community = "password"

  [inputs.snmp.tags]
    locationd12 = "Big Street "

  [[inputs.snmp.field]]
    name = "d6-hostname"
    oid = "1.3.6.1.2.1.1.5.0"

  [[inputs.snmp.field]]
    name = "d6-uptime"
    oid = "1.3.6.1.2.1.25.1.1.0"

  [[inputs.snmp.field]]
    name = "d6-cpu1"
    oid = "1.3.6.1.2.1.25.3.3.1.2.1"

  [[inputs.snmp.field]]
    name = "d6-cpu2"
    oid = "1.3.6.1.2.1.25.3.3.1.2.2"

  [[inputs.snmp.field]]
    name = "d6-cpu3"
    oid = "1.3.6.1.2.1.25.3.3.1.2.3"

  [[inputs.snmp.field]]
    name = "d6-cpu4"
    oid = "1.3.6.1.2.1.25.3.3.1.2.4"

  [[inputs.snmp.field]]
    name = "d6-cpu5"
    oid = "1.3.6.1.2.1.25.3.3.1.2.5"

  [[inputs.snmp.field]]
    name = "d6-cpu6"
    oid = "1.3.6.1.2.1.25.3.3.1.2.6"

  [[inputs.snmp.field]]
    name = "d6-cpu7"
    oid = "1.3.6.1.2.1.25.3.3.1.2.7"

  [[inputs.snmp.field]]
    name = "d6-cpu8"
    oid = "1.3.6.1.2.1.25.3.3.1.2.8"

What I see when I test:

sudo telegraf --test -config test.conf 
2021-11-05T11:01:39Z I! Starting Telegraf 1.20.3
> snmp,agent_host=10.10.32.69,host=svr-grafana,locationd12=Big\ Street\  d6-cpu4=33i,d6-cpu5=18i,d6-cpu6=21i,d6-cpu7=18i,d6-hostname="NS1-T01",d6-uptime=72835823i 1636110100000000000

What the DB shows:

Chronograf:

Here I can’t see the ‘agent_host’ IP

Grafana:

My DB has a username and password on but in Grafana you can add the DB with not username and password and it allows it, that can’t be right?

image

Usually I’d find the IP in the drop down, but it finds nothing:

image

If I manually put the IP in and choose the fields it finds data.

I’ve always managed to get the drop down to show all the IPs that are configured in the telegraf .conf file but not anymore, I’ve tried influx, telegraf and Grafana on a new VM too and it does the same.

Same with the tag:

image

If I manually type it in it works:

This also stops Variables working in Grafana if I start adding 100s ip IPs.

What do you think is going wrong here?

This is a working setup I’ve used elsewhere as you can see the dropdown for the ‘agent_host’ is pre-populated as it’s pulling from Influx:
image

Any help would be great.

Thanks

Your telegraf --test example proves that telegraf’s output has the agent_host tag. Your select * from snmp query proves that the agent_host tag has been written to influxdb.

Since there’s not much doubt that metrics with agent_host tags are being written to the db, the problem must be between influxdb and grafana.

I wonder if your database has some snmp metrics that don’t have the agent_host tag. If so, maybe grafana only sees them and doesn’t know most of them do have a agent_host. I don’t have much experience with grafana so this is only a guess.

What I did today was remove all my telegraf files out of the telegraf.d folder and left just this one and it started to work. I added the others back in and it stopped.

So one must be causing the issue, so I will add them back one by one and see.