(RADIATOR) Accounting / Session to Log SYSLOG ?
Martin Wallner
Martin.Wallner at eunet.co.at
Thu Oct 12 07:22:27 CDT 2006
We do this with a preprocessing-hook (but I agree with you, it would be
.. nicer to have this embedded in radiator....)
Feel free to use it (and yes, it's a bit ... peculiar, but that hook
does a bit more in our setup :-)
=mw=
----------------------------------
sub {
&main::log($main::LOG_DEBUG,"entering hook");
my $request = ${$_[0]};
my $type=$request->get_attr('Acct-Status-Type');
if ($type =~ /Stop/) {
my $user=$request->get_attr('User-Name');
my $nasip=$request->get_attr('NAS-IP-Address');
my $nasport=$request->get_attr('NAS-Port');
my $sessid=$request->get_attr('Acct-Session-Id');
my $ip=$request->get_attr('Framed-IP-Address');
my $cause=$request->get_attr('Acct-Terminate-Cause');
&main::log($main::LOG_INFO,"Accounting: '$user' from
$nasip port $nasport \$\"$sessid\" $ip $type/$cause - OK");
}
&main::log($main::LOG_DEBUG,"leaving hook");
return;
}
---------------------------------
> -----Original Message-----
> From: owner-radiator at open.com.au
> [mailto:owner-radiator at open.com.au] On Behalf Of Faisal Imtiaz
> Sent: Donnerstag, 12. Oktober 2006 13:22
> To: radiator at open.com.au
> Subject: RE: (RADIATOR) Accounting / Session to Log SYSLOG ?
>
>
> Hello,
>
> While we are on the subject of logging messages to Syslog.
>
> Is there a way to send the accounting messages to Syslog ?
> i.e.
> > # Log accounting to a detail file
> > AcctLogFileName /usr/local/etc/radiator/detail
> Instead of going into a file, send these to a central Syslog server.
>
> Or
> Is there a way to send the session messages to Syslog ?
>
> Our customer support reps use the Syslog heavily to provide
> customer support and troubleshoot DSL connections.
> In the 'Log off' Accounting message there is a key bit of
> information (reason for login off) that they could use by
> accessing it via Syslog.
> Logging at Trace 3 give too little info, and logging at Trace
> 4 give too much info !
>
> Thanks.
>
> Faisal Imtiaz
> Computer Office Solutions Inc. /SnappyDSL.net
> Ph: (305) 663-5518
>
>
> > I am having a problem in getting Radiator to log to SYSLOG, I am
> > running FreeBSD .
> >
> > Using Radiator Ver 3.12 on FreeBSD.
> > Using Syslog-ng -> fully operational.
>
> >
> > My Radius.cfg
> > -----------------------------------
> > #Foreground
> > LogStdout
> > LogDir /usr/local/etc/radiator
> > DbDir /usr/local/etc/radiator
> >
> > AuthPort 1645,1812
> > AcctPort 1646,1813
> >
> > # Priority level of trace messages to be logged in the log file (0
> > - 5)
> > Trace 3
> >
> > <Realm negia.net>
> > <AuthBy RADIUS>
> > Host 69.55.xx.xx
> > Secret xxxxx
> > AuthPort 1812
> > AcctPort 1813
> > </AuthBy>
> >
> > <ClientListSQL>
> > DBSource dbi:mysql:radius:localhost
> > DBUsername xxxxx
> > DBAuth xxxxxxxx
> > RefreshPeriod 30
> > </ClientListSQL>
> >
> > <AuthLog SQL>
> > # MySQL DB, DB radius, host localhost
> > DBSource dbi:mysql:radius:localhost
> > DBUsername xxxxxx
> > DBAuth xxxxxxxxxxx
> > Table RADAUTHLOG
> > SuccessQuery insert into RADAUTHLOG (TIME_STAMP,
> > USERNAME, TYPE, REASON, PASSWORD) values ('%l','%n', %0,
> > 'Succeeded','%P')
> > FailureQuery insert into RADAUTHLOG (TIME_STAMP,
> > USERNAME, TYPE, REASON, PASSWORD) values ('%l','%n', %0,
> > 'Failed','%P')
> > LogSuccess 1
> > LogFailure 1
> >
> > </AuthLog>
> >
> > </Realm>
> >
> >
> >
> > <Realm DEFAULT>
> > <AuthBy SQL>
> > # MySQL DB, DB radius, host localhost
> > DBSource dbi:mysql:radius:localhost
> > DBUsername xxxxxxx
> > DBAuth xxxxxxx
> >
> > # Define Table and Columns for Authentication
> > AuthSelect select PASSWORD, SERVICETYPE,
> > FRAMEDPROTOCOL, TRAFFICSHAPE, ACL, PORTLIMIT, TIMELEFT, IPPOOL,
> > FRAMEDIPADD, FRAMEDIPNETMASK, FRAMEDROUTE, FRAMEDROUTING, DNS \
> > from SUBSCRIBERS where USERNAME = %0
> > AuthColumnDef 0, Password, check
> > AuthColumnDef 1, GENERIC, check
> > AuthColumnDef 2, GENERIC, reply
> > AuthColumnDef 3, GENERIC, reply
> > AuthColumnDef 4, GENERIC, reply
> > AuthColumnDef 5, GENERIC, reply
> > AuthColumnDef 6, GENERIC, reply
> > AuthColumnDef 7, GENERIC, reply
> > AuthColumnDef 8, GENERIC, reply
> > AuthColumnDef 9, GENERIC, reply
> > AuthColumnDef 10, GENERIC, reply
> > AuthColumnDef 11, GENERIC, reply
> > AuthColumnDef 12, GENERIC, reply
> >
> > # Define Table and Columns for Accounting
> > AccountingTable ACCOUNTING
> > AcctColumnDef USERNAME,User-Name
> > AcctColumnDef
> TIME_STAMP,Timestamp,formatted-date,\
> > '%Y/%m/%e %H:%M:%S'
> > AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type
> > AcctColumnDef
> ACCTDELAYTIME,Acct-Delay-Time,integer
> > AcctColumnDef ACCTINPUTOCTETS,Acct-Input-
> > Octets,integer
> > AcctColumnDef ACCTOUTPUTOCTETS,Acct-Output-
> > Octets,integer
> > AcctColumnDef ACCTSESSIONID,Acct-Session-Id
> > AcctColumnDef ACCTSESSIONTIME,Acct-Session-
> > Time,integer
> > AcctColumnDef ACCTTERMINATECAUSE,Acct-Terminate-
> > Cause
> > AcctColumnDef NASIDENTIFIER,NAS-Identifier
> > AcctColumnDef NASIPADDRESS,NAS-IP-Address
> > AcctColumnDef NASPORT,NAS-Port,integer
> > AcctColumnDef FRAMEDIPADDRESS,Framed-IP-Address
> > </AuthBy>
> > <ClientListSQL>
> > DBSource dbi:mysql:radius:localhost
> > DBUsername xxxxxx
> > DBAuth xxxxxxxx
> > RefreshPeriod 30
> > </ClientListSQL>
> >
> > <SessionDatabase SQL>
> > DBSource dbi:mysql:radius:localhost
> > DBUsername xxxxxx
> > DBAuth xxxxxxxx
> > AddQuery insert into RADONLINE (USERNAME,
> > NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS,
> > NASPORTTYPE, SERVICETYPE) values ('%u',
> '%{NAS-Identifier}', '%2', %
> > 3, '%A', '%{Framed-IP-Address}', '%{NAS-Port-Type}',
> > '%{Service-Type}')
> > DeleteQuery delete from RADONLINE where USERNAME=%0
> > </SessionDatabase SQL>
> >
> > # Log accounting to a detail file
> > AcctLogFileName /usr/local/etc/radiator/detail
> >
> > <AuthLog SQL>
> > # MySQL DB, DB radius, host localhost
> > DBSource dbi:mysql:radius:localhost
> > DBUsername xxxxx
> > DBAuth xxxxxxxxx
> > Table RADAUTHLOG
> > SuccessQuery insert into RADAUTHLOG
> (TIME_STAMP, USERNAME,
> TYPE,
> > REASON, PASSWORD) values ('%l','%n', %0, 'Succeeded','%P')
> > FailureQuery insert into RADAUTHLOG (TIME_STAMP,
> >USERNAME, TYPE, REASON, PASSWORD) values ('%l','%n', %0,
> > 'Failed','%P')
> > LogSuccess 1
> > LogFailure 1
> > </AuthLog>
> > <Log SYSLOG>
> > Facility local5
> > Trace 4
> > LogSuccess 1
> > LogFailure 1
> > SuccessFormat %l,%n,%0,Success
> > FailureFormat %l,%n,%0,Failure,%P
> > </Log>
> >
> > </Realm>
> >
> > ---------------------------------------------------
> >
> >
> > Faisal Imtiaz
> > Computer Office Solutions Inc. /SnappyDSL.net
> > Ph: (305) 663-5518
> >
> > --
> > 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 read the reference manual ("doc/ref.html")?
> Have you searched the mailing list archive
> (www.open.com.au/archives/ radiator)?
> Have you had a quick look on Google (www.google.com)?
> 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.
> Includes support for reliable RADIUS transport (RadSec), and
> DIAMETER translation agent.
> -
> 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.
>
--
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.
--
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