2010-07-31 20:36:46 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Plugin to monitor php5-fpm process manager, php5-fpm 5.3.3 is required
|
|
|
|
# 20100726 21:15:39 radar AT aol DOT pl
|
2011-09-26 20:02:09 +02:00
|
|
|
# modified by Daniel Caillibaud on 20110926
|
2010-07-31 20:36:46 +02:00
|
|
|
#
|
|
|
|
# /etc/php5/fpm/php5-fpm.conf:
|
|
|
|
#
|
|
|
|
# pm.status_path = /fpm-status
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Magic markers (optional - only used by munin-config and some installation scripts):
|
|
|
|
#%# family=contrib
|
|
|
|
|
2011-09-26 20:02:09 +02:00
|
|
|
vhost=${0#/etc/munin/plugins/php5-fpm_status_}
|
|
|
|
url="http://$vhost/fpm-status"
|
|
|
|
statusfile="/tmp/fpm-status_$vhost.txt"
|
2010-07-31 20:36:46 +02:00
|
|
|
|
|
|
|
wget $url -O $statusfile 2>/dev/null
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
2011-09-26 20:02:09 +02:00
|
|
|
pool=$(awk '/pool/{print $2}' $statusfile)
|
|
|
|
echo "graph_title php5-fpm status $pool"
|
|
|
|
echo "graph_args --base 1000 -l 0"
|
|
|
|
echo "graph_vlabel Processes"
|
|
|
|
echo "graph_scale yes"
|
2017-02-21 18:24:41 +01:00
|
|
|
echo "graph_category processes"
|
2011-09-26 20:02:09 +02:00
|
|
|
echo "graph_info This graph shows the php5-fpm process manager status from pool: $pool"
|
|
|
|
echo "active.label Active processes"
|
|
|
|
echo "active.type GAUGE"
|
|
|
|
echo "active.draw AREA"
|
|
|
|
echo "active.info The number of active processes"
|
|
|
|
echo "idle.label Idle processes"
|
|
|
|
echo "idle.type GAUGE"
|
|
|
|
echo "idle.draw STACK"
|
|
|
|
echo "idle.info The number of idle processes"
|
|
|
|
echo "total.label Total processes"
|
|
|
|
echo "total.type GAUGE"
|
|
|
|
echo "total.draw LINE2"
|
|
|
|
echo "total.info The number of idle + active processes"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
awk '
|
2012-04-18 11:09:20 +02:00
|
|
|
/^idle/ {print "idle.value " $3}
|
|
|
|
/^active/{print "active.value " $3}
|
2011-09-26 20:02:09 +02:00
|
|
|
/^total/ {print "total.value " $3}
|
|
|
|
' < $statusfile
|
2010-07-31 20:36:46 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f $statusfile
|
2011-09-26 20:02:09 +02:00
|
|
|
|