Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / apache / apache_memmory @ 17f78427

Historique | Voir | Annoter | Télécharger (1,07 ko)

1
#!/bin/sh
2
# -*- sh -*-
3

    
4
: << =cut
5

    
6
=head1 NAME
7

    
8
apache_memmory -Indicate the medium size of all the apache child process
9

    
10
=head1 CONFIGURATION
11

    
12
[apache_*]
13
env.apuser user_running_apache
14
env.binname apache_binary_name
15

    
16

    
17
=head1 AUTHOR
18

    
19
Ricardo Fraile <rfrail3@yahoo.es>
20

    
21
=head1 LICENSE
22

    
23
GPLv2
24

    
25
=head1 MAGICK MARKERS
26

    
27
 #%# family=auto
28
 #%# capabilities=autoconf
29

    
30
=cut
31

    
32
. $MUNIN_LIBDIR/plugins/plugin.sh
33

    
34
USR=$apuser
35
PROCS=$binname
36

    
37

    
38
if [ "$1" = "autoconf" ]; then
39
	echo yes
40
	exit 0
41
fi
42

    
43
if [ "$1" = "config" ]; then
44

    
45
	echo 'graph_title Medium size of apache child process.'
46
	echo 'graph_args --base 1000 -l 0 '
47
	echo 'graph_vlabel Kb'
48
	echo 'graph_scale no'
49
	echo 'graph_category webserver'
50
	echo 'graph_info Indicate the memdium size of all the apache child process.'
51

    
52

    
53

    
54
        echo "servers.label servers"
55
        echo "servers.type GAUGE"
56
        echo "servers.min 0"
57

    
58
	exit 0
59
fi
60

    
61
VAL1=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | wc -l`
62

    
63
VAL2=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | awk '{s+=$6} END {print s}'`
64

    
65
VAL3=`expr $VAL2 / $VAL1`
66

    
67
echo "servers.value $VAL3"
68

    
69