I am a newbie in Mikrotik scritpting and just learning the ropes right now. I have a script that works correctly but I need to put a where statement in this script to not run where it detects an agent remote id field.
the current script is :
Code: Select all
/ip dhcp-server lease
:foreach dhcplease in=[find] do={
:local dhcpip [get $dhcplease address]
:local dhcpmac [get $dhcplease mac-address]
:put $dhcpmac
:put $dhcpip
:do { /tool fetch url="https://$url/api/v1/network/ipam/dynamic_ip_assignment?ip_address=$dhcpip&mac_address=$dhcpmac" mode=https keep-result=yes user=$username password=$password } on-error={} ;
}
Thanks