Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (40 sloc) 1.16 KB
#!/bin/sh
# -*- sh -*-
: <<=cut
=head1 NAME
phpfpm_average - Munin plugin to monitor the number of PHP5-FPM processes on the machine.
=head1 CONFIGURATION
You might need to specify connection parameters in the plugin
configuration to override the defaults. These are the defaults:
[phpfpm_*]
env.phpbin php-fpm
env.phppool www
=head1 PARAMETERS:
config (required)
autoconf (optional - used by munin-config)
=over
=head1 LICENSE
Copyright TJ Stein 2010 http://constantshift.com
=head1 MAGICK MARKERS
#%# family=manual
#%# capabilities=autoconf
=cut
PHP_BIN=${phpbin-"php-fpm"}
PHP_POOL=${phppool-"www"}
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title PHP-FPM Processes'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel PHP-FPM Processes'
echo 'graph_category PHP'
echo 'graph_info This graph shows the number of PHP-FPM processes in the system.'
echo 'php_processes.label PHP-FPM Processes'
echo 'php_processes.draw LINE2'
echo 'php_processes.info The current number of PHP-FPM processes.'
exit 0
fi
echo -n "php_processes.value "
ps awwwux | grep "$PHP_BIN: pool $PHP_POOL" | grep -v grep | wc -l