2016-03-10 20:40:03 +08:00
|
|
|
# Kernel Input Plugin
|
|
|
|
|
|
|
|
|
|
This plugin is only available on Linux.
|
|
|
|
|
|
|
|
|
|
The kernel plugin gathers info about the kernel that doesn't fit into other
|
2022-06-08 05:37:08 +08:00
|
|
|
plugins. In general, it is the statistics available in `/proc/stat` that are not
|
|
|
|
|
covered by other plugins as well as the value of
|
|
|
|
|
`/proc/sys/kernel/random/entropy_avail`
|
2016-03-10 20:40:03 +08:00
|
|
|
|
|
|
|
|
The metrics are documented in `man proc` under the `/proc/stat` section.
|
2018-01-06 06:54:29 +08:00
|
|
|
The metrics are documented in `man 4 random` under the `/proc/stat` section.
|
2016-03-10 20:40:03 +08:00
|
|
|
|
2021-11-25 03:18:53 +08:00
|
|
|
```text
|
2018-01-06 06:54:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/proc/sys/kernel/random/entropy_avail
|
|
|
|
|
Contains the value of available entropy
|
|
|
|
|
|
2016-03-10 20:40:03 +08:00
|
|
|
/proc/stat
|
|
|
|
|
kernel/system statistics. Varies with architecture. Common entries include:
|
|
|
|
|
|
|
|
|
|
page 5741 1808
|
|
|
|
|
The number of pages the system paged in and the number that were paged out (from disk).
|
|
|
|
|
|
|
|
|
|
swap 1 0
|
|
|
|
|
The number of swap pages that have been brought in and out.
|
|
|
|
|
|
|
|
|
|
intr 1462898
|
|
|
|
|
This line shows counts of interrupts serviced since boot time, for each of
|
|
|
|
|
the possible system interrupts. The first column is the total of all
|
|
|
|
|
interrupts serviced; each subsequent column is the total for a particular interrupt.
|
|
|
|
|
|
|
|
|
|
ctxt 115315
|
|
|
|
|
The number of context switches that the system underwent.
|
|
|
|
|
|
|
|
|
|
btime 769041601
|
|
|
|
|
boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
|
|
|
|
|
|
|
|
|
|
processes 86031
|
|
|
|
|
Number of forks since boot.
|
|
|
|
|
```
|
|
|
|
|
|
2022-10-27 03:58:36 +08:00
|
|
|
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
|
|
|
|
|
|
|
|
|
In addition to the plugin-specific configuration settings, plugins support
|
|
|
|
|
additional global and plugin configuration settings. These settings are used to
|
|
|
|
|
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
|
|
|
|
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
|
|
|
|
|
2023-01-12 23:55:21 +08:00
|
|
|
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins
|
2022-10-27 03:58:36 +08:00
|
|
|
|
2021-11-25 03:18:53 +08:00
|
|
|
## Configuration
|
2016-03-10 20:40:03 +08:00
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
```toml @sample.conf
|
2016-03-10 20:40:03 +08:00
|
|
|
# Get kernel statistics from /proc/stat
|
2023-03-06 19:18:43 +08:00
|
|
|
# This plugin ONLY supports Linux
|
2016-03-10 20:40:03 +08:00
|
|
|
[[inputs.kernel]]
|
|
|
|
|
# no configuration
|
|
|
|
|
```
|
|
|
|
|
|
2023-02-09 18:04:41 +08:00
|
|
|
## Metrics
|
2016-03-10 20:40:03 +08:00
|
|
|
|
|
|
|
|
- kernel
|
2021-11-25 03:18:53 +08:00
|
|
|
- boot_time (integer, seconds since epoch, `btime`)
|
|
|
|
|
- context_switches (integer, `ctxt`)
|
|
|
|
|
- disk_pages_in (integer, `page (0)`)
|
|
|
|
|
- disk_pages_out (integer, `page (1)`)
|
|
|
|
|
- interrupts (integer, `intr`)
|
|
|
|
|
- processes_forked (integer, `processes`)
|
|
|
|
|
- entropy_avail (integer, `entropy_available`)
|
2016-03-10 20:40:03 +08:00
|
|
|
|
2021-11-25 03:18:53 +08:00
|
|
|
## Example Output
|
2016-03-10 20:40:03 +08:00
|
|
|
|
2021-11-25 03:18:53 +08:00
|
|
|
```shell
|
2017-05-13 06:22:29 +08:00
|
|
|
$ telegraf --config ~/ws/telegraf.conf --input-filter kernel --test
|
2016-03-10 20:40:03 +08:00
|
|
|
* Plugin: kernel, Collection 1
|
2018-01-06 06:54:29 +08:00
|
|
|
> kernel entropy_available=2469i,boot_time=1457505775i,context_switches=2626618i,disk_pages_in=5741i,disk_pages_out=1808i,interrupts=1472736i,processes_forked=10673i 1457613402960879816
|
2016-03-10 20:40:03 +08:00
|
|
|
```
|