Hi,
did anyone notice that in v6.23 Netwatch interval isn’t working?
I monitor only one host ( 8.8.8.8 ) in default interval (1min) and used simple global variable (WANstatus 0 or 1) as flag to indicate Internet connection status so I can use this variable in other scripts.
Lately I decided to check if everything works as it should and maybe to optimize my scripts if I can and noticed that “Since” column in Netwatch for my host monitor rule is showing some old time and that it doesn’t change at all.
For further research I added additional variable (WANcounter) to UP script just to check if it will increment every minute as it should but nothing happens. Script works ok because when I change something in script and click “Apply” script increments variable and “Since” column shows new time.
Can you post the steps on how you set up all? I am interested in monitoring the Internet connection on my link and just started playing with scripts and need to learn more. ie. how you setup Netwatch and the script and schedule if you use one. tnx
Setup of Netwatch is quite simple. You need some host that you know is always online and witch netwatch will ping to check if network is alive. I used 8.8.8.8. witch is IP address of Google public DNS server. Set desired interval (default is 1min) and that’s it for detection part. No need to setup schedule for Netwatch.
Next is what you want to happen when Netwatch detects that your host is unavailable and for that you use UP and DOWN scripts.
As we have learned from jarda post, this scripts aren’t run on every check, only on state change. You can use UP and DOWN scripts to program router to do what you want directly or as I did just change some global variable and then use this variable in standard scripts. When you create global variable you can check their status under System->Scripts and switch to Environment tab. Matter of creating scripts is another topic, depending on what you actually want to happen.