Monitor uptime with SmokePing
If you’re a linux enthusiast and you don’t currently read the LinuxJournal, I suggest you have a look. They’re a great publication on everything linux, and they regularly provide useful content ranging from reviews, code snippets, how-tos, and tips & tricks. They publish digitally now over a variety of formats, which makes reading very convenient on any device you may have.
One of the articles I found particularly useful was on setting up SmokePing, an uptime and latency tracking project based on FastCGI, and RRDTool. Shawn Powers highlights its details and how-to set it up. You can go directly to the project’s site for the code and installation documentation, however if you’re a Fedora user, SmokePing is already packaged up in the fedora repo. I’ve had some availability trouble with a couple addon domains lately, so I’m going to track a couple public URLs for my blogsite. I’m starting with a fresh install of Fedora 23:
Install smokeping:
dnf install smokeping
You’ll need sendmail for notifications, or just to satisfy binary checks in smokeping’s config:
dnf install sendmail
Add your IPs/hostnames to the config smokeping will check (optionally add owner/notification info):
vi /etc/smokeping/config ... owner = Andrew contact = email.address@domain.com ... *** Alerts *** to = email.address@domain.com from = root@monitor-f23 ... menu = Top title = RHCE Blog Site Monitor remark = Tracking uptime since the beginning of time. + RHCEBlogSite menu= RHCE Blog Site title= RHCE Blog Site ++ calgaryrhce host = calgaryrhce.ca ++ rhce host = rhce.ca ++ torontorhce host = torontorhce.ca
Smokeping adds an httpd conf file module in its install, which I’m going to modify to allow from all IPs:
vi /etc/httpd/conf.d/smokeping.conf ... <Directory "/usr/share/smokeping" > Require all granted // adding in this line # Require ip 2.5.6.8 // comment out this # Require host example.org <Directory "/var/lib/smokeping" > Require all granted // adding in this line # Require ip 2.5.6.8 // comment out this # Require host example.org
Now enable and start both smokeping and httpd:
systemctl enable httpd systemctl enable smokeping systemctl start httpd systemctl start smokeping
Now, browsing to my Fedora 23 host’s SmokePing URL, http://monitor-f23/smokeping/sm.cgi shows me this: (I’ve let it run for a few days now, giving it time to gather enough data for interesting graphing)
If I click one of the graphs, I get a more detailed view of the data:
Happy monitoring! My complete config files for smokeping and apache are located at my github.