Generate snmp index for table input

I am trying to add POE monitoring for a network switch but the table they are located in does not respond with index values. Is there a way to auto generate indexes based on the number of walk responses instead, or, to sum the walk responses?

snmpwalk Device 1.3.6.1.2.1.105.1.3.1.1.4
SNMPv2-SMI::mib-2.105.1.3.1.1.4.1 = Gauge32: 0
SNMPv2-SMI::mib-2.105.1.3.1.1.4.2 = Gauge32: 0
SNMPv2-SMI::mib-2.105.1.3.1.1.4.3 = Gauge32: 0

snmpwalk Device 1.3.6.1.2.1.105.1.3.1.1.2
SNMPv2-SMI::mib-2.105.1.3.1.1.2.1 = Gauge32: 123
SNMPv2-SMI::mib-2.105.1.3.1.1.2.2 = Gauge32: 123
SNMPv2-SMI::mib-2.105.1.3.1.1.2.3 = Gauge32: 123

snmpwalk Device 1.3.6.1.2.1.105.1.3
SNMPv2-SMI::mib-2.105.1.3.1.1.2.1 = Gauge32: 123
SNMPv2-SMI::mib-2.105.1.3.1.1.2.2 = Gauge32: 123
SNMPv2-SMI::mib-2.105.1.3.1.1.2.3 = Gauge32: 123
SNMPv2-SMI::mib-2.105.1.3.1.1.3.1 = INTEGER: 1
SNMPv2-SMI::mib-2.105.1.3.1.1.3.2 = INTEGER: 1
SNMPv2-SMI::mib-2.105.1.3.1.1.3.3 = INTEGER: 1
SNMPv2-SMI::mib-2.105.1.3.1.1.4.1 = Gauge32: 0
SNMPv2-SMI::mib-2.105.1.3.1.1.4.2 = Gauge32: 0
SNMPv2-SMI::mib-2.105.1.3.1.1.4.3 = Gauge32: 0
SNMPv2-SMI::mib-2.105.1.3.1.1.5.1 = INTEGER: 80
SNMPv2-SMI::mib-2.105.1.3.1.1.5.2 = INTEGER: 80
SNMPv2-SMI::mib-2.105.1.3.1.1.5.3 = INTEGER: 80

snmpwalk Device 1.3.6.1.2.1.105.1.3.1.1.1
SNMPv2-SMI::mib-2.105.1.3.1.1.1 = No Such Object available on this agent at this OID

pethMainPseObjects .1.3.6.1.2.1.105.1.3
pethMainPseTable .1.3.6.1.2.1.105.1.3.1
pethMainPseEntry .1.3.6.1.2.1.105.1.3.1.1
pethMainPseGroupIndex .1.3.6.1.2.1.105.1.3.1.1.1
pethMainPsePower Watts .1.3.6.1.2.1.105.1.3.1.1.2
pethMainPseOperStatus .1.3.6.1.2.1.105.1.3.1.1.3
pethMainPseConsumptionPower Watts .1.3.6.1.2.1.105.1.3.1.1.4
pethMainPseUsageThreshold % .1.3.6.1.2.1.105.1.3.1.1.5

https://mibs.observium.org/mib/POWER-ETHERNET-MIB/

Hey @npm_engineer,

Welcome to the forum.

I’m not sure of what you are asking…
The different OID you provided us are just to collect data, there’s no indexes…
If you want to be able to identify your different devices, you should also collect the hostname, or IP address, of each device…
If it’s just the ports, I guess it works like it does for all the devices I know:
SNMPv2-SMI::mib-2.105.1.3.1.1.2.1 = port 1
SNMPv2-SMI::mib-2.105.1.3.1.1.2.2 = port 2
SNMPv2-SMI::mib-2.105.1.3.1.1.2.3 = port 3

If this doesn’t help, please explain your problem further.

Regards

1 Like

Thanks for responding. Yes, that’s the issue I am running into, is that there are not indexes to match on. When I add it to our telegraf config and it polls them it only comes back with one value because I don’t have anything that is individual to add a tag to so that it can see them as different items. If I do not add a tag field then telegraf only passes 1 value of “123” to our database instead of passing all three different values of 123 for the “total power”, same for consumption power too. So thats why I was curious if there was a way to tell telegraf, there were three responses, just name them indexes 1,2,3 because there is nothing we can tag against to create the indexes ourself" Hopefully that makes more sense?

[inputs.snmp.tags]
 bucket_name = "********"
[[inputs.snmp.table]]
   name = "***********"
  [[inputs.snmp.table.field]]
    name = "pethMainPsePower"
    oid  = "1.3.6.1.2.1.105.1.3.1.1.2"
    is_tag = true
  [[inputs.snmp.table.field]]
    name = "pethMainPseOperStatus"
    oid  = "1.3.6.1.2.1.105.1.3.1.1.3"
  [[inputs.snmp.table.field]]
    name = "pethMainPseConsumptionPower"
    oid  = "1.3.6.1.2.1.105.1.3.1.1.4"

Hello @npm_engineer,
Yes you’re on the right path but I think you should reference this issue:

Let me know if that helps :slight_smile:

I does and doesn’t. Our situation is a little different because we don’t have anything to differentiate each line against. With that use case they had the different dial peers that could be used as an index / tag. In our situation there is nothing that is different about each line that would be static like a name or index value.

Hmm I’m not sure I do know of an elegant solution.
@Zoe_Steinkamp @jpowers ?

Hmm, what if you set index_as_tag = true? Can you also provide an example of your resulting metrics by adding the [[outputs.file]] output?

2 Likes

Thank you @jpowers that is exactly what I was trying to find (index_as_tag)!