telegraf/plugins/inputs/phpfpm
Sven Rebhan e2578462a5
fix(inputs): Linter issues (#11576)
2022-08-02 13:52:17 +02:00
..
README.md chore: Embed sample configurations into README for inputs (#11136) 2022-05-24 08:49:47 -05:00
child.go fix(inputs): Linter issues (#11576) 2022-08-02 13:52:17 +02:00
fcgi.go Linter fixes (unhandled errors) -- Part 1 (#8992) 2021-04-08 11:43:39 -05:00
fcgi_client.go fix: Linter fixes for plugins/inputs/p* (#10066) 2021-11-15 09:14:09 -06:00
fcgi_test.go refactor: move from io/ioutil to io and os package (#9811) 2021-09-28 15:16:32 -06:00
phpfpm.go chore: correctly spell embed (#11200) 2022-05-27 07:13:47 -06:00
phpfpm_test.go fix: ensure CI tests runs against i386 (#10457) 2022-01-18 13:45:03 -07:00
sample.conf chore(inputs_m-z): migrate sample configs into separate files (#11133) 2022-05-18 11:31:34 -05:00

README.md

PHP-FPM Input Plugin

Get phpfpm stats using either HTTP status page or fpm socket.

Configuration

# 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"
  ##      glob patterns are also supported:
  ##       "/var/run/php*.sock"
  ##
  ##   - 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 remote host
  ## urls = ["http://192.168.1.20/status", "/tmp/fpm.sock"]
  urls = ["http://localhost/status"]

  ## Duration allowed to complete HTTP requests.
  # timeout = "5s"

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

When using unixsocket, you have to ensure that telegraf runs on same host, and socket path is accessible to telegraf user.

Metrics

  • 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

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