Hi,
I write a script for know how many ips has a single MAC. But every iteration take 3-4 seconds in my core.
Why?? I have 3000 macs, and the script take 2 hours
:log info "Start"
#1
:foreach i in=[/ip arp find disabled=no] do={
:local MacNull "00:00:00:00:00:00"
:local Mac "00:00:00:00:00:00"
:local LenMac 0
:local NumIPs 0
:local IP "0.0.0.0"
set Mac [/ip arp get $i mac-address]
set LenMac [:len [$Mac]]
#2
if ( $LenMac > 0 and $Mac != $MacNull) do={
:set NumIPs [/ip arp print count-only where mac-address=$Mac]
#3
if ( $NumIPs > 1) do={
:log warning "MAC:$Mac has $NumIPs IPs"
#3
}
#2
}
#1
}
:log info "Endt"