Révision dbaeb025
Plugins apache_tmemory and apache_servers: multiple changes
- use base SI units for memory consumption
(breaks graph values compared to older version) - fix quoting for regular expressions
- use common defaults for configuration settings
| plugins/apache/apache_servers | ||
|---|---|---|
| 5 | 5 |
|
| 6 | 6 |
=head1 NAME |
| 7 | 7 |
|
| 8 |
apache_servers -Indicate the number of apache servers running (child process) |
|
| 8 |
apache_servers - Indicate the number of apache servers running (child process)
|
|
| 9 | 9 |
|
| 10 | 10 |
=head1 CONFIGURATION |
| 11 | 11 |
|
| 12 | 12 |
[apache_*] |
| 13 |
env.apuser user_runnin_apache
|
|
| 14 |
env.binname apache_binary_name |
|
| 13 |
env.apuser user_running_apache (default: "www-data")
|
|
| 14 |
env.binname apache_binary_name (default: "apache2")
|
|
| 15 | 15 |
|
| 16 | 16 |
=head1 AUTHOR |
| 17 | 17 |
|
| ... | ... | |
| 28 | 28 |
|
| 29 | 29 |
=cut |
| 30 | 30 |
|
| 31 |
. $MUNIN_LIBDIR/plugins/plugin.sh
|
|
| 31 |
. "$MUNIN_LIBDIR/plugins/plugin.sh"
|
|
| 32 | 32 |
|
| 33 |
USR=$apuser
|
|
| 34 |
PROCS=$binname
|
|
| 33 |
USR=${apuser:-www-data}
|
|
| 34 |
PROCS=${binname:-apache2}
|
|
| 35 | 35 |
|
| 36 | 36 |
if [ "$1" = "autoconf" ]; then |
| 37 | 37 |
echo yes |
| ... | ... | |
| 40 | 40 |
|
| 41 | 41 |
if [ "$1" = "config" ]; then |
| 42 | 42 |
|
| 43 |
echo 'graph_title Number of apache servers running.'
|
|
| 44 |
echo 'graph_args --base 1000 -l 0 '
|
|
| 45 |
echo 'graph_vlabel servers'
|
|
| 46 |
echo 'graph_scale no'
|
|
| 47 |
echo 'graph_category webserver'
|
|
| 48 |
echo 'graph_info Indicate the number of apache servers running (child process).'
|
|
| 43 |
echo 'graph_title Number of apache servers running'
|
|
| 44 |
echo 'graph_args --base 1000 -l 0 '
|
|
| 45 |
echo 'graph_vlabel servers'
|
|
| 46 |
echo 'graph_scale no'
|
|
| 47 |
echo 'graph_category webserver'
|
|
| 48 |
echo 'graph_info Indicate the number of apache servers running (child process).'
|
|
| 49 | 49 |
|
| 50 |
echo "servers.label servers" |
|
| 51 |
echo "servers.type GAUGE" |
|
| 52 |
echo "servers.min 0" |
|
| 53 |
echo "servers.info Number of apache processes" |
|
| 50 | 54 |
|
| 51 |
|
|
| 52 |
echo "servers.label servers" |
|
| 53 |
echo "servers.type GAUGE" |
|
| 54 |
echo "servers.min 0" |
|
| 55 |
echo "servers.info I/O on nfs" |
|
| 56 |
|
|
| 57 |
exit 0 |
|
| 55 |
exit 0 |
|
| 58 | 56 |
fi |
| 59 | 57 |
|
| 60 |
VAL1=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | wc -l`
|
|
| 61 |
|
|
| 62 |
echo "servers.value $VAL1" |
|
| 63 |
|
|
| 64 |
|
|
| 58 |
process_count=$(ps auxf | grep -- "$PROCS" | grep "^$USR" | grep -v grep | wc -l) |
|
| 59 |
echo "servers.value $process_count" |
|
Formats disponibles : Unified diff