2016-03-08 10:42:31 +00:00
|
|
|
# Processes Input Plugin
|
|
|
|
|
|
|
|
This plugin gathers info about the total number of processes and groups
|
|
|
|
them by status (zombie, sleeping, running, etc.)
|
|
|
|
|
|
|
|
On linux this plugin requires access to procfs (/proc), on other OSes
|
|
|
|
it requires access to execute `ps`.
|
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
|
|
|
```toml
|
|
|
|
# Get the number of processes and group them by status
|
|
|
|
[[inputs.processes]]
|
|
|
|
# no configuration
|
|
|
|
```
|
|
|
|
|
|
|
|
### Measurements & Fields:
|
|
|
|
|
|
|
|
- processes
|
|
|
|
- blocked (aka disk sleep or uninterruptible sleep)
|
|
|
|
- running
|
|
|
|
- sleeping
|
|
|
|
- stopped
|
|
|
|
- total
|
|
|
|
- zombie
|
2017-03-09 19:28:54 +00:00
|
|
|
- dead
|
2016-03-08 10:42:31 +00:00
|
|
|
- wait (freebsd only)
|
|
|
|
- idle (bsd only)
|
|
|
|
- paging (linux only)
|
|
|
|
- total_threads (linux only)
|
|
|
|
|
|
|
|
### Process State Mappings
|
|
|
|
|
|
|
|
Different OSes use slightly different State codes for their processes, these
|
|
|
|
state codes are documented in `man ps`, and I will give a mapping of what major
|
|
|
|
OS state codes correspond to in telegraf metrics:
|
|
|
|
|
|
|
|
```
|
|
|
|
Linux FreeBSD Darwin meaning
|
|
|
|
R R R running
|
|
|
|
S S S sleeping
|
|
|
|
Z Z Z zombie
|
2017-03-09 19:28:54 +00:00
|
|
|
X none none dead
|
2016-03-08 10:42:31 +00:00
|
|
|
T T T stopped
|
|
|
|
none I I idle (sleeping for longer than about 20 seconds)
|
|
|
|
D D,L U blocked (waiting in uninterruptible sleep, or locked)
|
|
|
|
W W none paging (linux kernel < 2.6 only), wait (freebsd)
|
|
|
|
```
|
|
|
|
|
|
|
|
### Tags:
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
### Example Output:
|
|
|
|
|
|
|
|
```
|
2017-05-12 22:22:29 +00:00
|
|
|
$ telegraf --config ~/ws/telegraf.conf --input-filter processes --test
|
2016-03-08 10:42:31 +00:00
|
|
|
* Plugin: processes, Collection 1
|
2017-03-09 19:28:54 +00:00
|
|
|
> processes blocked=8i,running=1i,sleeping=265i,stopped=0i,total=274i,zombie=0i,dead=0i,paging=0i,total_threads=687i 1457478636980905042
|
2016-03-08 10:42:31 +00:00
|
|
|
```
|