Monitor your shell scripts and crons with a simple curl.
Bash scripts are everywhere: system crons, deployments, backups, maintenance. A simple curl is enough to integrate MoniTao heartbeat.
Here are the most robust methods to ping MoniTao from your shell scripts.
The simplest and most universal method:
#!/bin/bash\nset -e\n\n# Your script\n./backup.sh\n\n# Ping MoniTao\ncurl -s -X POST https://monitao.com/api/heartbeat/ping/YOUR_TOKEN
If curl isn't available:
wget -q --post-data= https://monitao.com/api/heartbeat/ping/YOUR_TOKEN -O /dev/null
seo.heartbeat_bash.script_intro
seo.heartbeat_bash.script_example
With "set -e", the script stops on the first error. "|| true" prevents the script from failing if the ping fails. Your job is done, the ping is a bonus.
Use "set -e" at the beginning of the script. Any failing command stops the script before the ping. Or explicitly test the return code.
Yes: "0 * * * * /path/script.sh && curl -s -X POST https://monitao.com/api/heartbeat/ping/TOKEN". The && ensures curl only runs if script.sh succeeds.
Use curl with data: curl -X POST -d "duration=120&status=ok" URL. MoniTao records these metrics.
Start free, no credit card required.