Simple URL downtime alert with bash, curl and sendmail

17Aug08

Now for a really easy way to be notified when an URL goes down:


email=$(/bin/cat <<!
From: URL Monitor <urlmonitor@localhost>
To: $2
Subject: $1 is down!
!)
/usr/bin/curl -f $1 || echo "$email" | /usr/sbin/sendmail -t

Just put it in your crontab as urlmonitor.sh <URL to check> <email address>.

1 Response to “Simple URL downtime alert with bash, curl and sendmail”


  1. 1 coggedman Posted 2008-08-28 - 9.36 pm

    Thanks . it is much relieving to come accross this kind of utility than reading thowing a page load of instructions for a seasoned professional who happens to have never used a particular command e.g sendmail in this instance.

Leave a Reply


Comment guidelines: No spamming, no profanity, and no flaming. Inappropriate comments will be deleted outright.


Where am I?

This is a single entry in the weblog.

"Simple URL downtime alert with bash, curl and sendmail" is filed under Geekstuff. It was published in August 2008.



www.flickr.com