Telegraf plugin: set source inteface

Started by Mechanix, September 06, 2025, 10:16:41 AM

Previous topic - Next topic
September 06, 2025, 10:16:41 AM Last Edit: September 06, 2025, 10:30:38 AM by Mechanix
I have a Opnsense instance running behind a WireGuard Tunnel. The issue is, that telegraf binds automatically to WG0 interface which is not part of the encrypted traffic and gets dropped.
Is there a way to set the local_address mentioned in the release notes: https://docs.influxdata.com/telegraf/v1/release-notes/

Thanks

P.S.

I'm using:
os-telegraf (installed)   1.12.13

https://github.com/influxdata/telegraf/tree/master/plugins/outputs/influxdb_v2
---

September 06, 2025, 11:52:53 AM #1 Last Edit: September 06, 2025, 11:56:13 AM by meyergru
You can create a default config by using "telegraf config >/tmp/telegraf.conf". It shows:

###############################################################################
#                            OUTPUT PLUGINS                                   #
###############################################################################


# # Configuration for sending metrics to InfluxDB 2.0
# [[outputs.influxdb_v2]]
#   ## The URLs of the InfluxDB cluster nodes.
#   ##
#   ## Multiple URLs can be specified for a single cluster, only ONE of the
#   ## urls will be written to each interval.
#   ##   ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
#   urls = ["http://127.0.0.1:8086"]
#
#   ## Local address to bind when connecting to the server
#   ## If empty or not set, the local address is automatically chosen.
#   # local_address = ""
#
#   ## Token for authentication.
#   token = ""
#
#   ## Organization is the name of the organization you wish to write to.
#   organization = ""
#
#   ## Destination bucket to write into.
#   bucket = ""
#
#   ## The value of this tag will be used to determine the bucket.  If this
...

I assume you must specify an IP.

However, there is no provision in the OpnSense UI to specify that, so you can open a feature request on Github to add an input.

Intel N100, 4* I226-V, 2* 82559, 16 GByte, 500 GByte NVME, ZTE F6005

1100 down / 800 up, Bufferbloat A+

Today at 11:24:16 AM #2 Last Edit: Today at 11:42:05 AM by Mechanix
Thanks for your reply. Need to figure out why I can' t bind the address tough:

E! [agent] Error writing to outputs.influxdb_v2: Post "http://xxxx.2:8086/api/v2/write?bucket=opnsense&org=Proxmox": dial tcp yyy.1:0->xxx.2:8086: bind: can't assign requested address
Edit: got it working . Thanks