mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 02:48:28 +00:00
2011-01-01, guilloux : find commands & plugin conf improvements. Tested on an Ubuntu 10.10 server
This commit is contained in:
parent
ea1e17cc51
commit
67ff8900dd
1 changed files with 23 additions and 18 deletions
|
@ -10,9 +10,15 @@
|
||||||
# Authors
|
# Authors
|
||||||
# ~~~~~~~
|
# ~~~~~~~
|
||||||
# Benjamin Schweizer <code at benjamin-schweizer dot de>
|
# 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
|
# Changes
|
||||||
# ~~~~~~~
|
# ~~~~~~~
|
||||||
|
# 2011-01-01, guilloux : find commands & plugin conf improvements
|
||||||
# 2008-10-15, schweizer: added active sessions
|
# 2008-10-15, schweizer: added active sessions
|
||||||
# 2008-10-10, schweizer: forked from munin_squid_efficiency
|
# 2008-10-10, schweizer: forked from munin_squid_efficiency
|
||||||
# 2006-10-11, schweizer: initial release.
|
# 2006-10-11, schweizer: initial release.
|
||||||
|
@ -24,35 +30,34 @@
|
||||||
#%# family=auto
|
#%# family=auto
|
||||||
#%# capabilities=autoconf
|
#%# capabilities=autoconf
|
||||||
|
|
||||||
|
|
||||||
SESSION_DIR="/var/lib/php5/"
|
SESSION_DIR="/var/lib/php5/"
|
||||||
|
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
test -d "$SESSION_DIR" > /dev/null 2>&1
|
test -d "$SESSION_DIR" > /dev/null 2>&1
|
||||||
if [ $? ]; then
|
if [ $? ]; then
|
||||||
echo yes
|
echo yes
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "no (session directory not found)"
|
echo "no (session directory not found)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "config" ]; then
|
if [ "$1" = "config" ]; then
|
||||||
echo 'graph_title Apache/PHP Sessions'
|
echo 'graph_title Apache/PHP Sessions'
|
||||||
echo 'graph_info This graph shows active Apache/PHP sessions.'
|
echo 'graph_info This graph shows active Apache/PHP sessions.'
|
||||||
echo 'graph_category apache'
|
echo 'graph_category apache'
|
||||||
echo "graph_args --lower-limit 0"
|
echo "graph_args --lower-limit 0"
|
||||||
echo 'graph_vlabel n'
|
echo 'graph_vlabel n'
|
||||||
|
|
||||||
echo 'sessions.label total sessions'
|
echo 'sessions.label total sessions'
|
||||||
echo 'asessions.label active sessions'
|
echo 'asessions.label active sessions'
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ACTIVE_SESSIONS_NUM=`find /var/lib/php5/sess_* -amin -5 | wc -l`
|
ACTIVE_SESSIONS_NUM=`find /var/lib/php5/ -type f -iname "sess_*" -amin -5 | wc -l`
|
||||||
TOTAL_SESSIONS_NUM=`find /var/lib/php5/sess_* | wc -l`
|
TOTAL_SESSIONS_NUM=`find /var/lib/php5/ -type f -iname "sess_*" | wc -l`
|
||||||
|
|
||||||
echo "sessions.value ${TOTAL_SESSIONS_NUM}"
|
echo "sessions.value ${TOTAL_SESSIONS_NUM}"
|
||||||
echo "asessions.value ${ACTIVE_SESSIONS_NUM}"
|
echo "asessions.value ${ACTIVE_SESSIONS_NUM}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue