2016-05-12 - Re: Last user…. (MAC based)

Header Data

From: Timothy White <ti***8@gmail.com>
Message Hash: 30bf8637e12086fbb0bc448642f0903f50d3d10d9b165f181f6a603bb569e142
Message ID: <CAESLx0J2XFB+EE6tZj3-VeQFwbpmTr-HtY=w2VGLjcADNjKRwA@mail.gmail.com>
Reply To: <20160512141736.M74473@gids.nl>
UTC Datetime: 2016-05-12 16:18:22 UTC
Raw Date: Fri, 13 May 2016 09:18:22 +1000

Raw message

Hi Paul,
In future post things like this to the list. Others may have already
written scripts that can help you.

3 Months is a tricky time frame. Last login details are in the radpostauth
table. That's cleaned up regularly though, at the 2 month mark I think. So
the next place to look is if there are any entries in the mtotacct table
(something like that, I'm not near the code at the moment). It's the table
that we archive (around the 2 month mark) previous sessions into a single
monthly summary.

So if there are no entries in that table for the last 3 months, and no
entires in the radpostauth table for the last 3 months, then they are
inactive.

Also, not sure why you need the radcomment table to get MAC addresses. The
radcheck table should have all enabled users in it.

If you work out the query you need, I can add it to the nightly cron job,
and make it an option to run it from the admin interface. (Although to mail
you you'd need to update the crontab)

Looking forward to seeing how you go.

Tim

On Fri, May 13, 2016 at 12:29 AM, J.P van Oijen <je***e@gids.nl> wrote:

>
> Hai Tim,
>
> Before going/posting into the mailgroup can I ask you something?
>
> I want to make a cleanup script that automaticaly mails me users that are 3
> months without activity. After that I can delete them keepipng the list
> clean.
>
> My idea was:
>
> - read radius radcomment to get a list of all current MAC addresses
> allowed (I
> use only mac addresses for users)
>
> - And than search for that MAC address for the last access / succesful
> login
>
> Would that be working as I have troubles finding that last successful login
> date / last access.
>
> Maybe you can provide a hint...
>
> Chrs Paul
>
>
>
>

Thread