LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-13-2010, 08:26 AM   #1
champs1234
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Rep: Reputation: 0
Problem backing radius server logs to database


Iam having problems in storing radius server logs to mysql database, though they are easily logged to files.

I want to log all the fail logs in a mysql database table. For this i have included sql in Post-Auth-Type REJECT section of post-auth section of radiusd.conf

Quote:
post-auth {
Post-Auth-Type REJECT {
sql
}
}
and following line in sql.conf

Quote:
postauth_query = "Here is my sql command "
But whenever i try to start the radius server it fails giving the following error :

Quote:
Error: radiusd.conf: "SQL" modules aren't allowed in 'post-auth' sections -- they have no such method.
Iam using freeradius please help.

Thanks
 
Old 10-13-2010, 08:42 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,434

Rep: Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112
Quote:
Originally Posted by champs1234 View Post
Iam having problems in storing radius server logs to mysql database, though they are easily logged to files.

I want to log all the fail logs in a mysql database table. For this i have included sql in Post-Auth-Type REJECT section of post-auth section of radiusd.conf and following line in sql.conf

But whenever i try to start the radius server it fails giving the following error :

Iam using freeradius please help.
Did you try to look this up on the Freeradius site???
http://wiki.freeradius.org/index.php/FAQ

From the doc:
Quote:
How do I log failed login attempts in a SQL database?
You may run a SQL query each time a user has an access denied. First you need to write your SQL statement in the directive postauth_query of the module rlm_sql. For example:
postauth_query = "INSERT into radpostauth (user, pass, date) values ('%{User-Name}', '%{User-Password:-Chap-Password}', '%S')"

Then add the sql module to the post-auth section of radiusd.conf. Since we want to run the SQL query only on failed login, we need to use the sub-section Post-Auth-Type REJECT. For example:

post-auth {
# Login successful: get an address from the IP pool.
ippool
Post-Auth-Type REJECT {
# Login failed: log to SQL database.
sql
}
}
Note: This option is usable if you want to detect fraud or similar activities from your users. Keep in mind that this table can became a very large in case you disable to much user accounts, in case of ddos attack, etc. Every rejected attempt will be logged.
 
Old 10-13-2010, 09:00 AM   #3
champs1234
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: 0
Ya i have. Tell me one thing , isn't

Quote:
First you need to write your SQL statement in the directive postauth_query of the module rlm_sql. For example:
postauth_query = "INSERT into radpostauth (user, pass, date) values ('%{User-Name}', '%{User-Password:-Chap-Password}', '%S')"
equals

following line in sql.conf

Quote:
postauth_query = "Here is my sql command "
.

If not then please explain the above.
 
Old 10-23-2010, 01:42 AM   #4
champs1234
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: 0
Please help, m still looking for the answer..
 
Old 10-23-2010, 11:17 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,434

Rep: Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112Reputation: 8112
Quote:
Originally Posted by champs1234 View Post
Please help, m still looking for the answer..
You were given the answer already. Read the link, follow the instructions. Doesn't get much simpler than that. If you can't understand the link, then get someone else to do it for you.
 
Old 10-26-2010, 02:56 AM   #6
champs1234
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: 0
I have read that and tried that but still no success. Iam still getting this error. Thats why iam asking for help :

Quote:
Error: radiusd.conf: "SQL" modules aren't allowed in 'post-auth' sections -- they have no such method.
Its not about understanding it, it about solution. Since i didn't got success then there could be 2 cases either i have done something wrong or this solution is not working. So in my above posts i was checking the 1st case, but now i think its not the 1st case its 2nd..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in setting up radius server champs1234 Linux - Newbie 11 10-23-2010 11:19 AM
Backing up and/or delete logs with a cron job. NaCo Linux - Server 2 08-01-2009 04:16 AM
radius server authorize problem jjsan Linux - Server 0 07-23-2008 05:02 AM
double logs in radius packets Linux - Software 1 08-09-2007 04:54 AM
How to configure RADIUS with MySQL as backend database ronbenva Linux - Networking 2 05-25-2006 09:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration