Sample file for Munin, using new radmin tool.
[freeradius.git] / scripts / freeradius.auth.munin
1 #!/bin/sh
2 #
3 # Plugin to count the daily amount of freeradius authentication packets.
4 #
5 # Written by Alan DeKok <aland@freeradius.org>
6 #
7 # Magic markers - optional - used by installation scripts and
8 # munin-config:
9 #
10 #%# family=manual
11 #%# capabilities=autoconf
12
13 RADMIN=radmin
14 SOCKETFILE=/var/run/radiusd/radiusd.sock
15
16 if [ "$1" = "autoconf" ]; then
17     #
18     #  FIXME: Check if FreeRADIUS is running.
19     #
20     echo yes
21     exit 0
22 fi
23
24 if [ "$1" = "config" ]; then
25     echo 'graph_title FreeRADIUS Authentication Requests'
26     echo 'graph_args --base 1000 -l 0 '
27     echo 'graph_vlabel requests / ${graph_period}'
28     echo 'graph_category Other'
29
30     echo 'request.label total requests'
31     echo 'request.info total incoming request packets'
32     echo 'request.type DERIVE'
33     echo 'request.min 0'
34
35     echo 'responses.label total responses'
36     echo 'responses.info total outgoing response packets'
37     echo 'responses.type DERIVE'
38     echo 'responses.min 0'
39
40     echo 'accepts.label total Access-Accepts'
41     echo 'accepts.info total sent Access-Accept packets'
42     echo 'accepts.type DERIVE'
43     echo 'accepts.min 0'
44
45     echo 'rejects.label total Access-Rejects'
46     echo 'rejects.info total sent Access-Reject packets'
47     echo 'rejects.type DERIVE'
48     echo 'rejects.min 0'
49
50     echo 'challenges.label total Access-Challenges'
51     echo 'challenges.info total sent Access-Challenge packets'
52     echo 'challenges.type DERIVE'
53     echo 'challenges.min 0'
54
55     echo 'dup.label total duplicate requests'
56     echo 'dup.info total duplicate request packets'
57     echo 'dup.type DERIVE'
58     echo 'dup.min 0'
59
60     echo 'invalid.label total invalid requests'
61     echo 'invalid.info total invalid request packets'
62     echo 'invalid.type DERIVE'
63     echo 'invalid.min 0'
64
65     echo 'malformed.label total malformed requests'
66     echo 'malformed.info total malformed request packets'
67     echo 'malformed.type DERIVE'
68     echo 'malformed.min 0'
69
70     echo 'bad_signature.label total requests with bad signature'
71     echo 'bad_signature.info total request packets with a bad signature'
72     echo 'bad_signature.type DERIVE'
73     echo 'bad_signature.min 0'
74
75     echo 'dropped.label total dropped requests'
76     echo 'dropped.info total request packets dropped for other reasons'
77     echo 'dropped.type DERIVE'
78     echo 'dropped.min 0'
79
80     echo 'unknown_types.label total requests of unknown type'
81     echo 'unknown_types.info total request packets of unknown type'
82     echo 'unknown_types.type DERIVE'
83     echo 'unknown_types.min 0'
84
85     exit 0
86 fi
87
88 $RADMIN -f $SOCKETFILE -e "stats client auth" | awk '{print $1".value " $2}'