Using HetrixTools with Alpine

Update: This has been updated for recent HetrixTools as of 2024;

Many of us like to monitor our services externally, even for things which have been virtualized. No, not compartmentalized (like Docker), but virtualized. I prefer to have separate KVMs for different tasks – it’s just as fast, compatible with many different operating systems, and makes migration as easy as copying over a file and setting up the network. Easy-peesy.

Being that I have a relatively small network these days, I don’t feel like keeping several external nodes around just to monitor network issues and external activity – It was fun to setup, but to spend as much work on upkeep of external “pinger” nodes isn’t worth my time when I can get services which cost me pennies per day.

Enter Hetrix Tools, which has several different services – ping, HTTP/HTTPS, SSL certificate monitoring, SBL monitoring, and so forth. What’s even better is that the first 15 are completely free!

The installer script is pretty good, but doesn’t yet support Alpine Linux, since Alpine doesn’t have many of these tools installed by default. To make the script work, you’ll first need to:

$sudo apk add wget procps lsblk bash util-linux grep

Then, install the script as directed:

$sudo wget https://raw.github.com/hetrixtools/agent/master/hetrixtools_install.sh && bash hetrixtools_install.sh [your options here]

Double check that you have all of the required packages by going to the installation directory and running the command manually:

$sudo $SHELL
#cd /etc/hetrixtools
#bash -x hetrixtools_agent.sh

Look for any broken/missing dependencies, or anything else that’s wrong, and then fix it, accordingly.

Finally, since it depends on what cron you decided to install, you’re going to need to construct your crontab by hand. I use crony, so that looks like:

*	*	*	*	*	/bin/bash -c "(cd /etc/hetrixtools; /bin/bash hetrixtools_agent.sh 2>&1 >> /dev/null )"

That’s all it takes to run Hetrix’ service monitoring on an Alpine Linux 3.8+ installation!