| 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 <[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.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 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 received request packets' |
| 47 | echo 'requests.type DERIVE' |
| 48 | echo 'requests.min 0' |
| 49 | |
| 50 | echo 'responses.label Accounting-Responses' |
| 51 | echo 'responses.info total sent 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}' |