Importing users and nas clients from the radius files to a mysql database
Hi Is there a tool that can be run (Linux Rocky9) to import the freeradius users and the nas clients to a mysql (mariadb) database? If so, please can you point me to it ...-- Conrad
Not specifically from the RADIUS files itself, but you can take a look at DaloRADIUS. It's a web interface to a (mariadb) database for use with FreeRADIUS. It has import options. Maybe you can modify the RADIUS text files to work with this. Greetings, Jochem -----Oorspronkelijk bericht----- Van: Freeradius-Users <freeradius-users-bounces+j.sparla=iolan.com@lists.freeradius.org> Namens Conrad Classen Verzonden: maandag 22 juli 2024 16:19 Aan: freeradius-users@lists.freeradius.org Onderwerp: Importing users and nas clients from the radius files to a mysql database Hi Is there a tool that can be run (Linux Rocky9) to import the freeradius users and the nas clients to a mysql (mariadb) database? If so, please can you point me to it ...-- Conrad - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi Jochem This still leaves me with the need to convert several thousand user records into a csv format which daloradius can import. Either way, the same baseline issue exists. I had a look at the "users2mysql.pl" included in the freeradius source code, however that was designed to be used with freeradius 0.7 and most of the perl script would need to be changed/replaced to work with newer freedaius versions. Many thanks Conrad On 2024/07/23 08:12, Jochem Sparla wrote:
Not specifically from the RADIUS files itself, but you can take a look at DaloRADIUS.
It's a web interface to a (mariadb) database for use with FreeRADIUS. It has import options. Maybe you can modify the RADIUS text files to work with this.
Greetings, Jochem
-----Oorspronkelijk bericht----- Van: Freeradius-Users<freeradius-users-bounces+j.sparla=iolan.com@lists.freeradius.org> Namens Conrad Classen Verzonden: maandag 22 juli 2024 16:19 Aan:freeradius-users@lists.freeradius.org Onderwerp: Importing users and nas clients from the radius files to a mysql database
Hi
Is there a tool that can be run (Linux Rocky9) to import the freeradius users and the nas clients to a mysql (mariadb) database?
If so, please can you point me to it ...--
Conrad - List info/subscribe/unsubscribe? Seehttp://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? Seehttp://www.freeradius.org/list/users.html
Not specifically from the RADIUS files itself, but you can take a look at DaloRADIUS.
It's a web interface to a (mariadb) database for use with FreeRADIUS. It has import options. Maybe you can modify the RADIUS text files to work with this.
Greetings, Jochem
-----Oorspronkelijk bericht----- Van: Freeradius-Users<freeradius-users-bounces+j.sparla=iolan.com@lists.fre eradius.org> Namens Conrad Classen Verzonden: maandag 22 juli 2024 16:19 Aan:freeradius-users@lists.freeradius.org Onderwerp: Importing users and nas clients from the radius files to a mysql database
Hi
Is there a tool that can be run (Linux Rocky9) to import the freeradius users and the nas clients to a mysql (mariadb) database?
If so, please can you point me to it ...--
Conrad - List info/subscribe/unsubscribe? Seehttp://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? Seehttp://www.freeradius.org/list/users.html
Is it really that hard to convert a text file of some format, into a CSV file, using Notepad++ (or any text editor) or even Excel? That would be my go-to plan for something like this, when you have the data in a nice digital format, but it's just not the right format. All it needs is some removal and adding of punctuation marks :-) Greetings, Jochem -----Oorspronkelijk bericht----- Van: Freeradius-Users <freeradius-users-bounces+j.sparla=iolan.com@lists.freeradius.org> Namens Conrad Classen Verzonden: dinsdag 23 juli 2024 12:11 Aan: freeradius-users@lists.freeradius.org Onderwerp: Re: Importing users and nas clients from the radius files to a mysql database Hi Jochem This still leaves me with the need to convert several thousand user records into a csv format which daloradius can import. Either way, the same baseline issue exists. I had a look at the "users2mysql.pl" included in the freeradius source code, however that was designed to be used with freeradius 0.7 and most of the perl script would need to be changed/replaced to work with newer freedaius versions. Many thanks Conrad On 2024/07/23 08:12, Jochem Sparla wrote: - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 23/07/2024 11:10, Conrad Classen wrote:
I had a look at the "users2mysql.pl" included in the freeradius source code, however that was designed to be used with freeradius 0.7 and most of the perl script would need to be changed/replaced to work with newer freedaius versions.
Doesn't look like it would need to be updated that much. The users file format hasn't really changed. Pull requests welcome. But just watch out as the SQL format isn't quite as flexible as the users file. For most cases it'll work fine, but there are some where you can't do as much in SQL, at least not without some tweaking. -- Matthew
On Jul 23, 2024, at 3:10 AM, Conrad Classen <conrad.classen@gmail.com> wrote:
I had a look at the "users2mysql.pl" included in the freeradius source code, however that was designed to be used with freeradius 0.7 and most of the perl script would need to be changed/replaced to work with newer freedaius versions.
So make those changes, and submit the patches back. An Open Source project like FreeRADIUS depends on contributions from the community. i.e. It will only be a short amount of work to fix the script, and then use it to import the "users" file into SQL. After that, submit a PR to fix the script. Or send the updated script to the mailing list. Pretty much any other course of action is more work for you. Plus, contributing back to the community shows that you appreciate the decades of work people put into the software. Alan DeKok.
Hi Alan I have attached the users2mysql.pl file here which I modified. Thanks On 2024/07/23 15:32, Alan DeKok wrote:
On Jul 23, 2024, at 3:10 AM, Conrad Classen<conrad.classen@gmail.com> wrote:
I had a look at the "users2mysql.pl" included in the freeradius source code, however that was designed to be used with freeradius 0.7 and most of the perl script would need to be changed/replaced to work with newer freedaius versions. So make those changes, and submit the patches back.
An Open Source project like FreeRADIUS depends on contributions from the community.
i.e. It will only be a short amount of work to fix the script, and then use it to import the "users" file into SQL. After that, submit a PR to fix the script. Or send the updated script to the mailing list.
Pretty much any other course of action is more work for you. Plus, contributing back to the community shows that you appreciate the decades of work people put into the software.
Alan DeKok.
- List info/subscribe/unsubscribe? Seehttp://www.freeradius.org/list/users.html
participants (4)
-
Alan DeKok -
Conrad Classen -
Jochem Sparla -
Matthew Newton