Linux: Status eines UNIX-Sockets von PHP5-FPM abrufen (ohne Webserver)

This post was published 6 years 3 months 12 days ago, so the post may be outdated.

Es gibt die Möglichkeit einen Status eines PHP5-FPM Sockets über einen Webserver abzufragen. Ich war jedoch auf der Suche, den Status direkt vom Socket abzurufen, ohne Umweg über einen Webserver.

Zuerst muss man folgende Zeile in die Konfiguration des Sockets hinzuzufügen:

pm.status_path = /fpm-status

Danach kann man die Statistik mit einem – etwas längeren – Befehl abrufen:

export SCRIPT_FILENAME=/fpm-status; export SCRIPT_NAME=/fpm-status; cgi-fcgi -bind -connect /etc/php5/fpm/sockets/www.socket

Das Resultat sieht dann in etwa so aus:

Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Content-type: text/plain;charset=iso-8859-1
pool:                 patrik.kernstock.net
process manager:      dynamic
start time:           31/Dec/2012:20:57:44 +0100
start since:          567400
accepted conn:        93395
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       14
active processes:     1
total processes:      15
max active processes: 8
max children reached: 0
slow requests:        0

Wer ein kleines hilfreiches Bash-Script dafür sucht:
http://lumux.co.uk/2012/08/02/php-fpm-status-stats-without-a-webserver/

Author: Patrik Kernstock

May I introduce my self? I am Patrik Kernstock, 23 years old, perfectionist, born and still living in Austria. Me explained in short: I am a tech- and security enthusiast, a series junky and gaming addicted. Basically my interests belong to many different things in the IT-world, but specially I am interested in Ubuntu/Debian, nginx, MariaDB, Docker and various software solutions by Microsoft, Veeam and VMware.

2
Leave a Reply

avatar
1 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
Patrik KernstockShrenik Recent comment authors

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
newest oldest most voted
Notify of
Shrenik

Hi Patrik,

Came to this through https://coderwall.com/p/jpzvxw/linux-get-socket-status-php5-fpm-via-linux-command

I did as ‘root’ as you have suggested but all I get is this –

export SCRIPTFILENAME=/php_fpm_status; export SCRIPTNAME=/php_fpm_status; cgi-fcgi -bind -connect /opt/bitnami/php/var/run/magento.sock

X-Powered-By: PHP/5.5.30
Content-type: text/html; charset=UTF-8

Please note that I have the same pm.status_path configured for viewing status via webserver also and that is working fine.