2016-03-10 00:22:34 +08:00
|
|
|
# System Input Plugin
|
|
|
|
|
|
|
|
|
|
The system plugin gathers general stats on system load, uptime,
|
2018-04-19 07:55:18 +08:00
|
|
|
and number of users logged in. It is similar to the unix `uptime` command.
|
2016-03-10 00:22:34 +08:00
|
|
|
|
2019-08-07 06:55:06 +08:00
|
|
|
Number of CPUs is obtained from the /proc/cpuinfo file.
|
|
|
|
|
|
2021-11-25 02:50:13 +08:00
|
|
|
## Configuration
|
2016-03-10 00:22:34 +08:00
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
```toml @sample.conf
|
2016-03-10 00:22:34 +08:00
|
|
|
# Read metrics about system load & uptime
|
|
|
|
|
[[inputs.system]]
|
|
|
|
|
# no configuration
|
|
|
|
|
```
|
2021-11-25 02:50:13 +08:00
|
|
|
|
|
|
|
|
### Permissions
|
2016-03-10 00:22:34 +08:00
|
|
|
|
2022-06-09 05:22:56 +08:00
|
|
|
The `n_users` field requires read access to `/var/run/utmp`, and may require the
|
|
|
|
|
`telegraf` user to be added to the `utmp` group on some systems. If this file
|
|
|
|
|
does not exist `n_users` will be skipped.
|
2016-03-10 00:22:34 +08:00
|
|
|
|
2021-11-25 02:50:13 +08:00
|
|
|
## Metrics
|
2016-03-10 00:22:34 +08:00
|
|
|
|
2018-04-19 07:55:18 +08:00
|
|
|
- system
|
|
|
|
|
- fields:
|
2021-11-25 02:50:13 +08:00
|
|
|
- load1 (float)
|
|
|
|
|
- load15 (float)
|
|
|
|
|
- load5 (float)
|
|
|
|
|
- n_users (integer)
|
|
|
|
|
- n_cpus (integer)
|
|
|
|
|
- uptime (integer, seconds)
|
|
|
|
|
- uptime_format (string, deprecated in 1.10, use `uptime` field)
|
2016-03-10 00:22:34 +08:00
|
|
|
|
2021-11-25 02:50:13 +08:00
|
|
|
## Example Output
|
2016-03-10 00:22:34 +08:00
|
|
|
|
2021-11-25 02:50:13 +08:00
|
|
|
```shell
|
2018-04-19 07:55:18 +08:00
|
|
|
system,host=tyrion load1=3.72,load5=2.4,load15=2.1,n_users=3i,n_cpus=4i 1483964144000000000
|
|
|
|
|
system,host=tyrion uptime=1249632i 1483964144000000000
|
|
|
|
|
system,host=tyrion uptime_format="14 days, 11:07" 1483964144000000000
|
2016-03-10 00:22:34 +08:00
|
|
|
```
|