1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00
Munin-Contrib/plugins/apache/apache_servers
Lars Kruse dbaeb0253c 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
2020-04-21 20:11:27 +02:00

59 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
# -*- sh -*-
: << =cut
=head1 NAME
apache_servers - Indicate the number of apache servers running (child process)
=head1 CONFIGURATION
[apache_*]
env.apuser user_running_apache (default: "www-data")
env.binname apache_binary_name (default: "apache2")
=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:-www-data}
PROCS=${binname:-apache2}
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Number of apache servers running'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel servers'
echo 'graph_scale no'
echo 'graph_category webserver'
echo 'graph_info Indicate the number of apache servers running (child process).'
echo "servers.label servers"
echo "servers.type GAUGE"
echo "servers.min 0"
echo "servers.info Number of apache processes"
exit 0
fi
process_count=$(ps auxf | grep -- "$PROCS" | grep "^$USR" | grep -v grep | wc -l)
echo "servers.value $process_count"