Skript kontroly queues a dhcp serveru: Porovnání verzí

Z Wiki UnArt Slavičín
Skočit na navigaciSkočit na vyhledávání
Bez shrnutí editace
Bez shrnutí editace
Řádek 5: Řádek 5:
  :global ip
  :global ip
  :global found
  :global found
:foreach ip in=[/ip dhcp-server lease find] do={
  :set found 0
   
   
:set found 0
  :foreach i in=[/queue simple find parent=$parent] do={  
:set ip "10.143.230.125"
    :if ([:find [/queue simple get $i target-addresses] ([/ip dhcp-server lease get $ip address]."/32")]!=0) do={
:foreach i in=[/queue simple find parent=$parent] do={  
      :set found 1
  :if ([:find [/queue simple get $i target-addresses] ($ip."/32")]!=0) do={
    }
      :set found 1
   }
   }
  :put $found
  }
  }
:put $found

Verze z 10. 2. 2012, 10:59

# Omezeni queues na parent, bez omezeni nechte hodnotu "none"
:global parent "none"

# Pomocne promenne
:global ip
:global found
:foreach ip in=[/ip dhcp-server lease find] do={
  :set found 0

  :foreach i in=[/queue simple find parent=$parent] do={ 
    :if ([:find [/queue simple get $i target-addresses] ([/ip dhcp-server lease get $ip address]."/32")]!=0) do={
      :set found 1
    }
  }
  :put $found
}