Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
#!/usr/bin/perl
#
#
#This script fetch the number of online users in a Freeradius server with mysql module.
#You just have to change login, password, databasename and the ip address of your NAS.
#Omar Armas <oarmas at mpsnet.net.mx>
use DBI;
my $dsn = 'DBI:mysql:radius:localhost';
my $db_user_name = 'username';
my $db_password = 'password';
my $dbh = DBI->connect($dsn, $db_user_name, $db_password) or die "Failed to connect $DBI::errstr\n";
my $sth = $dbh->prepare(qq{
SELECT DISTINCT UserName,AcctStartTime,FramedIPAddress,CallingStationId FROM radacct
WHERE AcctStopTime = '0' AND NASIPAddress = '200.23.1.1' GROUP BY UserName
});
$sth->execute();
print $sth->rows();
exit;
I need to generate statistic graphs for a Radius server.
I would like use your script. Is it possible to obtain your Template - Graph, Data.. and if it's necessary your "Data Input Method"
I used a quick and dirty method to achieve the above. I put a similar perl CGI script on the FreeRADIUS server, and then [following the script-to-graph howto in the Cacti docs] wrote a script to pull down the number of logged in users and graph it. I did it this way because Cacti is running on a host outside the data centre where FreeRADIUS is running. It works well, however now I want to graph the radacct tables, to graph how much data each customer is using...
troffasky wrote: ↑Sun Apr 09, 2006 1:03 pm
I used a quick and dirty method to achieve the above. I put a similar perl CGI script on the FreeRADIUS server, and then [following the script-to-graph howto in the Cacti docs] wrote a script to pull down the number of logged in users and graph it. I did it this way because Cacti is running on a host outside the data centre where FreeRADIUS is running. It works well, however now I want to graph the radacct tables, to graph how much data each customer is using...
Hello, I know this post is very old, but I'm looking for something very similar, to graph radacct tables in order to know how much data each customer is using. I have a VM with freeradius, cacti and chillispot.
Please help me. Thanks.