Telegraf processors to create a new tag

Hi thanks for reading, I need some advice going forward with how to handle my snmp metrics. I will have a few hundred vertiv watchdogs that will have power and temp sensors on them. I want to use the Grafana dashboard and the geomap panel to show the device on the map in a red or green state. Eventually I would like to show green,yellow,red status points on the map based on if the temp was out of range. Before I got too far down the rabbit hole I thought I would find out if this is possible.

My plan was to take the ‘friendlyName’ which I will set on each remote device as ‘name_geohash’ ex: 'US4D_ 87z9y9bm. Then use a processor(maybe?) to split the friendlyName into two tags so I will have a friendlyName=‘US4D’ and a new tag as geoHash=‘87z9y9bm’ so I can use that in the geomap to plot the point.

  1. Is there a better way to do this?
  2. I’m new to processors, could I use the processor.clone and then use the processor.strings on each one to get name and geohash separated? Or how can I add a geohash tag?
  3. Also can I set default values so if I don’t get a response from the watchdog(maybe it’s offline) that I can then place a red circle on the map.

Here is what I’m gathering from snmp:

[[inputs.snmp]]
  agents = ["vertivwatchdog.company.com"]
  version = 2
  community = "xxx"
  name = "Vertiv Geist WD100"

  [[inputs.snmp.field]]
    name = "friendlyName"
    oid = "1.3.6.1.4.1.21239.5.1.1.3.0"
    is_tag = true

  [[inputs.snmp.field]]
    name = "thdSensorTemp"
    oid = "1.3.6.1.4.1.21239.5.1.9.1.5.1"

  [[inputs.snmp.field]]
    name = "internalIO1"
    oid = "1.3.6.1.4.1.21239.5.1.2.1.8.1"

If you know the tags you want in advance, I think you could pre-define the tags using something similar to this:

[[inputs.snmp]]
  <config>

  [inputs.snmp.tags]
    geohash = "87z9y9bm"


[[inputs.snmp]]
  <config>

  [inputs.snmp.tags]
    geohash = "12345ab"

Haven’t tested this, but I know you can define tags in advanced looking at the configuration docs page

I do know the geohash. So I was going to put all the devices in the agents array, but if I do it with manually entered geohash tags then do I duplicate the agent, version, community, and oids for each device? I was hoping to map it or something.

I am not entirely sure of your setup, how many devices you are using, etc. But yes it could result in some duplication. It may be a trade-off you need to decide between the duplication versus trying to parse things and parse data around between processors.

Thank you for the help. I ended up going a different route and gathering some other information from snmp and used the starlark processor plugin to create what I needed.

1 Like