My upstream (comindico/Soul) do not allow me to query the nas's via any method SNMP or finger. What happens is I get a dropped packet occasionally which may be a disconnect but of course I never receive it full, hence the user is still shown as online on the SQL backend. 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? Or if you have an alternative solution please let me know. Thanks Cory
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. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
Further investigations into this make me believe an alternative session script function ability is required. Currently when you click on the stale sessions link within dialup admin it just removes that record entirely. Now with My upstream provider I get accounting updates every 15 mins so the best method would be to get the start date add the last session online time and complete the stop record based on that. If there is no session time then wipe the record. If the sql script was independent then for people like me who have a max session time set for 8 hrs I could check for sessions supposedly online for more than that period and run a cron to run the script every hour or so. Just a thought -----Original Message----- From: freeradius-users-bounces+cory=cmi.net.au@lists.freeradius.org [mailto:freeradius-users-bounces+cory=cmi.net.au@lists.freeradius.org] On Behalf Of Alan DeKok Sent: Thursday, 21 December 2006 12:42 PM To: FreeRadius users mailing list Subject: Re: Stale session problem 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. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html __________ NOD32 1932 (20061220) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com
I would be very interested in this. We had some downtime on a 30 concurrent user test server because IPs had gotten "lost" in accounting, eg the NAS hadn't sent an accounting-stop so the IP was never added back to the pool. Preventing this from happening automatically would be very useful (having the script produce a usable output to a logfile or sql would be even handier, so we can see just where the IPs are "leaking"). Thanks, Jan Mulders On 16/01/07, Cory Robson <cory@cmi.net.au> wrote:
Further investigations into this make me believe an alternative session script function ability is required.
Currently when you click on the stale sessions link within dialup admin it just removes that record entirely.
Now with My upstream provider I get accounting updates every 15 mins so the best method would be to get the start date add the last session online time and complete the stop record based on that. If there is no session time then wipe the record.
If the sql script was independent then for people like me who have a max session time set for 8 hrs I could check for sessions supposedly online for more than that period and run a cron to run the script every hour or so.
Just a thought
-----Original Message----- From: freeradius-users-bounces+cory=cmi.net.au@lists.freeradius.org [mailto:freeradius-users-bounces+cory=cmi.net.au@lists.freeradius.org] On Behalf Of Alan DeKok Sent: Thursday, 21 December 2006 12:42 PM To: FreeRadius users mailing list Subject: Re: Stale session problem
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.
Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
__________ NOD32 1932 (20061220) Information __________
This message was checked by NOD32 antivirus system. http://www.eset.com
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Jan Mulders wrote:
I would be very interested in this. We had some downtime on a 30 concurrent user test server because IPs had gotten "lost" in accounting, eg the NAS hadn't sent an accounting-stop so the IP was never added back to the pool. Preventing this from happening automatically would be very useful (having the script produce a usable output to a logfile or sql would be even handier, so we can see just where the IPs are "leaking").
The server could really use a little better handling of stale sessions. For example, if Session-Timeout is set to an hour, then you're pretty sure that after an hour or so, the user isn't online any more. (This doesn't work for some NASes, of course...) The server tries to do this right now by looking at NAS reboots and logins from the same NAS port. But some NASes don't send reboot messages, and some don't send NAS port, or always send the same information for NAS port. It's difficult to do this correctly in a way that's robust. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
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 the 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 radius -f /etc/radsql/drop_unkowns.sql' # cat /etc/radsql/drop_unkowns.sql UPDATE radacct SET acctstoptime = acctstarttime, acctsessiontime = 0 WHERE acctstoptime IS NULL AND (now() - acctstarttime) > '23 hour'::interval AND acctsessiontime IS NULL; UPDATE radacct SET acctstoptime = (acctstarttime + acctsessiontime::text::interval) WHERE acctstoptime IS NULL AND (now() - acctstarttime - acctsessiontime::text::interval) > '1 hour'::interval ; Just adjust it to suit your needs... -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc
participants (4)
-
Alan DeKok -
Cory Robson -
Jan Mulders -
Peter Nixon