forked from munin-monitoring/contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apache_servers
executable file
·64 lines (39 loc) · 1 KB
/
apache_servers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
# -*- sh -*-
: << =cut
=head1 NAME
apache_servers -Indicate the number of apache servers running (child process)
=head1 CONFIGURATION
[apache_*]
env.apuser user_runnin_apache
env.binname apache_binary_name
=head1 AUTHOR
Ricardo Fraile <[email protected]>
=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 Number of apache servers running.'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel servers'
echo 'graph_scale no'
echo 'graph_category apache'
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 I/O on nfs"
exit 0
fi
VAL1=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | wc -l`
echo "servers.value $VAL1"