Created
February 4, 2022 16:00
-
-
Save defanator/657c4f59b3ac114f2876d4f650536f61 to your computer and use it in GitHub Desktop.
Query php-fpm status from multiple instances/sockets
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
#!/bin/bash | |
# vim:sw=4:ts=4:et: | |
ENDPOINTS="/run/php/php7.4-fpm1.sock:/status1 /run/php/php7.4-fpm2.sock:/status2 /run/php/php7.4-fpm3.sock:/status3" | |
ENDPOINTS="$ENDPOINTS /run/php/php8.0-fpm1.sock:/status1 /run/php/php8.0-fpm2.sock:/status2 /run/php/php8.0-fpm3.sock:/status3" | |
for endpoint in $ENDPOINTS; do | |
socket=${endpoint%:*} | |
script=${endpoint##*:} | |
sudo -u nginx SCRIPT_NAME=${script} SCRIPT_FILENAME=${script} QUERY_STRING=full REQUEST_METHOD=GET cgi-fcgi -bind -connect ${socket} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment