Indice   FAQ  
Iscriviti  Login
Indice RouterOS RouterOS

ON event lavorando su cable test

Tutto su questo sistema operativo linux based - Configurazioni, dubbi, problematiche &....

ON event lavorando su cable test

Messaggioda abbio90 » lun 20 ago 2018, 14:08

Buongiorno, mi pare di aver letto da qualche parte che con mikrotik si può arrivare un'evento alla chiusura di una coppia di una porta eth...
Ho trovato uno script online
l'ho impostato così per fare delle prove:



interface ethernet cable-test ether1-acalert once do={
:local cp $"cable-pairs"
:local one [:tostr [:pick $"cable-pairs" 0 1]]
:local two [:tostr [:pick $"cable-pairs" 1 2]]
:local three [:tostr [:pick $"cable-pairs" 2 3]]
:local four [:tostr [:pick $"cable-pairs" 3 4]]

:local status1 [:pick $one 0 4]
:local status2 [:pick $two 0 4]
:local status3 [:pick $three 0 4]
:local status4 [:pick $four 0 4]

:if ( $status1 = "shor" ) do={/interface ethernet enable ether2
:put "1: Circuit closed"

} else={/interface ethernet disable ether2
:put "1: Circuit open"

}


:if ( $status2 = "shor" ) do={/interface ethernet enable ether2
:put "4: Circuit closed"

} else={/interface ethernet disable ether2
:put "2: Circuit open"

}



Ho un cavo sguainato per chiudere e aprire le coppie...l'ho attaccato sulla eth 2

ho fatto uno schedule che va ogni due secondi...

ma che chiudo o apro la coppia non cambia nulla...dove sbaglio???
Scopri https://foisfabio.it - Tutorial sul Network
Avatar utente
abbio90
Mikrotik-Pro 1° Liv
Mikrotik-Pro 1° Liv
 
Messaggi: 536
Iscritto il: lun 26 giu 2017, 19:11
Località: Oristano
Uso routerOS dalla Versione: v4.x
Certificazioni Mikrotik: MTCNA


Torna a RouterOS

Chi c’è in linea

Visitano il forum: Nessuno e 1 ospite