What's new

Configuring Chk-WAN

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

RRands

Occasional Visitor
I'm trying to set up @Martineau Chk-WAN script on my Asus Merlin router. I followed the install instructions, and all seemed to go as planned. My challenge is that I don't think it is actually running correctly.

I thought by typing "./ChkWAN.sh cron" that it would install it into crontab. When I run that command, it seems to do just that, but upon reboot, when I type "cru l", it is not in the list.

Here is what I have tried
=====================================================================
cru l
13 9 */7 * * service restart_letsencrypt #LetsEncrypt#
=====================================================================

OK - no entry there, so proceed to the command I think should add it...

=====================================================================
./ChkWAN.sh cron

ChkWAN scheduled by cron

*/30 * * * * /jffs/scripts/ChkWAN.sh wan nowait once #WAN_Check#


(ChkWAN.sh): 5314 v1.17 WAN connection status monitoring will begin in 10 seconds.....


(ChkWAN.sh): 5314 v1.17 Monitoring WAN connection using 5 target PING hosts (192.168.12.1 94.140.14.15 94.140.15.16 9.9.9.9 1.1.1.1) (Tries=3)

(ChkWAN.sh): 5314 Monitoring pass 1 out of 3

(ChkWAN.sh): 5314 Private LAN 192.168.12.1 will be skipped for WAN PING check!


(ChkWAN.sh): 5314 Monitoring WAN connection OK.....(Successful ping to '94.140.14.15'); Terminating due to ACTIVE cron schedule
======================================================================

NOTE: Not sure if the "Terminating due to ACTIVE cron schedule" above is an error, or just information?
ALSO: 192.168.12.1 (above) is my t-mobile router/gateway - the ASUS router is behind that - does the note above about skipping 192.168.12.1 indicate that it is not checking that route at all? (that is my path to the internet)
my setup looks like this: ASUS (192.168.12.2) -> T-Mo Gateway (192.168.12.1) -> iNet (public IP)
If it is skipping this route altogether, is there a way to force it to use that? (I don't think it is skipping, as last line says "WAN connection OK", but wanted to check...

======================================================================
If I subsequently type "cru l", I get:

13 9 */7 * * service restart_letsencrypt #LetsEncrypt#
*/30 * * * * /jffs/scripts/ChkWAN.sh wan nowait once #WAN_Check#
======================================================================

So it looks like the cron job has been added, but if I type "./ChkWAn.sh status", it says:
(ChkWAN.sh): 6379 v1.17 Check WAN monitor not running

And then if I reboot the router, it is back to not having ChkWAN in the "cru l" list again... :S

I can edit my init-start file so that it adds the cron job every reboot, but even then, if I type "./ChkWAN status", it says it is not running. Does that mean it's not *currently running, or does it mean that there is something wrong with the cron job?


Thank you for any help - I appreciate it!


-randy
 
I can edit my init-start file so that it adds the cron job every reboot, but even then, if I type "./ChkWAN status", it says it is not running. Does that mean it's not *currently running, or does it mean that there is something wrong with the cron job?
I would recommend using the examples shown on Github to manually configure the cron job:


In an attempt to be as flexible as possible, ChkWAN can run permanently in the background and check the WAN every second if there is a mission critical need, but the 1 min interval check by a cron job is probably more than adequate in most cases.

To be informative, if the script is being scheduled by cron, then when ChkWAN has performed its WAN check, when terminating it issues the message to say that it is no longer physically running as a background task .

So when you manually issue ./ChkWAN.sh status it is merely checking for the existence of a physical background instance.
 
Awesome - thank you for the reply - I configged it as per the posts, and I better understand the “status” function now. :)
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top