Debian Codegraph @

scripts/munin/freeradius_proxy_acct

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/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 <[email protected]>
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.sockscip-shell filesystem . . `/var/run/radiusd/radiusd.sock`.
29
30 if [scip-shell system . . `[`. "$1" = "autoconf" ]; then
31 #
32 # FIXME: Check if FreeRADIUS is running.
33 #
34 echoscip-shell system . . echo. yes
35 exit 0
36 fi
37
38 if [scip-shell system . . `[`. "$1" = "config" ]; then
39 echoscip-shell system . . echo. 'graph_title FreeRADIUS Proxied Accounting Requests'
40 echoscip-shell system . . echo. 'graph_args --base 1000 -l 0 '
41 echoscip-shell system . . echo. 'graph_period second'
42 echoscip-shell system . . echo. 'graph_vlabel requests / ${graph_period}'
43 echoscip-shell system . . echo. 'graph_category Other'
44
45 echoscip-shell system . . echo. 'requests.label Accounting-Requests'
46 echoscip-shell system . . echo. 'requests.info total sent request packets'
47 echoscip-shell system . . echo. 'requests.type DERIVE'
48 echoscip-shell system . . echo. 'requests.min 0'
49
50 echoscip-shell system . . echo. 'responses.label Accounting-Responses'
51 echoscip-shell system . . echo. 'responses.info total received response packets'
52 echoscip-shell system . . echo. 'responses.type DERIVE'
53 echoscip-shell system . . echo. 'responses.min 0'
54
55 echoscip-shell system . . echo. 'dup.label Duplicate requests'
56 echoscip-shell system . . echo. 'dup.info total duplicate request packets'
57 echoscip-shell system . . echo. 'dup.type DERIVE'
58 echoscip-shell system . . echo. 'dup.min 0'
59
60 echoscip-shell system . . echo. 'invalid.label Invalid requests'
61 echoscip-shell system . . echo. 'invalid.info total invalid request packets'
62 echoscip-shell system . . echo. 'invalid.type DERIVE'
63 echoscip-shell system . . echo. 'invalid.min 0'
64
65 echoscip-shell system . . echo. 'malformed.label Malformed requests'
66 echoscip-shell system . . echo. 'malformed.info total malformed request packets'
67 echoscip-shell system . . echo. 'malformed.type DERIVE'
68 echoscip-shell system . . echo. 'malformed.min 0'
69
70 echoscip-shell system . . echo. 'bad_signature.label Requests with bad signature'
71 echoscip-shell system . . echo. 'bad_signature.info total request packets with a bad signature'
72 echoscip-shell system . . echo. 'bad_signature.type DERIVE'
73 echoscip-shell system . . echo. 'bad_signature.min 0'
74
75 echoscip-shell system . . echo. 'dropped.label Dropped requests'
76 echoscip-shell system . . echo. 'dropped.info total request packets dropped for other reasons'
77 echoscip-shell system . . echo. 'dropped.type DERIVE'
78 echoscip-shell system . . echo. 'dropped.min 0'
79
80 echoscip-shell system . . echo. 'unknown_types.label Unknown type'
81 echoscip-shell system . . echo. 'unknown_types.info total request packets of unknown type'
82 echoscip-shell system . . echo. 'unknown_types.type DERIVE'
83 echoscip-shell system . . echo. 'unknown_types.min 0'
84
85 exit 0
86 fi
87
88 $RADMIN -f $SOCKETFILE -e "stats client acct" | awkscip-shell system . . awk. '{print $1".value " $2}'