2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

2011-01-01, guilloux : find commands & plugin conf improvements. Tested on an Ubuntu 10.10 server

This commit is contained in:
Ronan 2011-01-01 11:13:54 +01:00 committed by Steve Schnepp
parent ea1e17cc51
commit 67ff8900dd

View File

@ -10,9 +10,15 @@
# Authors
# ~~~~~~~
# Benjamin Schweizer <code at benjamin-schweizer dot de>
# Ronan Guilloux <ronan at coolforest dot net>
# Copy this to your node's config file (default: plugin-conf.d/munin-node):
# [php_sessions]
# user root
#
# Changes
# ~~~~~~~
# 2011-01-01, guilloux : find commands & plugin conf improvements
# 2008-10-15, schweizer: added active sessions
# 2008-10-10, schweizer: forked from munin_squid_efficiency
# 2006-10-11, schweizer: initial release.
@ -24,35 +30,34 @@
#%# family=auto
#%# capabilities=autoconf
SESSION_DIR="/var/lib/php5/"
if [ "$1" = "autoconf" ]; then
test -d "$SESSION_DIR" > /dev/null 2>&1
if [ $? ]; then
echo yes
exit 0
else
echo "no (session directory not found)"
exit 1
fi
if [ $? ]; then
echo yes
exit 0
else
echo "no (session directory not found)"
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title Apache/PHP Sessions'
echo 'graph_info This graph shows active Apache/PHP sessions.'
echo 'graph_category apache'
echo "graph_args --lower-limit 0"
echo 'graph_vlabel n'
echo 'graph_title Apache/PHP Sessions'
echo 'graph_info This graph shows active Apache/PHP sessions.'
echo 'graph_category apache'
echo "graph_args --lower-limit 0"
echo 'graph_vlabel n'
echo 'sessions.label total sessions'
echo 'asessions.label active sessions'
echo 'sessions.label total sessions'
echo 'asessions.label active sessions'
exit 0
exit 0
fi
ACTIVE_SESSIONS_NUM=`find /var/lib/php5/sess_* -amin -5 | wc -l`
TOTAL_SESSIONS_NUM=`find /var/lib/php5/sess_* | wc -l`
ACTIVE_SESSIONS_NUM=`find /var/lib/php5/ -type f -iname "sess_*" -amin -5 | wc -l`
TOTAL_SESSIONS_NUM=`find /var/lib/php5/ -type f -iname "sess_*" | wc -l`
echo "sessions.value ${TOTAL_SESSIONS_NUM}"
echo "asessions.value ${ACTIVE_SESSIONS_NUM}"