Guys,
can you please help me with script?
I’m trying to achive “if interface doesn’t have valid IP log warning else do some action”
Script that I’m using is like:
:log info "debug 0";
:global iq [/ip address get 2 address];
log info "debug iq - $iq";
If interface 2 is disabled, or DHCP client on interface 2 is disabled the script will log only “debug 0” it will not get to “debug iq”
Similar behavior with this
:if ([:len [/ip address get 2 address]] < 9) do={
:log warn "i am short";
}
The rest of the script is not executed.
When interface is running and DHCP client has IP it works. But I need to check for invalid situation.