influxdata / influxdata/telegraf
A plugin to monitor websites the way traceroute does.
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Use Case
Curently we can do this via the `exec` plugin as described below.
```
[[inputs.exec]]
interval = "60s"
commands=["sudo mtr -C -n google.com"]
timeout = "40s"
data_format = "csv"
csv_skip_rows = 1
csv_column_names=["", "", "status", "dest", "hop", "ip", "loss", "snt", "", "", "avg", "best", "worst", "stdev"]
name_override = "mtr"
csv_tag_columns = ["dest", "hop", "ip"]
```
But this requires telegraf having `sudo` user access so that it can execute `mtr` command.
The idea is to get this functionality in a native plugin.
Example new plugin :
```
[[inputs.trace]]
interval = "60s"
sites=["google.com", "github.com", "reddit.com"]
timeout = "40s" # timeout per site can be done using this plugin multiple times for each site requiring a different timeout.
column_names=["", "", "status", "dest", "hop", "ip", "loss", "snt", "", "", "avg", "best", "worst", "stdev"]
```
### Expected behavior
Not sure but it could look like how `mtr` provides output:
`trace,dest=google.com,hop=7,host=hostname.local,ip=2a00:1450:8106::1 avg=19.83,best=14.22,worst=37.31,stdev=6.73,status="OK",loss=10,snt=10i 1679419996000000000`
It maybe possible to include how many hops it is taking as well, something that `dig` does when doing recurisve search to root servers.
### Actual behavior
I used `mtr` within `exec` for now but it required that I make the current user which ran telegraf a sudoer.
Making it a native plugin that is only dependent on libraries eliminates the need to have it within `sudoer`
### Additional info
```
mtr,dest=facebook.com,hop=10,host=host.local,ip=2a03:2880:f173:81:face:b00c:0:25de status="OK",loss=0,snt=10i,avg=15.05,best=13.42,worst=17.87,stdev=1.34 1679419996000000000
mtr,dest=google.com,hop=1,host=host.local,ip=2a02:a210:abd:2600:aef8:ccff:feeb:c984 avg=4.86,best=4.21,worst=5.51,stdev=0.92,status="OK",loss=80,snt=10i 1679419996000000000
mtr,dest=reddit.com,hop=2,host=host.local,ip=??? stdev=0,status="OK",loss=100,snt=10i,avg=0,best=0,worst=0 1679420055000000000
```
Contributor guide
Assessment
This issue has not been assessed yet.