Watchdog Examples

From wiki.netio-products.com
Jump to navigation Jump to search

Monitoring IP address

The Watchdog monitors specified IP address. The ping is sent every 60s and waits 5s for the device to respond. If the ping fails twice in a row, Watchdog returns FALSE and restarts the device (Rule for the restart action must be defined separately, see Rules). After the device restarts, it waits 120 seconds and starts monitoring again. This cycle repeats for a total of 3 times. If the device does not respond even once, the Watchdog remains in error.

{
  "target": "192.168.101.180",
  "pingInterval": 60,
  "timeout": 5,
  "maxTimeouts": 2,
  "timeToReboot": 120,
  "maxRestarts": 3 
}

Monitoring domain

The Watchdog monitors specified domain. The ping is sent every 10s and waits 5s for a response. If the ping fails, Watchdog waits 180 seconds and tries again for a total of 5 times, then returns FALSE. Subsequently, an action is called to restart the device (Rule for the restart action must be defined separately, see Rules).

After restart, the Watchdog returns from the error state and runs the cycle again, a total of 3 times. Then the Watchdog remains in an error state until the first successful ping.

Note: In case of unsuccessful domain translation (eg communication with the DNS server fails), error will be written to the device log. Failed DNS resolution therefore prevents pinging of URLs, but has no effect on pinging IP addresses. Eg. pinging local network IP addresses will continue to work.

{
  "target": "google.com",
  "pingInterval": 10,
  "timeout": 5,
  "maxTimeouts": 5,
  "timeToReboot": 180,
  "maxRestarts": 3
}