A customer contacted us with a requirement to monitor the functional status of their website and all its vital components to ensure...
You are here
Website Monitoring in 10 Easy Steps with Opsview
For most companies websites are their corporate face to the world. Any downtime can be costly especially if the sites are used for e-commerce. Website monitoring checks can be set up quickly and easily in Opsview Monitor giving you powerful alerting capabilities to check on crashed servers, website attacks and more.
Here are 10 easy steps to set up a web server monitor in Opsview:
1. Login to Opsview and Go to SETTINGS > ADVANCED > SERVICE CHECKS
2. Click on the '+' sign to create a new service check
3. You will see a blank template, ready for you to fill with data. Populate the template with information to create an appropriate service check, in the example below we’ve set it up to warn us when our SSL certificate is within 30 days of expiring.
4. Before adding the check into your template you can test the syntax of your argument on the command line:
nagios@ov-trn-s1:~$ check_http –H www.opsview.com –C 30 OK – Certificate will expire on 04/26/2012 10.23.
5. Once all the data is complete you need to assign the checks to a host. When you've got all your website monitoring checks setup it's useful to summarize them in a viewport so that you can easily see all activity in one place. To do this you need to set up a dashboard view for your new checks.
6. Go to SETTINGS > ADVANCED > KEYWORDS
7. Click on + to create a new keyword
8. Click on 'OBJECTS' then select your newly created service checks.
9. After clicking SUBMIT then RELOADING your Opsview configuration, you will see your web server monitors appear on your dashboard.
10. Click through to Website Health Checks. You can change the view to suit your requirements, here we have selected a ‘performance’ view, allowing us to instantly see the key metrics.
Here is the same dashboard, but with a ‘Group by Service’ overview.
Website Monitoring Checks
There are lots of types of checks you can carry out to ensure the health of your website and webservers – here are a few you can try:
Web Server Check
This is checking the web server running on 'ov-dev-61'. It performs a simple TCP connection on port 80 and ensures a valid HTTP response is received.
nagios@ov-trn-s1:~$ check_http –H ov-dev-61 –w 5 –c 10 HTTP OK HTTP/1.1 200 OK – 316 bytes in 0.003 second response time | time=0.003423s;5.000000;10.000000;0.000000 size=316B;;;0
If the webserver stops working, then we see this response:
nagios@ov-trn-s1:~$ check_http –H ov-dev-61 –w 5 –c 10 Connection refused HTTP CRITICAL – Unable to open TCP socket
Content Serving Check
This is a really useful check, as it allows you to monitor both potential defacements to your website as well as performing an 'application' level check, i.e. ensuring that your webserver is serving meaningful content.
A check of Apache processes sometimes isn't enough; Apache may be running, but it may not be serving the content you expect. This check addresses that.
nagios@ov-trn-s1:~$ check_http –H www.opsview.com –u /company –s “Based in Reading –w –c 10 HTTP OK HTTP/1.1 200 OK – 41439 bytes in 0.886 second response time | time=0.885759s;5.000000;10.000000;0.000000 size=41439B;;;0
Here we see the result of the check when a string ('foobar') is required, but not found.
nagios@ov-trn-s1:~$ check_http –H www.opsview.com –u /company –s “foobar” –w 5 –c 10 HTTP CRITICAL: HTTP/1.1 200 OK – string ‘foobar’ not found on ‘http://www.opsview.com:80/company’
Retrieve In-Time Check
Here’s an excellent monitor to ensure that your website is retrieved within an acceptable time-frame:
[nagios@vader ~j$ check_http –w 2 –c 4 –H www.opsview.com –f follow HTTP OK: HTTP/1.1 200 OK – 49250 bytes in 0.777 second response time | time=0.777155s;2.000000;4.000000;0.000000 size=49250B;;;0
If there are any other types of website monitoring checks that you use regularly or want to use let us know!
More like this
A guide in proactive monitoring that shows you how to configure Opsview to restart Windows services.
This is a brief blog post to explain how I quickly integrated my existing Opsview server with my existing ELK deployment.