Reporting on active users using radwho
Over the last week, I’ve spent some time getting radsniff telemetry into Grafana via Collectd and Telegraf. Sadly radsniff direct to Telegraf doesn’t work, but that’s another story. Wanting to graph online users I then scripted a rough little bit of bash to take the output of `radwho -r -n` and output the number of active users in influx format to Telegraf. However I’ve noticed that at midnight the reported online users drop to 0 to then slowly ramp up again. This may well be normal behaviour for what I should expect from rad who output, but it’s not what I’d like to see in my graph, it’s worrying to see the number of active xDSL subscribers drop to 0. I’d rather avoid having to state such a caveat. Is there a better way to track active users using the data available from FreeRADIUS server, its tools or directly from the (MySQL) database? — Thanks, Djerk Geurts
On May 12, 2022, at 7:00 AM, Djerk Geurts via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Over the last week, I’ve spent some time getting radsniff telemetry into Grafana via Collectd and Telegraf. Sadly radsniff direct to Telegraf doesn’t work, but that’s another story.
There's also the stats produced by the server. See "radmin stats" for more information. The data is also available via Status-Server packets. See raddb/sites-available/status.
Wanting to graph online users I then scripted a rough little bit of bash to take the output of `radwho -r -n` and output the number of active users in influx format to Telegraf. However I’ve noticed that at midnight the reported online users drop to 0 to then slowly ramp up again. This may well be normal behaviour for what I should expect from rad who output, but it’s not what I’d like to see in my graph, it’s worrying to see the number of active xDSL subscribers drop to 0. I’d rather avoid having to state such a caveat.
Is there a better way to track active users using the data available from FreeRADIUS server, its tools or directly from the (MySQL) database?
Put accounting data into SQL. Then, count the number of rows which don't have a "stop time". Alan DeKok.
On 12 May 2022, at 12:15, Alan DeKok <aland@deployingradius.com> wrote:
On May 12, 2022, at 7:00 AM, Djerk Geurts via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Over the last week, I’ve spent some time getting radsniff telemetry into Grafana via Collectd and Telegraf. Sadly radsniff direct to Telegraf doesn’t work, but that’s another story.
There's also the stats produced by the server. See "radmin stats" for more information. The data is also available via Status-Server packets. See raddb/sites-available/status.
I wasn’t able to figure out how to get the number of active users out of admin stats, but that’s likely me being stupid. I enabled it and played around and quickly figured that a MySQL query to the redact table would be easier.
Wanting to graph online users I then scripted a rough little bit of bash to take the output of `radwho -r -n` and output the number of active users in influx format to Telegraf. However I’ve noticed that at midnight the reported online users drop to 0 to then slowly ramp up again. This may well be normal behaviour for what I should expect from rad who output, but it’s not what I’d like to see in my graph, it’s worrying to see the number of active xDSL subscribers drop to 0. I’d rather avoid having to state such a caveat.
Is there a better way to track active users using the data available from FreeRADIUS server, its tools or directly from the (MySQL) database?
Put accounting data into SQL. Then, count the number of rows which don't have a "stop time".
Accounting was already set up, so all I had to do was to figure out the SQL queries and wrap that in a little code. This works perfect and is quick and reliable. Initially I had planned to report active users per Radius server, but this detail isn’t in the redacts table and would be unreliable as one server may auth and another may get the acct data. Plus radsniff gives me access requests, rejects and response times per server, so I don’t have a need to replicate this in a report about active subscribers. @Alan Thank you for your help, much appreciated! Djerk Geurts
On May 13, 2022, at 4:56 AM, Djerk Geurts via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
I wasn’t able to figure out how to get the number of active users out of admin stats, but that’s likely me being stupid.
No, it's not supported. You can do "help" at various points with radmin, and it will tell you which commands are allowed.
I enabled it and played around and quickly figured that a MySQL query to the redact table would be easier.
Yes. We're looking at adding sample stats queries to SQL, and then somehow tying that to radmin. But it takes a bit of thinking to get it done correctly.
Accounting was already set up, so all I had to do was to figure out the SQL queries and wrap that in a little code. This works perfect and is quick and reliable.
Excellent.
Initially I had planned to report active users per Radius server, but this detail isn’t in the redacts table and would be unreliable as one server may auth and another may get the acct data. Plus radsniff gives me access requests, rejects and response times per server, so I don’t have a need to replicate this in a report about active subscribers.
Yes, users aren't logged in to a "RADIUS server". Especially if you have many servers. Users are logged into your network. And all of the login information should be stored in one database.
@Alan Thank you for your help, much appreciated!
You're welcome. Alan DeKok.
@Djerk: For curiosity's sake, are your users wired or wireless connected ? Le jeu. 12 mai 2022 à 13:00, Djerk Geurts via Freeradius-Users <freeradius-users@lists.freeradius.org> a écrit :
Over the last week, I’ve spent some time getting radsniff telemetry into Grafana via Collectd and Telegraf. Sadly radsniff direct to Telegraf doesn’t work, but that’s another story.
Wanting to graph online users I then scripted a rough little bit of bash to take the output of `radwho -r -n` and output the number of active users in influx format to Telegraf. However I’ve noticed that at midnight the reported online users drop to 0 to then slowly ramp up again. This may well be normal behaviour for what I should expect from rad who output, but it’s not what I’d like to see in my graph, it’s worrying to see the number of active xDSL subscribers drop to 0. I’d rather avoid having to state such a caveat.
Is there a better way to track active users using the data available from FreeRADIUS server, its tools or directly from the (MySQL) database?
— Thanks, Djerk Geurts - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
@Olivier, Wired, they're xDSL PPPoE users. On 16 May 2022, 17:50, at 17:50, Olivier <oza.4h07@gmail.com> wrote:
@Djerk: For curiosity's sake, are your users wired or wireless connected ?
Le jeu. 12 mai 2022 à 13:00, Djerk Geurts via Freeradius-Users <freeradius-users@lists.freeradius.org> a écrit :
Over the last week, I’ve spent some time getting radsniff telemetry
into Grafana via Collectd and Telegraf. Sadly radsniff direct to Telegraf doesn’t work, but that’s another story.
Wanting to graph online users I then scripted a rough little bit of
bash to take the output of `radwho -r -n` and output the number of active users in influx format to Telegraf. However I’ve noticed that at midnight the reported online users drop to 0 to then slowly ramp up again. This may well be normal behaviour for what I should expect from rad who output, but it’s not what I’d like to see in my graph, it’s worrying to see the number of active xDSL subscribers drop to 0. I’d rather avoid having to state such a caveat.
Is there a better way to track active users using the data available
from FreeRADIUS server, its tools or directly from the (MySQL) database?
— Thanks, Djerk Geurts - List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
Djerk Geurts -
Olivier