2015-10-12 01:36:21 +00:00
|
|
|
# Telegraf plugin: phpfpm
|
|
|
|
|
|
|
|
Get phpfpm stat using either HTTP status page or fpm socket.
|
|
|
|
|
|
|
|
# Measurements
|
|
|
|
|
|
|
|
Meta:
|
|
|
|
|
2016-01-14 22:20:59 +00:00
|
|
|
- tags: `pool=poolname`
|
2015-10-12 01:36:21 +00:00
|
|
|
|
|
|
|
Measurement names:
|
|
|
|
|
2016-01-14 22:20:59 +00:00
|
|
|
- phpfpm
|
|
|
|
|
|
|
|
Measurement field:
|
|
|
|
|
2015-10-12 01:36:21 +00:00
|
|
|
- accepted_conn
|
|
|
|
- listen_queue
|
|
|
|
- max_listen_queue
|
|
|
|
- listen_queue_len
|
|
|
|
- idle_processes
|
|
|
|
- active_processes
|
|
|
|
- total_processes
|
|
|
|
- max_active_processes
|
|
|
|
- max_children_reached
|
|
|
|
- slow_requests
|
|
|
|
|
|
|
|
# Example output
|
|
|
|
|
|
|
|
Using this configuration:
|
|
|
|
|
|
|
|
```
|
|
|
|
[phpfpm]
|
|
|
|
# An array of address to gather stats about. Specify an ip on hostname
|
|
|
|
# with optional port and path. ie localhost, 10.10.3.33/server-status, etc.
|
|
|
|
#
|
2015-11-12 11:07:38 +00:00
|
|
|
# We can configure in three modes:
|
2015-10-12 01:36:21 +00:00
|
|
|
# - unixsocket: the string is the path to fpm socket like
|
|
|
|
# /var/run/php5-fpm.sock
|
|
|
|
# - http: the URL has to start with http:// or https://
|
2015-11-12 11:07:38 +00:00
|
|
|
# - fcgi: the URL has to start with fcgi:// or cgi://, and socket port must present
|
2015-10-12 01:36:21 +00:00
|
|
|
#
|
|
|
|
# If no servers are specified, then default to 127.0.0.1/server-status
|
2015-11-12 11:07:38 +00:00
|
|
|
urls = ["http://localhost/status", "10.0.0.12:/var/run/php5-fpm-www2.sock", "fcgi://10.0.0.12:9000/status"]
|
2015-10-12 01:36:21 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
When run with:
|
|
|
|
|
|
|
|
```
|
2017-05-12 22:22:29 +00:00
|
|
|
./telegraf --config telegraf.conf --input-filter phpfpm --test
|
2015-10-12 01:36:21 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
It produces:
|
|
|
|
|
|
|
|
```
|
|
|
|
* Plugin: phpfpm, Collection 1
|
2016-01-14 22:20:59 +00:00
|
|
|
> phpfpm,pool=www accepted_conn=13i,active_processes=2i,idle_processes=1i,listen_queue=0i,listen_queue_len=0i,max_active_processes=2i,max_children_reached=0i,max_listen_queue=0i,slow_requests=0i,total_processes=3i 1453011293083331187
|
|
|
|
> phpfpm,pool=www2 accepted_conn=12i,active_processes=1i,idle_processes=2i,listen_queue=0i,listen_queue_len=0i,max_active_processes=2i,max_children_reached=0i,max_listen_queue=0i,slow_requests=0i,total_processes=3i 1453011293083691422
|
|
|
|
> phpfpm,pool=www3 accepted_conn=11i,active_processes=1i,idle_processes=2i,listen_queue=0i,listen_queue_len=0i,max_active_processes=2i,max_children_reached=0i,max_listen_queue=0i,slow_requests=0i,total_processes=3i 1453011293083691658
|
2015-10-12 01:36:21 +00:00
|
|
|
```
|
2016-01-14 22:20:59 +00:00
|
|
|
|
|
|
|
## Note
|
|
|
|
|
|
|
|
When using `unixsocket`, you have to ensure that telegraf runs on same
|
|
|
|
host, and socket path is accessible to telegraf user.
|