Checks for a bunch of domains their HTTP status code (200) and the <title>.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
lib
priv/templates/not_reachable
test
.gitignore
README.md
mix.exs
mix.lock

README.md

SiteHeartbeat

Checks for a bunch of domains their HTTP status code (200) and the <title>.

Project for blog post Coding Kata: Site Heartbeat in Elixir and Golang.

Uses https://github.com/edgurgel/httpoison

Deployment

  • Build it as escript locally,

    mix escript.build

  • scp the site_heartbeat to target system (e.g. ~/site-heartbeat).

  • Maintain a valuable hosts.txt.

  • Run it for test

    ./site-heartbeat/site_heartbeat hosts.txt

  • Put it into the crontab - running hourly

    5 * * * * cd /var/www/vhosts/rh-flow.de/site-heartbeat; ./site_heartbeat hosts.txt

  • Add locales to the cronjob, otherwise "the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8"

    LANG="de_DE.utf8" LANGUAGE="de_DE:" LC_ALL=de_DE.UTF-8