Ping Watchdog
Moderator: Moderators
Ping Watchdog
Hi all
I've just finished a how-to for "Ping Watchdog"
I just made up stuff
anybody want to critique my work
http://www.gargoyle-router.com/wiki/dok ... g_watchdog
I've just finished a how-to for "Ping Watchdog"
I just made up stuff
anybody want to critique my work
http://www.gargoyle-router.com/wiki/dok ... g_watchdog
Re: Ping Watchdog
Good guide!
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: Ping Watchdog
Does anybody know who wrote this plugin
I want to know more about "Custom script" feature
where is in installed?
example script?
do you need to include script headers?
I want to know more about "Custom script" feature
where is in installed?
example script?
do you need to include script headers?
Re: Ping Watchdog
By looking at the plugin I think you're able to use:
A basic command
"logread"
or a link to a more complex set of commands
"sh /etc/customscript.sh"
Where customscript.sh contains the commands you want to run.
A basic command
"logread"
or a link to a more complex set of commands
"sh /etc/customscript.sh"
Where customscript.sh contains the commands you want to run.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: Ping Watchdog
Great guide!
I don't suppose anyone has created custom script already that sends an email with a few logs before the drop-out occurred?
or even a simple script that sends just an email?
I don't suppose anyone has created custom script already that sends an email with a few logs before the drop-out occurred?
or even a simple script that sends just an email?
Re: Ping Watchdog
Something like this should work.
Note that I think this requires the Email notifications plugin, since that may install sendmail (I don't recall if it's included otherwise) but at the very least will define your SMTP particulars (SSL or not, server name and port). Of course, you could always handle sendmail in other ways.
Note that I think this requires the Email notifications plugin, since that may install sendmail (I don't recall if it's included otherwise) but at the very least will define your SMTP particulars (SSL or not, server name and port). Of course, you could always handle sendmail in other ways.
Code: Select all
#!/bin/sh
# Required variable if sending mail securely (i.e. not on port 25).
tlscert="/etc/ssl/certs/ca-certificates.crt"
# Define a timestamp function.
timestamp() {
date +"%I:%M:%S %p"
}
# Define sendmail variables.
subject="This is the subject, which can include: $(timestamp)"
from="from@email.com"
recipients="to@email.com,to2@email.com"
# Define the message to be sent.
# If using port 25, use the following sendmail line instead of the longer one:
# /usr/sbin/sendmail "$recipients" <<EOF
/usr/sbin/sendmail --tls-trust-file $tlscert "$recipients" <<EOF
subject:$subject
from:$from
Body of the message
EOF
# Commands can be included here or earlier.
# wifi
Re: Ping Watchdog
I use gargoyle as a internal router, and a router with LTE connection on a ship. When i loose coverage the lte modem dont automaticali search for signals, and often i need to reboot it to connect lte. I have installed ping watchdog, but i need a script to reboot the lte modem. I use SSH to reboot the modem, so i think it should not be any problem if i only knew how to do it. Someone with tips?
Re: Ping Watchdog
What commands do you run to reboot the modem? Are they run in Gargoyle or you need to SSH to the modem?
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: Ping Watchdog
I have made a VBS script i run from PC to reboot the modem.
The lte modem is the "Outdoorrouter.com" with openwrt luci. I suppose it also is possible to install watchdog on the openwrt, but i am not comfortable to do much with it if i do something wrong and mess it up. It is mounted high up in the ships mast and i accessable only with crane from port in good weather.
It would be perfect if i had a script on the gargoyle router witch send the reboot command to the modem when ping error from watchdog.
Option explicit
Dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "ssh 192.168.30.1 -l root"
WScript.Sleep 3000
oShell.Sendkeys "password~"
WScript.Sleep 1000
oShell.Sendkeys "reboot~"
WScript.Sleep 1000
oShell.Sendkeys "exit~"
WScript.Sleep 1000
Wscript.Quit
The lte modem is the "Outdoorrouter.com" with openwrt luci. I suppose it also is possible to install watchdog on the openwrt, but i am not comfortable to do much with it if i do something wrong and mess it up. It is mounted high up in the ships mast and i accessable only with crane from port in good weather.
It would be perfect if i had a script on the gargoyle router witch send the reboot command to the modem when ping error from watchdog.
Option explicit
Dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "ssh 192.168.30.1 -l root"
WScript.Sleep 3000
oShell.Sendkeys "password~"
WScript.Sleep 1000
oShell.Sendkeys "reboot~"
WScript.Sleep 1000
oShell.Sendkeys "exit~"
WScript.Sleep 1000
Wscript.Quit
Re: Ping Watchdog
Something like
from Gargoyle should work.
Code: Select all
ssh root@192.168.30.1 'reboot~'
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.