(RADIATOR) accounting multiple cisco-avpair attributes

Isuru Binduhewa isuru.binduhewa at dialog.lk
Thu May 13 23:33:55 CDT 2004


Hi All
I am currently getting the accounting date to MySQL db.I have some problem with getting attributes like
cisco-h323-setup-time = "h323-setup-time=*10:58:40.746 UTC Sat May 8 2004" to the DB
What is store under SetUpTime in the ACCOUNTING table of mySQL DB is  h323-setup-time=*10:58:40.746 UTC Sat May 8 2004.I just want to get the set up time as DATE Time format.

Pls help me on this.

Thanks
Isuru..


-----Original Message-----
From: Chris Patterson [mailto:Chris.Patterson at transact.com.au]
Sent: Friday, May 14, 2004 9:02 AM
To: radiator at open.com.au
Subject: (RADIATOR) accounting multiple cisco-avpair attributes


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.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: InterScan_Disclaimer.txt
URL: <http://www.open.com.au/pipermail/radiator/attachments/20040514/33a81afd/attachment.txt>


More information about the radiator mailing list