~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to scripts/freeradius_proxy_acct

  • Committer: Bazaar Package Importer
  • Author(s): Josip Rodin
  • Date: 2009-11-23 03:57:37 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20091123035737-zsgtzhfych8hir68
Tags: 2.1.7+dfsg-1
* Adopting the package, closes: #536623.
* New upstream version, closes: #513484.
  + Fixes the blooper in unlang evaluation logic, closes: #526175.
* Used quilt (and added README.source), and moved upstream file patching
  into debian/patches/. The source is no longer in collab-maint git
  (to make it simpler for me to finally get this out the door), but
  kept the .gitignore should we need that again.
* Dropped the dialup_admin/bin/backup_radacct patch (integrated upstream).
* Dropped the raddb/Makefile patch (problem no longer exists upstream).
* Dropped the lib/packet.c lib/radius.c main/listen.c patches (was from
  upstream 2.0.5 anyway).
* Dropped references to otp.conf, it no longer exists upstream.
  Keep removing the conffile statoverride in prerm.
* Dropped references to snmp.conf, it no longer exists upstream.
  Keep removing the conffile statoverride in prerm.
* Ship /etc/freeradius/modules/* in the freeradius package.
* Stop shipping sites-enabled symlinks in the package and instead create
  them only on initial install, thanks to Matej Vela, closes: #533396.
* Add export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" to the init script
  at the request of John Morrissey, closes: #550143.
* Stop installing /var/run/freeradius in the package to silence Lintian.
  The init script already recreates it at will.
* Remove executable bit from example.pl to silence Lintian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 Proxied Accounting 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 Accounting-Requests'
 
46
    echo 'requests.info total sent request packets'
 
47
    echo 'requests.type DERIVE'
 
48
    echo 'requests.min 0'
 
49
 
 
50
    echo 'responses.label Accounting-Responses'
 
51
    echo 'responses.info total received response packets'
 
52
    echo 'responses.type DERIVE'
 
53
    echo 'responses.min 0'
 
54
 
 
55
    echo 'dup.label 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 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 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 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 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 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 acct" | awk '{print $1".value " $2}'