[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gnu-radius] Keepalive Packets confusion
From: |
Sergey Poznyakoff |
Subject: |
Re: [Help-gnu-radius] Keepalive Packets confusion |
Date: |
Fri, 02 May 2003 12:03:16 +0300 |
> So my question is say if the user does go off line and radius misses the
> stop packet. How does the keepalive packet not coming change the user's
> status to 2? It appears to me that the user status value is stuck at 1..
You are right, it won't change unless the stop record
arrives. It is possible to modify the acct_start_query in such a way
that it would mark the stuck entries, however I didn't try to do
so.
Another approach is based on the fact that upon the next successful
login, radiusd will close the hung entry in radutmp and radwtmp. That
can be used to track the missing stops. Attached is the script that computes
the difference between the actual state of radutmp and that of the
calls table. I run it as a daily cron job.
Regards,
Sergey
#! /bin/sh
MYSQL="mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASSWORD -P$MYSQL_PORT"
ONLINE=/tmp/online.$$
ONLINE_SQL="${ONLINE}.sql"
ONLINE_RAD="${ONLINE}.rad"
# Compare online info from SQL against that of radwho
$MYSQL -B \
-e'select user_name,acct_session_id from calls where status=1;' $MYSQL_DB |
sed -e '1d' | sort +0 -1 > $ONLINE_SQL
radwho -o 'login:32,sid:32' | sed -e '1d' | sort +0 -1 > $ONLINE_RAD
echo "radwho -- MYSQL online diffs:"
diff -bBw $ONLINE_SQL $ONLINE_RAD | sed -ne '/^[<>].*/p'
rm -r $ONLINE_SQL $ONLINE_RAD
- Re: [Help-gnu-radius] Keepalive Packets confusion,
Sergey Poznyakoff <=