cgrandinets wrote: ↑
Wed May 22, 2019 7:58 pm
I am looking for some assistance with a request I've received. I am running a PiNet server with ~10 Raspberry Pi fat clients connecting to it. I need two things:
1. The total number of logins/sessions opened to the PiNet server in the last 30 days
2. The time that those sessions remained logged in for
From what I can tell, there is no vanilla way to achieve this, I am running Ubuntu 16.04 as the PiNet Server. So, are there any PiNet or LTSP addons that will allow me to gather data like that? Or possibly a way to pull it from the log files?
So this is an interesting one, not one I have had before (and I have had a heck of a lot of odd requests for PiNet).
I am not aware of any way with LTSP and can confirm PiNet doesn't include anything for this, especially given there is no real use case I am aware of for this in a classroom setup.
Without being in front of a PiNet server currently, one potential way you could look at is the /var/log/auth.log file, as each login to a PiNet client kicks off a SSH connection to the main server.
You could probably also take a look at the last command, as it allows you to see login history data.
Perhaps someone else with a little more expertise in general bash filtering etc could help with this, the key is there is nothing special around how PiNet clients log in, it is simply an SSH connection to the main server.
Lead developer of PiNet, a free and opensource centralised user accounts and file storage system for Raspberry Pi classrooms used in over 200 schools across the world.