5

We run our own monitoring, manager panels and python fabric scripts.

I cannot find any native method apart from a "ps" output parsing [1] commandline fu.

The more pool information retrieved the better (user, stat, timeout, ...)

The first plan is to parse pool.d ini files and php-fpm.conf includes in python and use that info.

Am I overlooking something else more easy or obvious?

1: http://www.commandlinefu.com/commands/view/13901/list-php-fpm-pools-by-total-cpu-usage

n3storm
  • 704
  • 8
  • 21

1 Answers1

4

At least, you can use:

to list all processes of php-fpm pools:

sudo service php7.4-fpm status

for detailed info about running php-fpm pools

sudo php-fpm{php-ver} -tt

for exmaple:

sudo php-fpm7.4 -tt

Also, you can see the running PHP service by:

sudo systemctl list-units | grep fpm

To get pool info for all installed php versions, you can use this function:

function ShowPHPInfo {

    declare -a allLines_ia
    readarray -t allLines_ia < <(sudo systemctl list-units -t service --full --all --plain --no-legend | grep fpm | awk -v col1=1 -v col2=2 -v col3=3 '{print $col1, $col2, $col3}')
    for i in "${!allLines_ia[@]}"; do
        serviceRow=${allLines_ia[i]}
        serviceName=${serviceRow%.*}        
        echo -e "$serviceRow ==========================\n\n"
        service "$serviceName" status
    done

}