New build path variable
[freeradius.git] / scripts / freeradius_auth
1 #!/bin/sh
2 #
3 # Plugin to count the daily amount of freeradius authentication packets.
4 #
5 #    This program is free software; you can redistribute it and/or modify
6 #    it under the terms of the GNU General Public License as published by
7 #    the Free Software Foundation; either version 2 of the License, or
8 #    (at your option) any later version.
9 #
10 #    This program is distributed in the hope that it will be useful,
11 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #    GNU General Public License for more details.
14 #
15 #    You should have received a copy of the GNU General Public License
16 #    along with this program; if not, write to the Free Software
17 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 #
19 #    Copyright (C) 2008 Alan DeKok <aland@deployingradius.com>
20 #
21 # Magic markers - optional - used by installation scripts and
22 # munin-config:
23 #
24 #%# family=manual
25 #%# capabilities=autoconf
26
27 RADMIN=radmin
28 SOCKETFILE=/var/run/radiusd/radiusd.sock
29
30 if [ "$1" = "autoconf" ]; then
31     #
32     #  FIXME: Check if FreeRADIUS is running.
33     #
34     echo yes
35     exit 0
36 fi
37
38 if [ "$1" = "config" ]; then
39     echo 'graph_title FreeRADIUS Authentication Requests'
40     echo 'graph_args --base 1000 -l 0 '
41     echo 'graph_period second'
42     echo 'graph_vlabel requests / ${graph_period}'
43     echo 'graph_category Other'
44
45     echo 'requests.label Access-Requests'
46     echo 'requests.info total received request packets'
47     echo 'requests.type DERIVE'
48     echo 'requests.min 0'
49
50     echo 'responses.label responses (all types)'
51     echo 'responses.info total sent response packets'
52     echo 'responses.type DERIVE'
53     echo 'responses.min 0'
54
55     echo 'accepts.label Access-Accepts'
56     echo 'accepts.info total sent Access-Accept packets'
57     echo 'accepts.type DERIVE'
58     echo 'accepts.min 0'
59
60     echo 'rejects.label Access-Rejects'
61     echo 'rejects.info total sent Access-Reject packets'
62     echo 'rejects.type DERIVE'
63     echo 'rejects.min 0'
64
65     echo 'challenges.label Access-Challenges'
66     echo 'challenges.info total sent Access-Challenge packets'
67     echo 'challenges.type DERIVE'
68     echo 'challenges.min 0'
69
70     echo 'dup.label Duplicate requests'
71     echo 'dup.info total duplicate request packets'
72     echo 'dup.type DERIVE'
73     echo 'dup.min 0'
74
75     echo 'invalid.label Invalid requests'
76     echo 'invalid.info total invalid request packets'
77     echo 'invalid.type DERIVE'
78     echo 'invalid.min 0'
79
80     echo 'malformed.label Malformed requests'
81     echo 'malformed.info total malformed request packets'
82     echo 'malformed.type DERIVE'
83     echo 'malformed.min 0'
84
85     echo 'bad_signature.label Requests with bad signature'
86     echo 'bad_signature.info total request packets with a bad signature'
87     echo 'bad_signature.type DERIVE'
88     echo 'bad_signature.min 0'
89
90     echo 'dropped.label Dropped requests'
91     echo 'dropped.info total request packets dropped for other reasons'
92     echo 'dropped.type DERIVE'
93     echo 'dropped.min 0'
94
95     echo 'unknown_types.label Unknown type'
96     echo 'unknown_types.info total request packets of unknown type'
97     echo 'unknown_types.type DERIVE'
98     echo 'unknown_types.min 0'
99
100     exit 0
101 fi
102
103 $RADMIN -f $SOCKETFILE -e "stats client auth" | awk '{print $1".value " $2}'