root / plugins / apache / apache_tmemmory @ 17f78427
Historique | Voir | Annoter | Télécharger (939 octets)
| 1 |
#!/bin/sh |
|---|---|
| 2 |
# -*- sh -*- |
| 3 |
|
| 4 |
: << =cut |
| 5 |
|
| 6 |
=head1 NAME |
| 7 |
|
| 8 |
apache_tmemmory -Indicate the total memory used by apache |
| 9 |
|
| 10 |
=head1 CONFIGURATION |
| 11 |
|
| 12 |
[apache_*] |
| 13 |
env.binname apache_binary_name |
| 14 |
|
| 15 |
=head1 AUTHOR |
| 16 |
|
| 17 |
Ricardo Fraile <rfrail3@yahoo.es> |
| 18 |
|
| 19 |
=head1 LICENSE |
| 20 |
|
| 21 |
GPLv2 |
| 22 |
|
| 23 |
=head1 MAGICK MARKERS |
| 24 |
|
| 25 |
#%# family=auto |
| 26 |
#%# capabilities=autoconf |
| 27 |
|
| 28 |
=cut |
| 29 |
|
| 30 |
. $MUNIN_LIBDIR/plugins/plugin.sh |
| 31 |
|
| 32 |
|
| 33 |
USR=$apuser |
| 34 |
PROCS=$binname |
| 35 |
|
| 36 |
|
| 37 |
if [ "$1" = "autoconf" ]; then |
| 38 |
echo yes |
| 39 |
exit 0 |
| 40 |
fi |
| 41 |
|
| 42 |
if [ "$1" = "config" ]; then |
| 43 |
|
| 44 |
echo 'graph_title Total memory used by apache' |
| 45 |
echo 'graph_args --base 1000 -l 0 ' |
| 46 |
echo 'graph_vlabel Mb' |
| 47 |
echo 'graph_scale no' |
| 48 |
echo 'graph_category webserver' |
| 49 |
echo 'graph_info Indicate the total memory used by apache.' |
| 50 |
|
| 51 |
echo "servers.label servers" |
| 52 |
echo "servers.type GAUGE" |
| 53 |
echo "servers.min 0" |
| 54 |
|
| 55 |
exit 0 |
| 56 |
fi |
| 57 |
|
| 58 |
VAL1=`ps auxf | grep ${PROCS} | grep -v grep | awk '{s+=$6} END {print s}'`
|
| 59 |
|
| 60 |
VAL2=`expr $VAL1 / 1024` |
| 61 |
|
| 62 |
echo "servers.value $VAL2" |
| 63 |
|
| 64 |
|
