mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-23 06:35:42 +00:00
env.sessiondir, fix find commands to actually use the variableuse
This commit is contained in:
parent
dc7486cf00
commit
ef1f44d73e
1 changed files with 12 additions and 5 deletions
|
@ -11,13 +11,20 @@
|
||||||
# ~~~~~~~
|
# ~~~~~~~
|
||||||
# Benjamin Schweizer <code at benjamin-schweizer dot de>
|
# Benjamin Schweizer <code at benjamin-schweizer dot de>
|
||||||
# Ronan Guilloux <ronan at coolforest dot net>
|
# Ronan Guilloux <ronan at coolforest dot net>
|
||||||
|
# Andras Kemeny <subpardaemon at gmail dot com>
|
||||||
|
|
||||||
# Copy this to your node's config file (default: plugin-conf.d/munin-node):
|
# Copy this to your node's config file (default: plugin-conf.d/munin-node):
|
||||||
# [php_sessions]
|
# [php_sessions]
|
||||||
# user root
|
# user root
|
||||||
|
# env.sessiondir /var/lib/php/session
|
||||||
|
#
|
||||||
|
# Modify env.sessiondir to match your system's setting. This should be fine
|
||||||
|
# on most systems.
|
||||||
#
|
#
|
||||||
# Changes
|
# Changes
|
||||||
# ~~~~~~~
|
# ~~~~~~~
|
||||||
|
# 2011-02-13, subpardaemon: add env.sessiondir, make sure find uses
|
||||||
|
# the given path (it hadn't before)
|
||||||
# 2011-01-01, guilloux : find commands & plugin conf improvements
|
# 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
|
||||||
|
@ -30,12 +37,12 @@
|
||||||
#%# family=auto
|
#%# family=auto
|
||||||
#%# capabilities=autoconf
|
#%# capabilities=autoconf
|
||||||
|
|
||||||
SESSION_DIR="/var/lib/php5/"
|
SESSDIR=${sessiondir:-"/var/lib/php/session"}
|
||||||
|
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
test -d "$SESSION_DIR" > /dev/null 2>&1
|
test -d "$SESSDIR" > /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)"
|
||||||
|
@ -56,8 +63,8 @@ if [ "$1" = "config" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ACTIVE_SESSIONS_NUM=`find /var/lib/php5/ -type f -iname "sess_*" -amin -5 | wc -l`
|
ACTIVE_SESSIONS_NUM=`find $SESSDIR/ -type f -iname "sess_*" -amin -5 | wc -l`
|
||||||
TOTAL_SESSIONS_NUM=`find /var/lib/php5/ -type f -iname "sess_*" | wc -l`
|
TOTAL_SESSIONS_NUM=`find $SESSDIR/ -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