(RADIATOR) accounting multiple cisco-avpair attributes

Hugh Irvine hugh at open.com.au
Fri May 14 00:09:27 CDT 2004


Hello Chris -

Many thanks for this - would you mind if I included your code in 
"goodies/hooks.txt" (with credit to you of course)?

regards

Hugh


On 14 May 2004, at 13:01, Chris Patterson wrote:

> Folks,
> 	I've seen some discussion on the lists related to the logging of 
> cisco-avpairs, and thought I would contribute the following:
>
> All I'm doing here is taking each cisco-avpair attribute from the 
> incoming packet and adding new attributes onto the same incoming 
> packet.
>
> eg:
>         cisco-avpair = "task_id=62"
>         cisco-avpair = "timezone=UTC"
>         cisco-avpair = "service=shell"
>         cisco-avpair = "priv-lvl=0"
>         cisco-avpair = "cmd=exit <cr>"
>
> become:
> 		task_id = 62
> 		timezone = UTC
> 		service = shell
> 		priv-lvl = 0
> 		cmd = "exit <cr>"
>
> Hope this assists people in their endeavours!
>
> Cheers
> Chris.
>
>
> radiator.cfg
>
> <Handler>
> 	PreProcessingHook	file:"%D/createavpairs"
> 	<AuthBy SQL>
> 		DBSource	dbi:mysql:radius
> 		DBUsername	test
> 		DBAuth		test
>
> 		AccountingTable	ACCOUNTING
> 		AcctColumnDef		TIMESTAMP,Timestamp,integer
> 		AcctColumnDef		NASIP,NAS-IP-Address
> 		AcctColumnDef		USERNAME,User-Name
> 		AcctColumnDef		CALLLINGID,Calling-Station-Id
> 		AcctColumnDef		PRIVLVL,priv-lvl
> 		AcctColumnDef		CMD,cmd
> 	</AuthBy>
> </Handler>
>
>
> createavpairs
>
> sub {
> 	my $p=${$_[0]};
> 	if (my @avpair = $p->get_attr('cisco-avpair')) {
> 		foreach my $avpair (@avpair) {
> 			$p->add_attr(split('=',$avpair));
> 		}
> 	}
> }
>
> --
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
>
>

NB: have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.

--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list