1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

bugfix of several idle|total pattern in my php-fpm status

This commit is contained in:
Daniel Caillibaud 2011-09-26 20:02:09 +02:00 committed by Steve Schnepp
parent 7a05e29c76
commit f8264132d3

View file

@ -2,7 +2,7 @@
# #
# Plugin to monitor php5-fpm process manager, php5-fpm 5.3.3 is required # Plugin to monitor php5-fpm process manager, php5-fpm 5.3.3 is required
# 20100726 21:15:39 radar AT aol DOT pl # 20100726 21:15:39 radar AT aol DOT pl
# # modified by Daniel Caillibaud on 20110926
# #
# /etc/php5/fpm/php5-fpm.conf: # /etc/php5/fpm/php5-fpm.conf:
# #
@ -12,43 +12,40 @@
# Magic markers (optional - only used by munin-config and some installation scripts): # Magic markers (optional - only used by munin-config and some installation scripts):
#%# family=contrib #%# family=contrib
url="http://localhost/fpm-status" vhost=${0#/etc/munin/plugins/php5-fpm_status_}
statusfile=/tmp/fpm-status.txt url="http://$vhost/fpm-status"
statusfile="/tmp/fpm-status_$vhost.txt"
wget $url -O $statusfile 2>/dev/null wget $url -O $statusfile 2>/dev/null
pool=$(awk '/pool/{print $2}' $statusfile)
idle=$(awk '/idle/{print $3}' $statusfile)
active=$(awk '/active/{print $3}' $statusfile)
total=$(awk '/total/{print $3}' $statusfile)
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then
echo "graph_title php5-fpm status" pool=$(awk '/pool/{print $2}' $statusfile)
echo "graph_args --base 1000 -l 0" echo "graph_title php5-fpm status $pool"
echo "graph_vlabel Processes" echo "graph_args --base 1000 -l 0"
echo "graph_scale yes" echo "graph_vlabel Processes"
echo "graph_category nginx" echo "graph_scale yes"
echo "graph_info This graph shows the php5-fpm process manager status from pool: $pool" echo "graph_category nginx"
echo "active.label Active processes" echo "graph_info This graph shows the php5-fpm process manager status from pool: $pool"
echo "active.type GAUGE" echo "active.label Active processes"
echo "active.draw AREA" echo "active.type GAUGE"
echo "active.info The number of active processes" echo "active.draw AREA"
echo "idle.label Idle processes" echo "active.info The number of active processes"
echo "idle.type GAUGE" echo "idle.label Idle processes"
echo "idle.draw STACK" echo "idle.type GAUGE"
echo "idle.info The number of idle processes" echo "idle.draw STACK"
echo "total.label Total processes" echo "idle.info The number of idle processes"
echo "total.type GAUGE" echo "total.label Total processes"
echo "total.draw LINE2" echo "total.type GAUGE"
echo "total.info The number of idle + active processes" echo "total.draw LINE2"
exit 0 echo "total.info The number of idle + active processes"
exit 0
else
awk '
/^idle/ {print "active.value " $3}
/^active/{print "idle.value " $3}
/^total/ {print "total.value " $3}
' < $statusfile
fi fi
echo -n "active.value "
echo $active
echo -n "idle.value "
echo $idle
echo -n "total.value "
echo $total
rm -f $statusfile rm -f $statusfile