Monitoring php-fpm processes via NRPE

Hi,
we monitor apache2 and mysqld successfully via NRPE like this:
command[check_procs_mysqld]=/usr/lib/nagios/plugins/check_procs -C “mysqld” -c 1:
PROCS OK: 1 process with command name ‘mysqld’ | procs=1;;1:;0;

But can’t find right query for PHP-FPM processes like this:
root 1865 1 0 Jul01 ? 00:00:43 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)

root@web4:~# /usr/lib/nagios/plugins/check_procs -C “php-fpm” -c 1:
PROCS CRITICAL: 0 processes with command name ‘php-fpm’ | procs=0;;1:;0;

How should we pronounce this process to Icinga ?


icinga2 - The Icinga 2 network monitoring daemon (version: r2.12.4-1)

System information:
Platform: Ubuntu
Platform version: 18.04.5 LTS (Bionic Beaver)
Kernel version: 4.15.0-147-generic

Try either -a php-fpm or -C php-fpm: (with colon at the end).

-a php-fpm worked

~# /usr/lib/nagios/plugins/check_procs -a “php-fpm” -c 3:
PROCS OK: 297 processes with args ‘php-fpm’ | procs=297;;3:;0;

, but i find out that there are 4 differerent PHP-FPM versions running, only this 7.0 i can seperate from others because it’s installed via Debian package, all other PHP’s are from source code:

~# /usr/lib/nagios/plugins/check_procs -C “php-fpm7.0” -c 1:
PROCS OK: 175 processes with command name ‘php-fpm7.0’ | procs=175;;1:;0;

~# /usr/lib/nagios/plugins/check_procs -C “php-fpm” -c 3:
PROCS OK: 122 processes with command name ‘php-fpm’ | procs=122;;3:;0;

Thanks for support !

Hello!
Is nice to see this was answered :slight_smile:
I just wanted to add to this with our Styleguide which can help you structure your posts in a more readily readable way!
Thank you for your time!