1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-08-02 14:18:21 +00:00

Initial version

This commit is contained in:
Radar 2010-07-31 20:36:46 +02:00 committed by Steve Schnepp
parent b01c3d6e4d
commit 8627d99642

54
plugins/other/php5-fpm_status Executable file
View file

@ -0,0 +1,54 @@
#!/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
#
#
# /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
url="http://localhost/fpm-status"
statusfile=/tmp/fpm-status.txt
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
echo "graph_title php5-fpm status"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel Processes"
echo "graph_scale yes"
echo "graph_category nginx"
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
fi
echo -n "active.value "
echo $active
echo -n "idle.value "
echo $idle
echo -n "total.value "
echo $total
rm -f $statusfile