forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tag for target url to phpfpm input (influxdata#3928)
- Loading branch information
1 parent
3658ac8
commit be9d4f4
Showing
3 changed files
with
62 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,59 @@ | ||
# Telegraf plugin: phpfpm | ||
|
||
Get phpfpm stat using either HTTP status page or fpm socket. | ||
|
||
# Measurements | ||
|
||
Meta: | ||
|
||
- tags: `pool=poolname` | ||
|
||
Measurement names: | ||
|
||
- phpfpm | ||
|
||
Measurement field: | ||
|
||
- 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. | ||
# | ||
# We can configure in three modes: | ||
# - 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:// | ||
# - fcgi: the URL has to start with fcgi:// or cgi://, and socket port must present | ||
# | ||
# If no servers are specified, then default to 127.0.0.1/server-status | ||
urls = ["http://localhost/status", "10.0.0.12:/var/run/php5-fpm-www2.sock", "fcgi://10.0.0.12:9000/status"] | ||
# PHP-FPM Input Plugin | ||
|
||
Get phpfpm stats using either HTTP status page or fpm socket. | ||
|
||
### Configuration: | ||
|
||
```toml | ||
# Read metrics of phpfpm, via HTTP status page or socket | ||
[[inputs.phpfpm]] | ||
## An array of addresses to gather stats about. Specify an ip or hostname | ||
## with optional port and path | ||
## | ||
## Plugin can be configured in three modes (either can be used): | ||
## - http: the URL must start with http:// or https://, ie: | ||
## "http://localhost/status" | ||
## "http://192.168.130.1/status?full" | ||
## | ||
## - unixsocket: path to fpm socket, ie: | ||
## "/var/run/php5-fpm.sock" | ||
## or using a custom fpm status path: | ||
## "/var/run/php5-fpm.sock:fpm-custom-status-path" | ||
## | ||
## - fcgi: the URL must start with fcgi:// or cgi://, and port must be present, ie: | ||
## "fcgi://10.0.0.12:9000/status" | ||
## "cgi://10.0.10.12:9001/status" | ||
## | ||
## Example of multiple gathering from local socket and remove host | ||
## urls = ["http://192.168.1.20/status", "/tmp/fpm.sock"] | ||
urls = ["http://localhost/status"] | ||
``` | ||
|
||
When run with: | ||
When using `unixsocket`, you have to ensure that telegraf runs on same | ||
host, and socket path is accessible to telegraf user. | ||
|
||
``` | ||
./telegraf --config telegraf.conf --input-filter phpfpm --test | ||
``` | ||
### Metrics: | ||
|
||
It produces: | ||
- phpfpm | ||
- tags: | ||
- pool | ||
- url | ||
- fields: | ||
- 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 | ||
|
||
``` | ||
* Plugin: phpfpm, Collection 1 | ||
> 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 | ||
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 | ||
``` | ||
|
||
## Note | ||
|
||
When using `unixsocket`, you have to ensure that telegraf runs on same | ||
host, and socket path is accessible to telegraf user. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters