webarch-coop / php5-fpm-multi-munin-plugin

munin の php-fpm 用プラグイン
MIT License
0 stars 1 forks source link

Division by zero #1

Open chriscroome opened 5 years ago

chriscroome commented 5 years ago

If you are using:

pm = ondemand
pm.max_children = 5

Then there won't always be processes running and then lines like this one:

        ps awwwux | grep "$PHP_BIN: pool $pool" | grep -v grep | awk '{total_mem = $6 * 1024 + total_mem; total_proc++} END{printf("%d\n", total_mem / total_proc)}

Which is here, generate errors:

cd /etc/munin/plugins
munin-run phpfpm_multi_average
test2.value awk: cmd. line:1: fatal: division by zero attempted

When test2 is the pool name with no processes.

chriscroome commented 5 years ago

There is also an issue with this one:

munin-run phpfpm_multi_memory 
test2.value Integer