2012-09-18 19:15:56 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# -*- sh -*-
|
|
|
|
|
|
|
|
: << =cut
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
apache_memmory -Indicate the medium size of all the apache child process
|
|
|
|
|
|
|
|
=head1 CONFIGURATION
|
|
|
|
|
|
|
|
[apache_*]
|
2014-06-15 21:14:44 +02:00
|
|
|
env.apuser user_running_apache
|
2012-09-18 19:15:56 +02:00
|
|
|
env.binname apache_binary_name
|
|
|
|
|
|
|
|
|
|
|
|
=head1 AUTHOR
|
|
|
|
|
|
|
|
Ricardo Fraile <rfrail3@yahoo.es>
|
|
|
|
|
|
|
|
=head1 LICENSE
|
|
|
|
|
|
|
|
GPLv2
|
|
|
|
|
|
|
|
=head1 MAGICK MARKERS
|
|
|
|
|
|
|
|
#%# family=auto
|
|
|
|
#%# capabilities=autoconf
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
|
|
|
. $MUNIN_LIBDIR/plugins/plugin.sh
|
|
|
|
|
|
|
|
USR=$apuser
|
|
|
|
PROCS=$binname
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
|
|
|
echo yes
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
|
|
|
|
echo 'graph_title Medium size of apache child process.'
|
|
|
|
echo 'graph_args --base 1000 -l 0 '
|
|
|
|
echo 'graph_vlabel Kb'
|
|
|
|
echo 'graph_scale no'
|
2017-02-21 22:15:07 +01:00
|
|
|
echo 'graph_category webserver'
|
2012-09-18 19:15:56 +02:00
|
|
|
echo 'graph_info Indicate the memdium size of all the apache child process.'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "servers.label servers"
|
|
|
|
echo "servers.type GAUGE"
|
|
|
|
echo "servers.min 0"
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2012-09-19 08:49:07 +02:00
|
|
|
VAL1=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | wc -l`
|
2012-09-18 19:15:56 +02:00
|
|
|
|
2012-09-19 08:49:07 +02:00
|
|
|
VAL2=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | awk '{s+=$6} END {print s}'`
|
2012-09-18 19:15:56 +02:00
|
|
|
|
|
|
|
VAL3=`expr $VAL2 / $VAL1`
|
|
|
|
|
|
|
|
echo "servers.value $VAL3"
|
|
|
|
|
|
|
|
|