Ascend Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (ASCEND) Radius accounting



Hi

Glenn Howard wrote:

> [...] What we would like to do is be able to check the
> accounting data for overtime hours, etc, as well as have a
> system where users can log into a web page and check how many
> hours that they have used. 

Checking for 'overtime hours' is a royal PITA with any normal
radius server. Collecting user data from the accounting files
should not be too difficult however. Here's something that I use
over here to retrieve the essential data from detail files
(session time & bytes transferred) (slightly edited) 

You will have to use something else to collate this per user, but
I leave that as an excercise. :)


-- cut here

#!/usr/bin/gawk -f

BEGIN {
	FS = " = "
}

NF == 0 {
	if (x["	Acct-Status-Type"] == "Stop") {
		gsub("\"", "", x["	User-Name"])
		if (x["	User-Name"]) {
			print \
				x["	User-Name"] " " \
				x["	Acct-Session-Time"] " " \
				x["	Acct-Input-Octets"] " " \
				x["	Acct-Output-Octets"]
		}
	}

	delete x;
}

NF == 2 {
	x[$1] = $2
}

-- END

Cheers
Michiel

-- 
Michiel Boland <boland@diva.nl>
Digital Valley Internet Professionals
Duivendaal 4, Wageningen, The Netherlands
Phone: +31 317 465555, Fax: +31 317 460276


++ Ascend Users Mailing List ++
To unsubscribe:	send unsubscribe to ascend-users-request@bungi.com
To get FAQ'd:	<http://www.nealis.net/ascend/faq>


Follow-Ups: References: