Community discussions

MikroTik App
 
krtko
just joined
Topic Author
Posts: 6
Joined: Thu Jan 15, 2009 8:17 am

automatic clear of status busy in dhcp server

Thu Jan 15, 2009 8:30 am

hello,

i use mikrotik 3.x for dhcp server with static leases, sometimes i get status busy on some static entries, i tryed this script to check and repair it, but it does not work for me
/ip dhcp-server lease;
:foreach i in=[/ip dhcp-server lease find status=busy]\ 
do={
:log error ("Busy status detected: " . [/ip dhcp-server lease get $i address]);
/ip dhcp-server lease disable $i;
/ip dhcp-server lease enable $i;
}
script do not find any busy status in static lease list.

thanks for any idea.

BR
krtko
 
kryseck
just joined
Posts: 1
Joined: Fri Jun 16, 2006 6:46 am

Re: automatic clear of status busy in dhcp server

Wed Feb 25, 2009 12:30 pm

Hi!
Revome 1ª line "/ip dhcp-server lease;" .
 
marek001
newbie
Posts: 30
Joined: Tue May 30, 2006 6:14 pm

Re: automatic clear of status busy in dhcp server

Mon Mar 02, 2009 1:26 am

Hi!
Revome 1ª line "/ip dhcp-server lease;" .

:foreach i in=[/ip dhcp-server lease find status=busy]\
do={
:log error ("Busy status detected: " . [/ip dhcp-server lease get $i address]);
/ip dhcp-server lease disable $i;
/ip dhcp-server lease enable $i;
}

is this right??

i have tried it but it wont work....

tnx
bye
 
lukasPL
just joined
Posts: 1
Joined: Fri Feb 20, 2009 10:29 pm

Re: automatic clear of status busy in dhcp server

Fri Mar 06, 2009 12:09 am

Try to use quotation marks "busy"

:foreach i in=[/ip dhcp-server lease find status="busy"]\
do={
:log error ("Busy status detected: " . [/ip dhcp-server lease get $i address]);
/ip dhcp-server lease disable $i;
/ip dhcp-server lease enable $i;
}

or simply like I do

:foreach i in=[/ip dhcp-server lease find status="busy"]\
do={
:log error ("Busy status detected: " . [/ip dhcp-server lease get $i address]);
/ip dhcp-server lease check-status $i;
}
 
marek001
newbie
Posts: 30
Joined: Tue May 30, 2006 6:14 pm

Re: automatic clear of status busy in dhcp server

Fri Mar 06, 2009 5:39 pm

Try to use quotation marks "busy"

:foreach i in=[/ip dhcp-server lease find status="busy"]\
do={
:log error ("Busy status detected: " . [/ip dhcp-server lease get $i address]);
/ip dhcp-server lease disable $i;
/ip dhcp-server lease enable $i;
}

or simply like I do

:foreach i in=[/ip dhcp-server lease find status="busy"]\
do={
:log error ("Busy status detected: " . [/ip dhcp-server lease get $i address]);
/ip dhcp-server lease check-status $i;
}

tnx for the answer...now the script is working but i will first test it when some lesses are busy..

you'r script is not god for me...because i don't have someone to look everyday the log-file...

tnx
bye
 
COELPL
just joined
Posts: 22
Joined: Wed Aug 15, 2007 10:16 pm

Re: automatic clear of status busy in dhcp server

Wed May 12, 2010 11:34 am

I had the same issue.

At my network problem solved... One of Mikrotik's had PROXY-ARP on ether2 and when host trying to get IP from DHCP (static leases in my case) he thinks that this specific IP is already used.

DISABLE PROXY-ARP on every MT.
 
rzirzi
Member
Member
Posts: 398
Joined: Mon Oct 09, 2006 2:33 pm

Re: automatic clear of status busy in dhcp server

Sat May 15, 2010 7:07 pm

:foreach i in=[/ip dhcp-server lease find status="busy"]\
do={
:log error ("Busy status detected: " . [/ip dhcp-server lease get $i address]);
/ip dhcp-server lease check-status $i;
}
Why it does not work on my MT3.30?
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: automatic clear of status busy in dhcp server

Mon May 17, 2010 10:52 am

there are slight syntax changes between version 3 and 4.

best shot is, in console open script editor and paste script there, use F5 to refresh mark-up of text. After error there should not be any mark-up.
 
petrushka
Frequent Visitor
Frequent Visitor
Posts: 54
Joined: Mon May 10, 2010 12:25 pm

Re: automatic clear of status busy in dhcp server

Thu Sep 15, 2011 4:19 pm

Thanks !!! Script works perfect!
:foreach i in=[/ip dhcp-server lease find status="busy"]\
do={
:log error ("Busy status detected: " . [/ip dhcp-server lease get $i address]);
/ip dhcp-server lease check-status $i;
/ip dhcp-server lease disable $i;
/ip dhcp-server lease enable $i;
}
I added it to a scheduler once per hour. And it works without my attention :)