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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
![Reply](https://www.linuxquestions.org/questions/images/buttons/reply.gif) |
10-13-2010, 08:26 AM
|
#1
|
LQ Newbie
Registered: Oct 2010
Posts: 11
Rep:
|
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
|
|
|
10-13-2010, 08:42 AM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,434
|
Quote:
Originally Posted by champs1234
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.
|
|
|
|
10-13-2010, 09:00 AM
|
#3
|
LQ Newbie
Registered: Oct 2010
Posts: 11
Original Poster
Rep:
|
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.
|
|
|
10-23-2010, 01:42 AM
|
#4
|
LQ Newbie
Registered: Oct 2010
Posts: 11
Original Poster
Rep:
|
Please help, m still looking for the answer..
|
|
|
10-23-2010, 11:17 AM
|
#5
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,434
|
Quote:
Originally Posted by champs1234
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.
|
|
|
10-26-2010, 02:56 AM
|
#6
|
LQ Newbie
Registered: Oct 2010
Posts: 11
Original Poster
Rep:
|
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..
|
|
|
All times are GMT -5. The time now is 02:44 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|