influxdata / influxdata/telegraf
perrmisions error with disk input
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Relevant telegraf.conf
```toml
Telegraf 1.33.0 (git: HEAD@67902005)
Debian GNU/Linux 12 (bookworm)
Raspberry Pi 5 Model B Rev 1.0
[[inputs.disk]]
## By default stats will be gathered for all mount points.
## Set mount_points will restrict the stats to only the specified mount points.
# mount_points = ["/"]
## Ignore mount points by filesystem type.
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"]
```
### Logs from Telegraf
```text
tcronin:tec-pi-mgr ~:cat /var/log/telegraf/telegraf.log
2024-12-17T05:26:01Z W! Telegraf is not permitted to read /etc/telegraf/telegraf.d
2024-12-17T05:26:01Z I! Loading config: /etc/telegraf/telegraf.conf
2024-12-17T05:26:01Z I! Starting Telegraf 1.33.0 brought to you by InfluxData the makers of InfluxDB
2024-12-17T05:26:01Z I! Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
2024-12-17T05:26:01Z I! Loaded inputs: cpu disk diskio exec mem net processes swap system temp
2024-12-17T05:26:01Z I! Loaded aggregators:
2024-12-17T05:26:01Z I! Loaded processors:
2024-12-17T05:26:01Z I! Loaded secretstores:
2024-12-17T05:26:01Z I! Loaded outputs: influxdb_v2
2024-12-17T05:26:01Z I! Tags enabled: host=tec-pi-mgr
2024-12-17T05:26:01Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"tec-pi-mgr", Flush Interval:10s
2024-12-17T05:26:01Z D! [agent] Initializing plugins
2024-12-17T05:26:01Z W! DeprecationWarning: Value "false" for option "ignore_protocol_stats" of plugin "inputs.net" deprecated since version 1.27.3 and will be removed in 1.36.0: use the 'inputs.nstat' plugin instead for protocol stats
2024-12-17T05:26:01Z D! [agent] Connecting outputs
2024-12-17T05:26:01Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2024-12-17T05:26:01Z D! [agent] Successfully connected to outputs.influxdb_v2
2024-12-17T05:26:01Z D! [agent] Starting service inputs
2024-12-17T05:26:10Z D! [inputs.disk] [SystemPS] => unable to get disk usage ("/run/credentials/systemd-sysctl.service"): permission denied
2024-12-17T05:26:10Z D! [inputs.disk] [SystemPS] => unable to get disk usage ("/run/credentials/systemd-sysusers.service"): permission denied
2024-12-17T05:26:10Z D! [inputs.disk] [SystemPS] => unable to get disk usage ("/run/credentials/systemd-tmpfiles-setup-dev.service"): permission denied
2024-12-17T05:26:10Z D! [inputs.disk] [SystemPS] => unable to get disk usage ("/run/credentials/systemd-tmpfiles-setup.service"): permission denied
2024-12-17T05:26:11Z D! [outputs.influxdb_v2] Wrote batch of 23 metrics in 15.359162ms
2024-12-17T05:26:11Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
```
### System info
Telegraf 1.33.0 (git: HEAD@67902005) Debian GNU/Linux 12 (bookworm) Raspberry Pi 5 Model B Rev 1.0
### Docker
direct install on raspberry PI
### Steps to reproduce
run telegraf via systemd
### Expected behavior
no error in logs
### Actual behavior
2024-12-17T05:26:30Z D! [inputs.disk] [SystemPS] => unable to get disk usage ("/run/credentials/systemd-sysctl.service"): permission denied
2024-12-17T05:26:30Z D! [inputs.disk] [SystemPS] => unable to get disk usage ("/run/credentials/systemd-sysusers.service"): permission denied
2024-12-17T05:26:30Z D! [inputs.disk] [SystemPS] => unable to get disk usage ("/run/credentials/systemd-tmpfiles-setup-dev.service"): permission denied
2024-12-17T05:26:30Z D! [inputs.disk] [SystemPS] => unable to get disk usage ("/run/credentials/systemd-tmpfiles-setup.service"): permission denied
### Additional info
setup was generated from the following template
https://github.com/influxdata/community-templates/tree/master/raspberry-pi
Contributor guide
Research direction
Start with the inputs.disk plugin and reproduce the reported behavior by running Telegraf via systemd on Debian 12 with the shown configuration. Compare the resulting logs with the expected behavior: the permission-denied messages for the listed /run/credentials paths should no longer appear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- debian, go, linux, raspberry-pi
- Domain
- observability-sre, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100