RoS 7.15 broke a DHCP script
Posted: Sat Jun 01, 2024 11:03 pm
Hello,
I am using a script that is run on each lease change and it worked quite well up until 7.15. It tries to get the MAC vendor from the lease MAC and set it as a comment.
I am unable to find anything in the changelog pertaining to this issue.
The only thing I can see is, but I cannot set any permission for the script on DHCP server.
The script:
The error:
Anyone knows about a 7.15 change that might stop this script from running properly? As in why the error, as the MAC is obtained and inserted in the comment.
later edit: it seems creating a separate script and calling the script from the DHCP server instead of running the whole script there got rid of the error.
Thank you
I am using a script that is run on each lease change and it worked quite well up until 7.15. It tries to get the MAC vendor from the lease MAC and set it as a comment.
I am unable to find anything in the changelog pertaining to this issue.
The only thing I can see is
Code: Select all
fetch - changed topic "info" to "error" for permission denied logs;
The script:
Code: Select all
:log info ( . "Hostname: " . ([/ip dhcp-server lease get [find active-address=$leaseActIP] host-name]))
if ($leaseBound =1) do={
local result ([/tool fetch url=("https://api.macvendors.com/".$leaseActMAC) output=user as-value ])
if ($result->"status" = "finished") do={
local comment0 ("MAC Vendor: ".$result->"data")
ip dhcp-server lease set [find mac-address=$leaseActMAC dynamic=yes] comment=$comment0
}
}
Code: Select all
executing script from dhcp failed, please check it manually
later edit: it seems creating a separate script and calling the script from the DHCP server instead of running the whole script there got rid of the error.
Thank you