Ping Plugin with multiple interfaces

I’m trying to get WAN latency and packet loss from 3 interfaces.

I setup a VM with 3 interfaces and have specific routes for these static IPs to go out specific WAN interfaces.

I’m using a Grafana panel with InfluxDB and Telegraf. With [interface = “eth0”] I can get everything working from a single interface but not sure how to get results for each interface. Basically I want the option to choose eth0, eth1, eth2. Do I have to have separate telegraph.conf files or can I modify my query to pick the interface (similar to how urls = [“x”,“xx”,“xxx”] works…?

I somewhat got this working; although there may be a better way.

I made 3 .conf files and specified unique urls and hostnames in each and their respective interfaces.
I was expecting to be able to choose the host = wanX in grafana… however when I do a influx | use telegraf | select * from ping ORDER BY DESC LIMIT 20 - all the ‘host’ are from WAN3 for each of the 3 unique urls…

so in grafana I then chose the matching url (ip but leave host = wan3 - it works… (I can see each ping/latenecy for each wan and they are all respective to the interface) However, it would be nice to be able to ping the same url (ip) for each interface for consistency

.

example:

wan1.conf
hostname = “wan1”
urls = [“1.1.1.1”]
interface “eth0”

wan2.conf
hostname = “wan2”
urls = [“1.0.0,1”]
interface “eth1”

wan3.conf
hostname = “wan3”
urls = [“8.8.8.8”]
interface “eth2”

1 Like

Hello @cinntech,
Sorry for the delay. You can add tags in telegraf like this:

[[inputs.ping]]
hostname = “wan2”

[inputs.ping.tags]
interface = “foo”

I would try adding tags and using one config.

Thanks!