Telegraf snmp.table mpls table

hey guys!

I’m trying to insert the snmpwalk result of a specific OID into telegraf/influx, but without success. This query has an answer via snmpwalk, but there is no result in snmptable (apparently it goes into a loop), I’ve tried different ways, it would be something apparently simple, but I don’t know where I’m going wrong.

Here is the snmpwalk output:

root@graylog:/etc/telegraf# snmpwalk -v2c -ctest251 -Oa -M [/root/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/ share/snmp/mibs/ietf:/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/juniper:/opt/observium/mibs] 172.31.255.251 .1.3. 6.1.4.1.2636.3.2.5.1.1
iso.3.6.1.4.1.2636.3.2.5.1.1.49.48.46.49.48.46.49.48.46.49.48.53.58.68.84.45.82.83.86.80.45.83.80.45.83.80.79.45.65.48.49.4 5.66.75.66.45.82. 84.45.48.48.49 = STRING: "10.10.10.105:DT-RSVP-SP-SPO-A01-BKB-RT-001… "
iso.3.6.1.4.1.2636.3.2.5.1.1.49.48.46.49.48.46.49.48.46.49.51.53.58.68.84.45.82.83.86.80.45.83.80.45.83.80.79.45.65.48.49.4 5.66.75.66.45.82. 84.45.48.48.49 = STRING: "10.10.10.135:DT-RSVP-SP-SPO-A01-BKB-RT-001… "
iso.3.6.1.4.1.2636.3.2.5.1.1.49.48.46.49.48.46.49.48.46.50.52.55.58.68.84.45.82.83.86.80.45.83.80.45.83.80.79.45.65.48.49.4 5.66.75.66.45.82. 84.45.48.48.49 = STRING: "10.10.10.247:DT-RSVP-SP-SPO-A01-BKB-RT-001… "
iso.3.6.1.4.1.2636.3.2.5.1.1.49.48.46.49.48.46.49.48.46.50.52.57.58.68.84.45.82.83.86.80.45.83.80.45.83.80.79.45.65.48.49.4 5.66.75.66.45.82. 84.45.48.48.49 = STRING: "10.10.10.249:DT-RSVP-SP-SPO-A01-BKB-RT-001… "
iso.3.6.1.4.1.2636.3.2.5.1.1.49.48.46.49.48.46.49.48.46.50.53.48.58.68.84.45.82.83.86.80.45.83.80.45.83.80.79.45.65.48.49.4 5.66.75.66.45.82. 84.45.48.48.49 = STRING: "10.10.10.250:DT-RSVP-SP-SPO-A01-BKB-RT-001… "
iso.3.6.1.4.1.2636.3.2.5.1.1.49.48.46.49.48.46.49.48.46.52.53.58.68.84.45.82.83.86.80.45.83.80.45.83.80.79.45.65.48.49.45.6 6.75.66.45.82.84. 45.48.48.49 = STRING: “10.10.10.45:DT-RSVP-SP-SPO-A01-BKB-RT-001…”
iso.3.6.1.4.1.2636.3.2.5.1.1.49.48.46.49.48.46.49.48.46.55.58.68.84.45.82.83.86.80.45.83.80.45.83.80.79.45.65.48.49.45.66.7 5.66.45.82.84.45. 48.48.49 = STRING: "10.10.10.7:DT-RSVP-SP-SPO-A01-BKB-RT-001… "

We have a long list of about 200 lines

And here is the telegraf config:

[[inputs.snmp]]
agents = [“172.31.255.251:161”]
timeout = “90s”
version = 2
community = “test251”
agent_host_tag = “source”
retries = 3
[[inputs.snmp.table]]
name = “mplsLspInfoName”
[[inputs.snmp.table.field]]
oid = “.1.3.6.1.4.1.2636.3.2.5.1.1”
name = “name”
is_tag = true
[[inputs.snmp.table.field]]
oid = “.1.3.6.1.4.1.2636.3.2.5.1.20”
name = “route”

When I use snmptable it simply goes into a loop or timeout and when I run telegraf in debug mode I have the following output:

2024-07-08T21:59:55Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-07-08T22:00:00Z W! [inputs.snmp] Collection took longer than expected; not complete after interval of 5m0s
2024-07-08T22:00:03Z D! [inputs.snmp] Previous collection has not completed; scheduled collection skipped
2024-07-08T22:00:09Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-07-08T22:00:21Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-07-08T22:00:34Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-07-08T22:00:45Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-07-08T22:00:58Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2024-07-08T22:01:00Z E! [inputs.snmp] Error in plugin: agent 172.31.255.251:161: gathering table mplsLspInfoName: performing bulk walk for field route: request timeout (after 3 retries)

Does anyone have any idea what it could be?

Could you first try with a simple field like sysUptime to see if you get any results from that?

hello @Hipska

Some normal ones I can collect, other mibs it seems to go into a loop, ifTable for example I can collect, I can also do snmptable. Example:

snmptable -Oqv -v 2c -c test251 -r 3 -t 120 172.31.255.251 IF-MIB::ifTable
SNMP table: IF-MIB::ifTable
ifIndex ifDescr ifType ifMtu ifSpeed ​​ifPhysAddress ifAdminStatus ifOperStatus ifLastChange ifInOctets ifInUcastPkts ifInNUcastPkts ifInDiscards ifInErrors ifInUnknownProtos ifOutOctets ifOutUcastPkts ifOutNUcastPkts ifOutDiscards ifOutErrors ifOutQLen ifSpecific
INTEGER: 504 STRING: irb INTEGER: other(1) INTEGER: 1514 Gauge32: 0 STRING: 9c:8a:cb:87:16:20 INTEGER: up(1) INTEGER: up(1) Timeticks: (6224) 0: 01:02.24 Counter32: 0 Counter32: 0 Counter32: 0 Counter32: 0 Counter32: 0 Counter32: 0 Counter32: 0 Counter32: 0 Counter32: 0 Counter32: 0 Counter32: 0 Gauge32: 0 OID: SNMPv2-SMI::zeroDotZero

In the case of the MPLS table it apparently goes into a loop.

snmptable -Oqv -v2c -c test251 -r 3 -t 120 172.31.255.251 MPLS-MIB::mplsLspInfoEntry

Killed

It stayed like that for hours until the process itself killed itself.

[2980668.646756] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=init.scope,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1001.slice/session-25352.scope,task=snmptable,pid=3267648,uid=0
[2980668.646782] Out of memory: Killed process 3267648 (snmptable) total-vm:34857596kB, anon-rss:32976108kB, file-rss:4120kB, shmem-rss:0kB, UID:0 pgtables:68256kB oom_score_adj:0
[2980673.113148] oom_reaper: reaped process 3267648 (snmptable), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

@Hipska

Do you think the return string might be too long? I see that it is crashing in this field:

2024-07-15T19:24:06Z E! [inputs.snmp] Error in plugin: agent 172.31.255.251:161: gathering table mplsLspInfoList: performing bulk walk for field mplsPathInfoExplicitRoute: request timeout (after 3 retries)

The WALK Return for this field is like this:

MPLS-MIB::mplsPathInfoExplicitRoute.‘23947’ = STRING: "10.31.255.242 S 10.31.252.21 S 10.31.251.226 S 10.31.252.142 S 10.31.252.5 S 10.31.252.125 S "

Hmm, that lets me thinking to maybe try playing with the max repetitions parameter.

Ps, the command for snmptable was using the wrong oid.

about snmptable I already found the correct table and adjusted it… the correct is mplsLspInfoList

snmptable -Ch -Cl -c public 127.0.0.1 MPLS-MIB::mplsLspInfoList
mplsLspInfoName mplsLspInfoState mplsLspInfoOctets mplsLspInfoPackets mplsLspInfoAge mplsLspInfoTimeUp mplsLspInfoPrimaryTimeUp mplsLspInfoTransitions mplsLspInfoLastTransition mplsLspInfoPathChanges mplsLspInfoLastPathChange mplsLspInfoConfiguredPaths mplsLspInfoStandbyPaths mplsLspInfoOperationalPaths mplsLspInfoFrom mplsLspInfoTo mplsPathInfoName mplsPathInfoType mplsPathInfoExplicitRoute mplsPathInfoRecordRoute mplsPathInfoBandwidth mplsPathInfoCOS mplsPathInfoInclude mplsPathInfoExclude mplsPathInfoSetupPriority mplsPathInfoHoldPriority mplsPathInfoProperties mplsLspInfoAggrOctets mplsLspInfoAggrPackets mplsPathInfoRecordRouteWithLabels
MPLS-MIB::mplsLspInfoList: No entries

Now we need to understand this return from this field

I worked on max repetitions and “it worked” it decreased until I left it at 1 and started collecting the metrics.

2024-07-16T19:23:20Z D! [outputs.influxdb] Wrote batch of 322 metrics in 233.494965ms

Could you explain to me better why this is?

1 Like

I had a similar issue before.

The problem is either at the snmp device or a firewall/router in between dropping fragmented UDP packets.