File: //proc/1284358/cwd/bigscoots/chkphpfpm
#!/bin/bash
maxhits=$(grep -r "server reached max_children setting" /opt/cpanel/ea-php*/root/usr/var/log/php-fpm/error.log | wc -l)
if [ "$maxhits" -ne 0 ]
then
grep -h "server reached max_children setting" /opt/cpanel/ea-php*/root/usr/var/log/php-fpm/error.log > /chkphpfpm.txt
cat /chkphpfpm.txt | mailx -s "$HOSTNAME - max_children has been reached $maxhits times" [email protected]
sed -i '/server reached max_children setting/d' /opt/cpanel/ea-php*/root/usr/var/log/php-fpm/error.log
fi