Page 1 of 1

Count connected user, and do some actions in some cases

Posted: Sun Aug 14, 2005 12:32 am
by mip
I need a help.
I need a script that counts connected users on a specified interface and if it is zero than do an action (disable and enable the interface).
Not so difficult, but I'm close to give it up.
During my fight to make it I ask you to help.
If anyone have time, ability, please help.

Thanks

Peter

Re: Count connected user, and do some actions in some cases

Posted: Sun Aug 14, 2005 1:40 am
by changeip
counts connected users on a specified interface
What do you mean by connected users? hotspot users, tcp connections, entries in the arp table? If you can define what you want to monitor specifically I can probably help.

Sam

Re: Count connected user, and do some actions in some cases

Posted: Sun Aug 14, 2005 9:58 am
by mip
counts connected users on a specified interface
What do you mean by connected users? hotspot users, tcp connections, entries in the arp table? If you can define what you want to monitor specifically I can probably help.

Sam
Sorry. Its a wireless interface (ap mode), and wireless clients.

Posted: Sun Aug 14, 2005 11:45 pm
by mip
I did it. Seems to be good.

Here it is:

:global u
/interface wireless monitor wlan1 once do={
:set u $registered-clients
}
:if ($u = "0") do={
:log message="5213 interface error,
disabled"
/interface wireless dis wlan1
:log message="5213 interface restart"
/interface wireless en wlan1
}

My ap drops all clients and noone can reconnect until disable/enable interface. So I have to monitor number of clients, and if the ap is empty, restart the interface.
The problem exists under 2.8.19 or older versions with ath 5213 chip 2,4GHz. Hope it can be usefull for others too.