Hi,
Today I have captured wireshark at destination server where telegraf plugin is installed and found the following output.
It clearly provide some additional details that telegraf is not receiving any snmp_trap data, but no issues either in server/network/firewall end.
In the wireshark logs it clearly received snmp_trap data from the source device
But whilst running the telegraf --test to get snmp_trap data nothing has been received.
Once again I run the same command and here is the outcome. In the wireshark trace this server is receiving the trap OID data from the remote agent. At least it should send the output to influxDB which is running in same server, but nothing has been received.
2023-08-21T12:47:16Z I! Loading config file: telegraf_snmp_trap.conf
2023-08-21T12:47:16Z W! DeprecationWarning: Option “timeout” of plugin “inputs.snmp_trap” deprecated since version 1.20.0 and will be removed in 2.0.0: unused option
2023-08-21T12:47:16Z I! Starting Telegraf 1.26.0
2023-08-21T12:47:16Z I! Available plugins: 235 inputs, 9 aggregators, 27 processors, 22 parsers, 57 outputs, 2 secret-stores
2023-08-21T12:47:16Z I! Loaded inputs: snmp snmp_trap
2023-08-21T12:47:16Z I! Loaded aggregators:
2023-08-21T12:47:16Z I! Loaded processors:
2023-08-21T12:47:16Z I! Loaded secretstores:
2023-08-21T12:47:16Z W! Outputs are not used in testing mode!
2023-08-21T12:47:16Z I! Tags enabled: host=tsdcgbddwmdk01
2023-08-21T12:47:16Z W! Deprecated inputs: 0 and 1 options
2023-08-21T12:47:17Z I! [inputs.snmp_trap] Listening on udp://:162
2023-08-21T12:48:57Z E! [inputs.snmp] Error in plugin: agent udp://10.11.10.10:161: performing get on field uptime: request timeout (after 3 retries)
2023-08-21T12:49:57Z E! [telegraf] Error running agent: input plugins recorded 1 errors
As requested multiple times before, run telegraf in test mode and then send traps. I didn’t see that yet. Either you run telegraf in regular mode, or you run it in test mode while another telegraf is still listening on port 162. Both are not helpful in any way.
Sorry I forgot to add the entire output including command in previous note. Here is the details.
If I kill the telegraf process and run this --test command, I am not getting error: udp :162: bind: address already in use. However even after kill the process of Telegraf associated to 162 port no output.
[root@tsdcgbddwmdk01 telegraf.d]$ telegraf --config telegraf_snmp_trap.conf --test-wait 120
2023-08-21T12:47:16Z I! Loading config file: telegraf_snmp_trap.conf
2023-08-21T12:47:16Z W! DeprecationWarning: Option “timeout” of plugin “inputs.snmp_trap” deprecated since version 1.20.0 and will be removed in 2.0.0: unused option
2023-08-21T12:47:16Z I! Starting Telegraf 1.26.0
2023-08-21T12:47:16Z I! Available plugins: 235 inputs, 9 aggregators, 27 processors, 22 parsers, 57 outputs, 2 secret-stores
2023-08-21T12:47:16Z I! Loaded inputs: snmp snmp_trap
2023-08-21T12:47:16Z I! Loaded aggregators:
2023-08-21T12:47:16Z I! Loaded processors:
2023-08-21T12:47:16Z I! Loaded secretstores:
2023-08-21T12:47:16Z W! Outputs are not used in testing mode!
2023-08-21T12:47:16Z I! Tags enabled: host=tsdcgbddwmdk01
2023-08-21T12:47:16Z W! Deprecated inputs: 0 and 1 options
2023-08-21T12:47:17Z I! [inputs.snmp_trap] Listening on udp://:162
2023-08-21T12:48:57Z E! [inputs.snmp] Error in plugin: agent udp://10.11.10.10:161: performing get on field uptime: request timeout (after 3 retries)
2023-08-21T12:49:57Z E! [telegraf] Error running agent: input plugins recorded 1 errors
@Hipska, I am able to fix the UDP issue, and now we are not getting udp port in use error.
However I am still not getting any test traps from the remote agent, but no issues for the port 162 as we are seeing in the TCP dump, whilst executing the below command no output received for input snmp_trap.
[root@tsdcgbddwmdk01 telegraf.d]# telegraf --config telegraf_snmp_trap.conf --test-wait 60
2023-08-31T10:19:52Z I! Loading config file: telegraf_snmp_trap.conf
2023-08-31T10:19:52Z W! DeprecationWarning: Option “timeout” of plugin “inputs.snmp_trap” deprecated since version 1.20.0 and will be removed in 2.0.0: unused option
2023-08-31T10:19:52Z I! Starting Telegraf 1.26.0
2023-08-31T10:19:52Z I! Available plugins: 235 inputs, 9 aggregators, 27 processors, 22 parsers, 57 outputs, 2 secret-stores
2023-08-31T10:19:52Z I! Loaded inputs: snmp snmp_trap
2023-08-31T10:19:52Z I! Loaded aggregators:
2023-08-31T10:19:52Z I! Loaded processors:
2023-08-31T10:19:52Z I! Loaded secretstores:
2023-08-31T10:19:52Z W! Outputs are not used in testing mode!
2023-08-31T10:19:52Z I! Tags enabled: host=tsdcgbddwmdk01
2023-08-31T10:19:52Z W! Deprecated inputs: 0 and 1 options
2023-08-31T10:19:52Z I! [inputs.snmp_trap] Listening on udp://:162
[root@tsdcgbddwmdk01 telegraf.d]#