(RADIATOR) accounting multiple cisco-avpair attributes

Chris Patterson Chris.Patterson at transact.com.au
Thu May 13 22:01:36 CDT 2004


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.


More information about the radiator mailing list