0
0
Fork 0
mirror of https://github.com/healthchecks/healthchecks.git synced 2025-04-07 22:25:35 +00:00
healthchecks_healthchecks/templates/docs/network_routers.html-fragment
2024-06-11 21:00:34 +03:00

51 lines
No EOL
3 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>Network Routers</h1>
<p>Certain network router operating systems can be configured to send regular HTTP(S)
requests to SITE_NAME directly from the router. This is a handy way to monitor them: when
the router loses its WAN connection, it will not be able to ping SITE_NAME, and SITE_NAME
will notify you about the outage.</p>
<h2>DD-WRT</h2>
<p><a href="https://dd-wrt.com/">DD-WRT</a> is a Linux-based firmware for routers that runs on wide
variety of router models. DD-WRT ships with a cron daemon and wget utility. You can
enable the cron daemon and edit crontab in DD-WRT control panel,
<strong>Administration Management Cron</strong>.</p>
<p>The crontab syntax on DD-WRT is:</p>
<div class="highlight"><pre><span></span><code><span class="p">[</span><span class="n">cron</span><span class="w"> </span><span class="n">expression</span><span class="p">]</span><span class="w"> </span><span class="p">[</span><span class="n">username</span><span class="p">]</span><span class="w"> </span><span class="p">[</span><span class="n">command</span><span class="p">]</span>
</code></pre></div>
<p>Example for sending a ping every minute:</p>
<div class="highlight"><pre><span></span><code><span class="k">*</span> * <span class="gs">* *</span> * root wget PING_URL
</code></pre></div>
<p>Screenshot:</p>
<p><img alt="DD-WRT control panel" src="IMG_URL/ddwrt.png" /></p>
<h2>MikroTik RouterOS</h2>
<p><a href="https://mikrotik.com/software">MikroTik RouterOS</a> is a router operating system used
primarily on MikroTik network hardware. Among its many features is scripting support
and a scheduler.</p>
<p>First, create a script in WebFig, <strong>System Scripts Add New</strong>. Use the following
parameters:</p>
<ul>
<li>Name: <code>ping</code> (example, you can use a different name)</li>
<li>Policy: <code>read</code>, <code>test</code></li>
<li>Source: <code>/tool fetch url="/tool fetch url="PING_URL" output=none</code></li>
</ul>
<p><img alt="DD-WRT control panel" src="IMG_URL/routeros1.png" /></p>
<p>Then, create a schedule in WebFig, <strong>System Scheduler Add New</strong>. Use parameters:</p>
<ul>
<li>Interval: <code>00:01:00</code> (one minute)</li>
<li>Policy: <code>read</code>, <code>test</code></li>
<li>On Event: <code>ping</code> (the name of the script from the previous step)</li>
</ul>
<p><img alt="DD-WRT control panel" src="IMG_URL/routeros2.png" /></p>
<p>Notes:</p>
<ul>
<li>The <code>output=none</code> parameter tells the system to discard response body. Without
this parameter, the system will save response body to a file, which will additionally
require the <code>write</code> policy.</li>
<li>The "tool fetch" utility supports HTTPS URLs but does not verify TLS certificates
by default. You can add <code>check-certificate=yes</code> parameter to require a valid TLS
certificate. Note that RouterOS ships with no root CA certificates, so you will
also need to load these.</li>
<li><a href="https://wiki.mikrotik.com/wiki/Manual:Tools/Fetch">Here's the full list of options</a>
supported by "tool fetch".</li>
</ul>