En radgroupreply
73 | 12H | Acct-Interim-Interval | := | 60 | |||||
74 | 12H | WISPr-Bandwidth-Max-Up | := | 32000 | |||||
75 | 12H | WISPr-Bandwidth-Max-Down | := | 512000 | |||||
76 | 12H | Idle-Timeout | := | 180 | |||||
77 | 12H | Session-Timeout | := | 43200 |
editar /etc/mysql/my.cnf
[mysql]
user=root
password=elpassword
luego hacer un script para ejecutar las querys
#!/bin/bash
`mysql radiuspt -e "delete from radcheck where username in (select username from radacct where acctterminatecause='Session-Timeout')"`
`mysql radiuspt -e "delete from radusergroup where username in (select username from radacct where acctterminatecause='Session-Timeout')"`
y colocar un cron que ejecute el script cada cierto tiempo para borrar los usuarios de las tablas radcheck y en radusergroup para limpiar
Consultas:
delete from radcheck where username in (select username from radacct where acctterminatecause='Session-Timeout');
delete from radusergroup where username in (select username from radacct where acctterminatecause='Session-Timeout');
Consulta para borrar usuarios a los que se les ha caducado el ticket o voucher
mysql> select username,timediff(now(),acctstarttime) resta from radacct;
select username,timediff(now(),acctstarttime) from radacct where timediff(now(),acctstarttime) between '00:00:01' and '12:00:00';
root@radiuspt:/etc/cron.d# cat /etc/freeradius/delete_expired.sh
#!/bin/bash
`mysql radiuspt -e "delete from radcheck where username in (select username from radacct where acctterminatecause='Session-Timeout')"`
`mysql radiuspt -e "delete from radusergroup where username in (select username from radacct where acctterminatecause='Session-Timeout')"`
`mysql radiuspt -e "delete from radcheck where username in (select username from radacct where timediff(now(),acctstarttime) between '00:00:01' and '12:00:00')"`
`mysql radiuspt -e "delete from radcheck where username in (select username from radacct where timediff(now(),acctstarttime) between '00:00:01' and '12:00:00')"`
No hay comentarios:
Publicar un comentario