Author |
Message |
|
Post subject: Skript, po urcitom pocte stratenych pingov prepnutie na iny
Posted: 01.11.2010 - 18:41 #85953
|
|
Majster
Joined: Júl 11, 2008
Posts: 2311
|
|
Vedel by mi niekto pomoct s vytvorenim skriptu pre routeros, ktory by pingoval urcitu ip(sam si zadam), alebo by akosi vyuzival netwatch a po urcitom pocte stratenych pingov(napr. 5), by prepol na iny kanal, ktory si sam preddefinujem. Vdaka |
|
|
|
|
![](./modules/PNphpBB2/templates/PNTheme/images/spacer.gif) |
|
Post subject: RE: Skript, po urcitom pocte stratenych pingov prepnutie na iny
Posted: 01.11.2010 - 19:07 #85954
|
|
Majster
Joined: Júl 11, 2008
Posts: 2311
|
|
Code: › :local ip
:local count
###############################################
### nastavenie parametrov scriptu ###
# IP adresa zariadenia v uvodzovkach
:set ip "192.168.1.1"
# pocet pingov
:set count 5
###############################################
# definicia globalnych premennych
:global status
# nastavenie pracovneho adresara
#/
:if ([/ping $ip count=$count] = 0) \
do {
/interface wireless set wlan1 frequency=2417
}
# koniec scriptu
Podarilo sa mi zatial spravit len toto, lenze to funguje tak ze posle 5 pingov, na ktore ak nepride odpoved na danu ip prepne sa na preddefinovany kanal. Lenze takto by som musil ten skript pustat dost casto. Nevedel by niekto o elegantnejsom rieseni? |
|
|
|
|
![](./modules/PNphpBB2/templates/PNTheme/images/spacer.gif) |
|
Post subject: RE: Skript, po urcitom pocte stratenych pingov prepnutie na iny
Posted: 01.11.2010 - 20:44 #85955
|
|
Majster
![](./images/avatar/cunt.gif)
Joined: Jan 08, 2006
Posts: 2584
|
|
asi cez netwatch je to najjednoduchsie... nadefinujes si netwatch pre danu IPcku a pri udalosti "Down" si mozes este poistit preladenie podmienkou s 5 pingami...
jednoduchsie to uz asi nepojde ![Smile](modules/PNphpBB2/images/smiles/icon_smile.gif) |
|
|
|
|
![](./modules/PNphpBB2/templates/PNTheme/images/spacer.gif) |
|
Post subject: RE: Skript, po urcitom pocte stratenych pingov prepnutie na iny
Posted: 01.11.2010 - 20:55 #85956
|
|
Majster
Joined: Júl 11, 2008
Posts: 2311
|
|
aj tak to skusam teraz
len problem je ze kym sa pripoji dana ip, vypadne 5 pingov, asi to poriesim tak ze dam do toho skriptu najprv vypnutie toho netwatch pravidla, zmeni sa kanal, potom: :delay 120s, potom zapnutie daneho pravidla. Uvidim ako to pojde. |
|
|
|
|
![](./modules/PNphpBB2/templates/PNTheme/images/spacer.gif) |
|
Post subject: RE: Skript, po urcitom pocte stratenych pingov prepnutie na iny
Posted: 01.11.2010 - 22:07 #85957
|
|
Majster
![](./images/avatar/019.gif)
Joined: Okt 31, 2006
Posts: 2062
Location: TT
|
|
jaj čo špekuluješ ....
Code: ›
:while(true) do={
}
no a hadaj kam do toho napcháš ten tvoj skript .. prípadne tam pridaj delay nech to fak nebeží stále |
|
|
|
|
![](./modules/PNphpBB2/templates/PNTheme/images/spacer.gif) |
|
Post subject: RE: Skript, po urcitom pocte stratenych pingov prepnutie na iny
Posted: 01.11.2010 - 23:14 #85958
|
|
Majster
Joined: Júl 11, 2008
Posts: 2311
|
|
Vedel by niekto poradit ako vytiahnut z MK z wireless - status - noise floor aktualnu hodnotu? |
|
|
|
|
![](./modules/PNphpBB2/templates/PNTheme/images/spacer.gif) |
|
Powered by PNphpBB2 © 2003-2005 The PNphpBB Group Credits |