Community discussions

MikroTik App
 
User avatar
astounding
Member Candidate
Member Candidate
Topic Author
Posts: 121
Joined: Tue Dec 16, 2008 12:17 am

Missing DHCP lease comment in API response in 3.27 (bug?)

Wed Jul 22, 2009 11:45 pm

I have a script for synchronizing static DHCP configurations on Mikrotik APs with an internal database that uses the API /ip/dhcp-server/lease/getall to check the AP's current DHCP state.

When running version 3.23, the comment field (in which I store a human-readable account ID so I know to whom the lease belongs when I'm logged into the AP via telnet/ssh/winbox) the API returns things just fine:
1	"!re"	=	null
2	".id"	=	"*1"
3	"comment"	=	"Joe User Account 4567"
4	"address"	=	"10.0.0.55"
5	"mac-address"	=	"DE:AD:BE:EF:00:11"
6	"status"	=	"bound"
7	"expires-after"	=	"00:41:30"
8	"active-address"	=	"10.0.0.55"
9	"active-mac-address"	=	"DE:AD:BE:EF:00:11"
10	"active-client-id"	=	"1:DE:AD:BE:EF:00:11"
11	"active-server"	=	"dhcp-server"
12	"host-name"	=	"MyMikroTikAP"
13	"disabled"	=	"false"
14	"radius"	=	"false"
15	"dynamic"	=	"false"
16	"blocked"	=	"false"

1	"!done"	=	null
However when I perform the same query on an AP running version 3.27, "getall" does NOT return the comment field, even when properly set:
1	"!re"	=	null
2	".id"	=	"*1"
3	"address"	=	"10.1.0.33"
4	"mac-address"	=	"FE:ED:BE:AD:51:73"
5	"disabled"	=	"false"
6	"radius"	=	"false"
7	"dynamic"	=	"false"
8	"blocked"	=	"false"

1	"!done"	=	null
Is this a bug in 3.27? It doesn't matter whether or not the lease is bound/active or not, the result is the same, in 3.27 the comment field is missing.

Wondering,
Aaron out
 
User avatar
astounding
Member Candidate
Member Candidate
Topic Author
Posts: 121
Joined: Tue Dec 16, 2008 12:17 am

Re: Missing DHCP lease comment in API response in 3.27 (bug?)

Thu Jul 23, 2009 12:20 am

Also note that including "comment" in .proplist and doing the getall query still fails to include the comment field in the output.
 
User avatar
astounding
Member Candidate
Member Candidate
Topic Author
Posts: 121
Joined: Tue Dec 16, 2008 12:17 am

Re: Missing DHCP lease comment in API response in 3.27 (bug?)

Thu Jul 23, 2009 12:24 am

Fortunately filtering DOES appear to work based on the comment. For example:
/ip/dhcp-server/getall
?comment="Jane Doe account 12345"
The above API query would in fact return the correct record, but again, the comment field would be missing.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Missing DHCP lease comment in API response in 3.27 (bug?)

Thu Jul 23, 2009 2:09 pm

comments will appear in next release
 
User avatar
astounding
Member Candidate
Member Candidate
Topic Author
Posts: 121
Joined: Tue Dec 16, 2008 12:17 am

Re: Missing DHCP lease comment in API response in 3.27 (bug?)

Mon Aug 17, 2009 8:14 pm

Thank you very much! 3.28 fixes the problem for /ip/dhcp-server/lease/getall (and print) and also for /interface/wireless/access-list/getall (and print).

Who is online

Users browsing this forum: No registered users and 21 guests