Open llamafilm opened 2 months ago
Next steps: Check error in SNMP and reconnect on timeout (or network errors in general).
@srebhan are you asking me to do something? Sorry I didn't understand your comment.
@llamafilm happy to see a PR from your side, but this was more a note to myself as I couldn't work on it immediately. ;-)
FWIW, this issue is still the same in 1.32.1.
Relevant telegraf.conf
System info
Telegraf 1.30.3, Ubuntu 22.04
Steps to reproduce
Expected behavior
All input plugins should behave in the same way, using the new default source IP according to the system route table.
Actual behavior
SNMP input plugin continues using the old source IP until the telegraf process is restarted.
Additional info
Context
I run telegraf in Amazon EC2. The instance is launched with a default network interface which does not have permission to reach most targets through the firewall. Soon after boot-time, a system daemon attaches an ENI (elastic network interface) in the same subnet, which has a static IP with permission to get through the firewall.
The Problem
After adding a new ENI and making it the default route, Telegraf's SNMP input plugin continues sending packets from the old source IP.
Details
Route table before adding ENI:
Route table after adding ENI:
Telegraf log before adding the ENI:
Telegraf log after adding the ENI:
Telegraf log after restarting the process:
tcpdump output:
Example commands to detach and re-attach ENI for debugging: