Community discussions

 
agnostic
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Fri Mar 21, 2014 8:23 pm

lease-hostname lease script variable not working

Sat Aug 10, 2019 1:43 am

hello i put the following script to dhcp lease scripts according to this manual https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server

/tool fetch url=("http://10.10.10.1/add.php?clienthostnam ... easeActMAC")

which is working perfect from server side BUT this weird happens:
at log output window i get mac correctly and as clienthostname i get -hostname which of course is parsed to database as client name and is wrong.
i understand that i must parse variables another way so i try to parse it as follows:

/tool fetch url=("http://10.10.10.1/add.php?clienthostname=" . $lease-hostname . "&mac=" . $leaseActMAC) and it gives me an empty client name but mac address is ok which of course again it parses only mac address on database and leaves hostname empty.
even if i change the order of mac and client name the client name remains empty.

would it be me and the way i use to handle this specific variable or it does not want to give host name?
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1795
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: lease-hostname lease script variable not working

Sat Aug 10, 2019 4:43 am

hey, try $"lease-hostname" instead

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 30 guests