Browse Source

Title tags for documentation pages.

pull/325/head
Pēteris Caune 5 years ago
parent
commit
e2fe2edcc1
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
8 changed files with 34 additions and 35 deletions
  1. +1
    -0
      hc/front/views.py
  2. +17
    -17
      templates/docs/http_api.html
  3. +2
    -2
      templates/docs/http_api.md
  4. +1
    -1
      templates/docs/introduction.html
  5. +1
    -1
      templates/docs/introduction.md
  6. +4
    -3
      templates/docs/monitoring_cron_jobs.html
  7. +2
    -2
      templates/docs/monitoring_cron_jobs.md
  8. +6
    -9
      templates/front/docs_single.html

+ 1
- 0
hc/front/views.py View File

@ -283,6 +283,7 @@ def serve_doc(request, doc="introduction"):
"section": "home", "section": "home",
"section": doc, "section": doc,
"content": content, "content": content,
"first_line": content.split("\n")[0],
} }
return render(request, "front/docs_single.html", ctx) return render(request, "front/docs_single.html", ctx)


+ 17
- 17
templates/docs/http_api.html View File

@ -53,15 +53,15 @@ minimizes the delay from your monitored service failing to you receiving an aler
</pre></div> </pre></div>
<div class="highlight"><pre><span></span><span class="nt">HTTP</span><span class="o">/</span><span class="nt">1</span><span class="p">.</span><span class="nc">1</span> <span class="nt">200</span> <span class="nt">OK</span>
<span class="nt">Server</span><span class="o">:</span> <span class="nt">nginx</span>
<span class="nt">Date</span><span class="o">:</span> <span class="nt">Wed</span><span class="o">,</span> <span class="nt">29</span> <span class="nt">Jan</span> <span class="nt">2020</span> <span class="nt">09</span><span class="p">:</span><span class="nd">58</span><span class="p">:</span><span class="nd">23</span> <span class="nt">GMT</span>
<span class="nt">Content-Type</span><span class="o">:</span> <span class="nt">text</span><span class="o">/</span><span class="nt">plain</span><span class="o">;</span> <span class="nt">charset</span><span class="o">=</span><span class="nt">utf-8</span>
<span class="nt">Content-Length</span><span class="o">:</span> <span class="nt">2</span>
<span class="nt">Connection</span><span class="o">:</span> <span class="nt">close</span>
<span class="nt">Access-Control-Allow-Origin</span><span class="o">:</span> <span class="o">*</span>
<span class="nt">OK</span>
<div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
<span class="na">Server</span><span class="o">:</span> <span class="l">nginx</span>
<span class="na">Date</span><span class="o">:</span> <span class="l">Wed, 29 Jan 2020 09:58:23 GMT</span>
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">text/plain; charset=utf-8</span>
<span class="na">Content-Length</span><span class="o">:</span> <span class="l">2</span>
<span class="na">Connection</span><span class="o">:</span> <span class="l">close</span>
<span class="na">Access-Control-Allow-Origin</span><span class="o">:</span> <span class="l">*</span>
OK
</pre></div> </pre></div>
@ -82,13 +82,13 @@ optional but enables a few extra features:</p>
</pre></div> </pre></div>
<div class="highlight"><pre><span></span><span class="nt">HTTP</span><span class="o">/</span><span class="nt">1</span><span class="p">.</span><span class="nc">1</span> <span class="nt">200</span> <span class="nt">OK</span>
<span class="nt">Server</span><span class="o">:</span> <span class="nt">nginx</span>
<span class="nt">Date</span><span class="o">:</span> <span class="nt">Wed</span><span class="o">,</span> <span class="nt">29</span> <span class="nt">Jan</span> <span class="nt">2020</span> <span class="nt">09</span><span class="p">:</span><span class="nd">58</span><span class="p">:</span><span class="nd">23</span> <span class="nt">GMT</span>
<span class="nt">Content-Type</span><span class="o">:</span> <span class="nt">text</span><span class="o">/</span><span class="nt">plain</span><span class="o">;</span> <span class="nt">charset</span><span class="o">=</span><span class="nt">utf-8</span>
<span class="nt">Content-Length</span><span class="o">:</span> <span class="nt">2</span>
<span class="nt">Connection</span><span class="o">:</span> <span class="nt">close</span>
<span class="nt">Access-Control-Allow-Origin</span><span class="o">:</span> <span class="o">*</span>
<div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
<span class="na">Server</span><span class="o">:</span> <span class="l">nginx</span>
<span class="na">Date</span><span class="o">:</span> <span class="l">Wed, 29 Jan 2020 09:58:23 GMT</span>
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">text/plain; charset=utf-8</span>
<span class="na">Content-Length</span><span class="o">:</span> <span class="l">2</span>
<span class="na">Connection</span><span class="o">:</span> <span class="l">close</span>
<span class="na">Access-Control-Allow-Origin</span><span class="o">:</span> <span class="l">*</span>
<span class="nt">OK</span>
OK
</pre></div> </pre></div>

+ 2
- 2
templates/docs/http_api.md View File

@ -63,7 +63,7 @@ GET /5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278/fail HTTP/1.0
Host: hc-ping.com Host: hc-ping.com
``` ```
```
```http
HTTP/1.1 200 OK HTTP/1.1 200 OK
Server: nginx Server: nginx
Date: Wed, 29 Jan 2020 09:58:23 GMT Date: Wed, 29 Jan 2020 09:58:23 GMT
@ -94,7 +94,7 @@ GET /5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278/start HTTP/1.0
Host: hc-ping.com Host: hc-ping.com
``` ```
```
```http
HTTP/1.1 200 OK HTTP/1.1 200 OK
Server: nginx Server: nginx
Date: Wed, 29 Jan 2020 09:58:23 GMT Date: Wed, 29 Jan 2020 09:58:23 GMT


+ 1
- 1
templates/docs/introduction.html View File

@ -1,4 +1,4 @@
<h1>SITE_NAME</h1>
<h1>SITE_NAME Documentation</h1>
<p>SITE_NAME is a service for monitoring cron jobs and similar periodic processes:</p> <p>SITE_NAME is a service for monitoring cron jobs and similar periodic processes:</p>
<ul> <ul>
<li>SITE_NAME <strong>listens for HTTP requests ("pings")</strong> from services being monitored.</li> <li>SITE_NAME <strong>listens for HTTP requests ("pings")</strong> from services being monitored.</li>


+ 1
- 1
templates/docs/introduction.md View File

@ -1,4 +1,4 @@
# SITE_NAME
# SITE_NAME Documentation
SITE_NAME is a service for monitoring cron jobs and similar periodic processes: SITE_NAME is a service for monitoring cron jobs and similar periodic processes:


+ 4
- 3
templates/docs/monitoring_cron_jobs.html View File

@ -38,15 +38,16 @@ increasingly important as you add more checks to your account.</p>
<p>Take note of your check's unique <strong>ping URL</strong></p> <p>Take note of your check's unique <strong>ping URL</strong></p>
</li> </li>
</ol> </ol>
<p>Finally, edit your crontab and append a curl or wget call after the command:</p>
<p>Finally, edit your cron job definition and append a curl or wget call
after the command:</p>
<div class="highlight"><pre><span></span>$ crontab -e <div class="highlight"><pre><span></span>$ crontab -e
<span class="c1"># m h dom mon dow command</span> <span class="c1"># m h dom mon dow command</span>
<span class="m">8</span> <span class="m">6</span> * * * /home/user/backup.sh <span class="o">&amp;&amp;</span> curl -fsS --retry <span class="m">3</span> PING_URL &gt; /dev/null <span class="m">8</span> <span class="m">6</span> * * * /home/user/backup.sh <span class="o">&amp;&amp;</span> curl -fsS --retry <span class="m">3</span> PING_URL &gt; /dev/null
</pre></div> </pre></div>
<p>Now, each time your cron job runs, it will send a HTTP request to the ping URL.</p>
<p>Since SITE_NAME knows the schedule of your cron job, it can calculate
<p>Now, each time your cron job runs, it will send a HTTP request to the ping URL.
Since SITE_NAME knows the schedule of your cron job, it can calculate
the dates and times when the job should run. As soon as your cron job doesn't the dates and times when the job should run. As soon as your cron job doesn't
report at an expected time, SITE_NAME will send you a notification.</p> report at an expected time, SITE_NAME will send you a notification.</p>
<p>This monitoring technique takes care of various failure scenarios that could <p>This monitoring technique takes care of various failure scenarios that could


+ 2
- 2
templates/docs/monitoring_cron_jobs.md View File

@ -35,7 +35,8 @@ increasingly important as you add more checks to your account.
1. Take note of your check's unique **ping URL** 1. Take note of your check's unique **ping URL**
Finally, edit your crontab and append a curl or wget call after the command:
Finally, edit your cron job definition and append a curl or wget call
after the command:
```bash ```bash
$ crontab -e $ crontab -e
@ -44,7 +45,6 @@ $ crontab -e
``` ```
Now, each time your cron job runs, it will send a HTTP request to the ping URL. Now, each time your cron job runs, it will send a HTTP request to the ping URL.
Since SITE_NAME knows the schedule of your cron job, it can calculate Since SITE_NAME knows the schedule of your cron job, it can calculate
the dates and times when the job should run. As soon as your cron job doesn't the dates and times when the job should run. As soon as your cron job doesn't
report at an expected time, SITE_NAME will send you a notification. report at an expected time, SITE_NAME will send you a notification.


+ 6
- 9
templates/front/docs_single.html View File

@ -1,16 +1,13 @@
{% extends "front/base_docs.html" %} {% extends "front/base_docs.html" %}
{% load compress static hc_extras %} {% load compress static hc_extras %}
{% block title %}Documentation - {% site_name %}{% endblock %}
{% block description %}
<meta name="description" content="Monitor any service that can make a HTTP request or send an email: cron jobs, Bash scripts, Python, Ruby, Node, PHP, JS, ...">
{% endblock %}
{% block keywords %}
<meta name="keywords" content="healthchecks, crontab monitoring, python health check, bash health check, cron monitoring, cron tutorial, cron howto, api health check, open source">
{% endblock %}
{% block title %}{{ first_line|striptags }} - {% site_name %}{% endblock %}
{% block description %}{% endblock %}
{% block keywords %}{% endblock %}
{% block docs_content %}<div class="docs-content">{{ content|safe }}</div>{% endblock %}
{% block docs_content %}
<div class="docs-content">{{ content|safe }}</div>
{% endblock %}
{% block scripts %} {% block scripts %}
{% compress js %} {% compress js %}


Loading…
Cancel
Save