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

This post was published 11 years 6 months 15 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
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:

Patrik Kernstock

May I introduce my self? I am Patrik Kernstock, 25 years old, perfectionist, born in Austria and living in Ireland, Cork. Me explained in short: Tech- and security enthusiast, series & movies junky. Interesting in Linux, Container-stuff and many software solutions by Microsoft, Veeam and VMware.

0 0 votes
Article Rating
Notify of

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

oldest most voted
Inline Feedbacks
View all comments

Hi Patrik,

Came to this through

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.

Would love your thoughts, please comment.x