Community discussions

MikroTik App
 
Niex
newbie
Topic Author
Posts: 42
Joined: Sat Jun 23, 2012 7:12 pm

Script for reboot based on wireless clients

Mon Jun 22, 2015 8:54 pm

Needs a script to reboot a Omnitik when registered clients = 0 on wlan interfaces e ou virtual ssid´s.
Thanks in advance
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Script for reboot based on wireless clients

Tue Jun 23, 2015 3:35 pm

And what? I see easier to check the interface status as the interface doesn't report running state when no clients connected. It's quite similar. So what problem do you have with your script?
 
wcsnet
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Mon Apr 29, 2013 12:43 pm
Location: South Africa

Script for reboot based on wireless clients

Tue Jun 23, 2015 6:49 pm

Dude of no one replies send me a mail ill write it for you when i have some time you can then come post it here werner.venter.mail@gmail.com.


Sent from my iPhone using Tapatalk
 
Niex
newbie
Topic Author
Posts: 42
Joined: Sat Jun 23, 2012 7:12 pm

Re: Script for reboot based on wireless clients

Fri Oct 02, 2015 11:30 pm

:local clientes [/interface wireless registration-table print count-only];
:local WarnAt 0

#:log info ($clientes);

:if ($clientes <= $WarnAt) do={
#:log info ($clientes);
/system reboot
}
 
n21roadie
Forum Guru
Forum Guru
Posts: 1949
Joined: Fri Aug 07, 2009 10:36 pm
Location: Limerick,Ireland

Re: Script for reboot based on wireless clients

Sat Oct 03, 2015 4:21 pm

:local clientes [/interface wireless registration-table print count-only];
:local WarnAt 0

#:log info ($clientes);

:if ($clientes <= $WarnAt) do={
#:log info ($clientes);
/system reboot
}
But what happens on reboot > before clients can register script runs and reboot again > on reboot >repeat loop

Put in a delay of say 5mins on the scheduler after router reboots to allow for clients to register before script becomes active ?
 
User avatar
mousa1983
Frequent Visitor
Frequent Visitor
Posts: 75
Joined: Mon Apr 21, 2014 2:36 pm
Location: ilam-iran

Re: Script for reboot based on wireless clients

Sat Oct 03, 2015 9:08 pm

Why you need to Reboot?
what is problem?
 
Niex
newbie
Topic Author
Posts: 42
Joined: Sat Jun 23, 2012 7:12 pm

Re: Script for reboot based on wireless clients

Wed Dec 09, 2015 2:49 pm

All clients are disconected and not concect anymore.
 
p3rad0x
Long time Member
Long time Member
Posts: 640
Joined: Fri Sep 18, 2015 5:42 pm
Location: South Africa
Contact:

Re: Script for reboot based on wireless clients

Tue Jan 05, 2016 3:29 pm

What do you see in the omnitiks log file when the clients drop?
 
User avatar
NetHorror
just joined
Posts: 22
Joined: Fri Dec 06, 2013 8:12 am

Re: Script for reboot based on wireless clients

Mon May 23, 2016 10:04 pm

:local clientes [/interface wireless registration-table print count-only];
:local WarnAt 0

#:log info ($clientes);

:if ($clientes <= $WarnAt) do={
#:log info ($clientes);
/system reboot
}
many thanks :)
 
a7mad78
just joined
Posts: 2
Joined: Tue Aug 09, 2016 9:25 am

Re: Script for reboot based on wireless clients

Tue Aug 09, 2016 9:30 am

:local clientes [/interface wireless registration-table print count-only];
:local WarnAt 0

#:log info ($clientes);

:if ($clientes <= $WarnAt) do={
#:log info ($clientes);
/system reboot
}
But what happens on reboot > before clients can register script runs and reboot again > on reboot >repeat loop

Put in a delay of say 5mins on the scheduler after router reboots to allow for clients to register before script becomes active ?
Great but how i can make it reboot when
there are 0 active users in the hotspot ?

i tried to do some adjustments but it didn't work firstly ,
second i don't have a good skills in programming :)

this is how i made my adjustments

:local clientes [/ip hotspot active-table print count-only];
:local WarnAt 1

#:log info ($clientes);

:if ($clientes <= $WarnAt) do={
#:log info ($clientes);
/system reboot
}
i want to make the mt reboot when the active users reaches 0
i think i have a mistake in the first lane :) but i don't how i can correct it

Thx,, <3
 
a7mad78
just joined
Posts: 2
Joined: Tue Aug 09, 2016 9:25 am

Re: Script for reboot based on wireless clients

Tue Aug 09, 2016 9:35 am

Oh, never mind :)

my problem was actually in the first line :)

i edited it
from
:local clientes [/ip hotspot active-table print count-only];
to
:local clientes [/ip hotspot active-table print count-only];

and do i have to run this script after every reboot or it will still running ?

Who is online

Users browsing this forum: GoogleOther [Bot], karlacio, ShhPub and 21 guests