This is a discussion on Re: Stale session problem within the FreeRADIUS Users forums, part of the Networking and Network Related category; --===============0967721942== Content-Type: multipart/signed; boundary="nextPart1942910.B3CAy1XUy0"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============0967721942==
Content-Type: multipart/signed; boundary="nextPart1942910.B3CAy1XUy0"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1942910.B3CAy1XUy0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thu 21 Dec 2006 05:41, Alan DeKok wrote: > Cory Robson wrote: > > Has anyone written a script or event process to monitor the update > > packets against the users apparently online and in the event that no > > update is received in a 20 min period (my updates are every 15 mins from > > the NAS) create a close session event? > > I don't think one has been written, but it shouldn't be too hard to > write something that does the proper SQL SELECTs. > > If you do write one, *please* submit it back, and we'll include it in > the next release This is so trivial to do that I am surprised that it takes up a thread on t= he=20 mailing list :-) We run the following from cron: # crontab -l 0 23 * * * /usr/local/bin/radcleanunknowns # cat /usr/local/bin/radcleanunknowns #!/bin/sh /bin/su postgres -c 'cd ~ && echo "" && psql -d=20 radius -f /etc/radsql/drop_unkowns.sql' # cat /etc/radsql/drop_unkowns.sql UPDATE radacct SET acctstoptime =3D acctstarttime, acctsessiontime =3D 0 WH= ERE=20 acctstoptime IS NULL AND (now() - acctstarttime) > '23 hour'::interval AND= =20 acctsessiontime IS NULL; UPDATE radacct SET acctstoptime =3D (acctstarttime +=20 acctsessiontime::text::interval) WHERE acctstoptime IS NULL AND (now() -=20 acctstarttime - acctsessiontime::text::interval) > '1 hour'::interval ; Just adjust it to suit your needs... =2D-=20 Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc --nextPart1942910.B3CAy1XUy0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFrPU3AcdsUt9pJjwRAqg4AKDN2es+kVNB5blJTrtQoc G8NnykqgCeKJfj vmZqNlVWbMuzaRS+pjHoU2U= =7M3k -----END PGP SIGNATURE----- --nextPart1942910.B3CAy1XUy0-- --===============0967721942== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html --===============0967721942==-- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|