I use Ubuntu 16.04 with Nginx and a few WordPress sites. Sometimes I don't visit a site for a long time (>=1 month) and it might be that the site is down.
I'm looking for a small utility that will email my Gmail account, if one of my Nginx-WordPress sites is down (without mentioning a reason).
Approaches considered so far
1. Creating a tool from scratch
- Creating the whole non-default configuration for my SMTP server.
- Adding anc configuring DNS recors at the hosting providers DNS management tool.
- Adding a weekly cron task with
curl -l -L
on each domain and save it's output into a file. - Adding a weekly cron task of say one hour later, to check each file and email myself if the status code isn't 200.
This might seem simple, but is actually quite complex (though not necessarily complicated), and it also might be a bit fragile. A dedicated, communal, maintained utility might be better for me.
2. Third party tools
I don't want to use some grandiose, third-party network-monitoring service like Nagios, Icinga, Zabbix, Shinken, etc, and they all seem an overkill per this particular cause.
3. Postfix add-on
I've already installed Postfix
with the internet-site
configuration so that tool might utilize Postfix. I just use the Postfix defaults, some default conf I could add on top of internet-site
, maybe without adding and configuring DNS records.
A utility which is an interactive program to re-configure Postfix might ease my pain; I wouldn't have to fill my Ubuntu-Nginx-WordPress-Environment installation-script with much SMTP configuration data. Maybe I'll just have to set some DNS records after that, and that's it. Anything that would ease the process this way or another is also an option for me.
4. Handling the spam filter
Even if Gmail would mistakenly move my first email (or the first series of email) to spam, I could put it into a whitelist.
My question
Is there a utility I could use to have this behavior?
wget
orcurl
(or some other HTTP client command line program) and emailing you when it fails (using some command line SMTP client program, e.g.mail
). You would then run periodically (e.g. twice a day) that script from yourcrontab
. You don't need to mess the DNS – Basile Starynkevitch Feb 14 '18 at 6:06curl
, @Jesse_b. An answer could help. – user9303970 Feb 14 '18 at 12:57