Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (35 sloc) 973 Bytes
#!/bin/sh
# -*- sh -*-
#
# Plugin to monitor the number of PHP5-FPM processes on the machine.
#
# Copyright TJ Stein 2010 http://constantshift.com
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# Magick markers (optional - used by munin-config and som installation
# scripts):
#%# family=manual
#%# capabilities=autoconf
PHP_BIN=${phpbin-"php5-fpm"}
PHP_POOL=${phppool-"www"}
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title PHP5-FPM Processes'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel PHP5-FPM Processes'
echo 'graph_category PHP'
echo 'graph_info This graph shows the number of PHP5-FPM processes in the system.'
echo 'php_processes.label PHP5-FPM Processes'
echo 'php_processes.draw LINE2'
echo 'php_processes.info The current number of PHP5-FPM processes.'
exit 0
fi
echo -n "php_processes.value "
ps awwwux | grep "$PHP_BIN: pool $PHP_POOL" | grep -v grep | wc -l
Jump to Line
Something went wrong with that request. Please try again.