Telegraf SNMPV3 Problem

Hi,
I installed telegraf and influxdb to get data from my san switches using oid, but despite all my attempts I cannot get data with snmp, when I test with snmpwalk I can get an output.

I have created a conf. file under the telegraf.d folder, I am forwarding the contents of my file and all other information, I would appreciate your help, thank you very much.

OS: Rocky Linux release 8.10 (Green Obsidian)
Telegraf 1.33.1 (git: HEAD@44f3a504)
InfluxDB version v2.7.11

[[inputs.snmp]]
agents = [“udp://1.1.1.2:161”]
version = 3
sec_name = “test”
sec_level = “authPriv”
auth_protocol = “SHA512”
auth_password = “xxxxxxx”
priv_protocol = “AES256”
priv_password = “xxxxxxx”

[[inputs.snmp.field]]
name = “cpu”
oid = “1.3.6.1.4.1.1588.2.1.1.1.26.1”

Can you share a snmpwalk that works, omitting passwords is fine?

What you run telegraf with --test can you provide that output also?

snmpwalk -v3 -u monitor -l authPriv -a SHA512 -A xxxx -x AES256 -X xxxx 192.168.1.1 1.3.6.1.4.1.1588.2.1.1.1.26.1
SNMPv2-SMI::enterprises.1588.2.1.1.1.26.1.0 = INTEGER: 4

telegraf --test --config /etc/telegraf/telegraf.d/san_status.conf --debug
Loading config: /etc/telegraf/telegraf.d/san_status.conf
Starting Telegraf 1.33.1 brought to you by InfluxData the makers of InfluxDB
Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
Loaded inputs: snmp
Loaded aggregators:
Loaded processors:
Loaded secretstores:
Outputs are not used in testing mode!
Tags enabled: host=
[agent] The default value of ‘skip_processors_after_aggregators’ will change to ‘true’ with Telegraf v1.40.0! If you need the current default behavior, please explicitly set the option to ‘false’!
[agent] Initializing plugins
DeprecationWarning: Value “agent_host” for option “agent_host_tag” of plugin “inputs.snmp” deprecated since version 1.29.0 and will be removed in 2.0.0: set to “source” for consistent usage across plugins or safely ignore this message and continue to use the current value
[agent] Starting service inputs
[agent] Stopping service inputs
[agent] Input channel closed
[agent] Stopped Successfully

Can you share a copy of your config file, san_status.conf ?

1 Like

[[inputs.snmp]]
agents = [“udp://192.168.1.1:161”]
version = 3
sec_name = “monitor”
sec_level = “authPriv”
auth_protocol = “SHA512”
auth_password = “xxxx”
priv_protocol = “AES256”
priv_password = “xxxx”

[[inputs.snmp.field]]
name = “cpu”
oid = “.1.3.6.1.4.1.1588.2.1.1.1.26.1”

Can you try each of these individually to see if you get any different of an output when running it with --test?

1.) Change agents to: agents = [“192.168.1.1”]
2.) Change oid to: oid = “1.3.6.1.4.1.1588.2.1.1.1.26.1”
3.) Change oid to: oid = “1.3.6.1.4.1.1588.2.1.1.1.26.1.0”

I don’t expect the first option to make a difference, but just curious since I don’t write our config files that way (even though it’s the example). The second removes the leading decimal. The third is removing the leading decimal and also adding the trailing .0 since that’s what your walk attached to it when it did work.

1 Like

Output 1 and 2) agents = [“192.168.1.1”] oid = “1.3.6.1.4.1.1588.2.1.1.1.26.1”

telegraf --test --config /etc/telegraf/telegraf.d/sanstatus.conf --debug
Loading config: /etc/telegraf/telegraf.d/sanstatus.conf
Starting Telegraf 1.33.1 brought to you by InfluxData the makers of InfluxDB
Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
Loaded inputs: snmp
Loaded aggregators:
Loaded processors:
Loaded secretstores:
Outputs are not used in testing mode!
Tags enabled: host=snmonitor
[agent] The default value of ‘skip_processors_after_aggregators’ will change to ‘true’ with Telegraf v1.40.0! If you need the current default behavior, please explicitly set the option to ‘false’!
[agent] Initializing plugins
DeprecationWarning: Value “agent_host” for option “agent_host_tag” of plugin “inputs.snmp” deprecated since version 1.29.0 and will be removed in 2.0.0: set to “source” for consistent usage across plugins or safely ignore this message and continue to use the current value
[agent] Starting service inputs
[agent] Stopping service inputs
[agent] Input channel closed
[agent] Stopped Successfully

Output 3) agents = [“192.168.1.1”] oid = “1.3.6.1.4.1.1588.2.1.1.1.26.1.0”

telegraf --test --config /etc/telegraf/telegraf.d/sanstatus.conf --debug
Loading config: /etc/telegraf/telegraf.d/sanstatus.conf
Starting Telegraf 1.33.1 brought to you by InfluxData the makers of InfluxDB
Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
Loaded inputs: snmp
Loaded aggregators:
Loaded processors:
Loaded secretstores:
Outputs are not used in testing mode!
Tags enabled: host=snmonitor
[agent] The default value of ‘skip_processors_after_aggregators’ will change to ‘true’ with Telegraf v1.40.0! If you need the current default behavior, please explicitly set the option to ‘false’!
[agent] Initializing plugins
DeprecationWarning: Value “agent_host” for option “agent_host_tag” of plugin “inputs.snmp” deprecated since version 1.29.0 and will be removed in 2.0.0: set to “source” for consistent usage across plugins or safely ignore this message and continue to use the current value
[agent] Starting service inputs

snmp,agent_host=192.168.1.1,host=snmonitor swCpuUsage=4i 1738570750000000000
[agent] Stopping service inputs
[agent] Input channel closed
[agent] Stopped Successfully

Looks like the issue was the trailing .0 on the end of the OID to get a single OID response instead of a table like response (even when there is only 1 value in it).

thank you very much for your support, this was solved but now I am facing another problem :slight_smile: