1. Login to Opsview and Go to CONFIGURATION > SERVICE CHECKS
2.Click on ' ACTIONS > Create 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:
[email protected]:~$ 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 checks setup it's useful to summarise 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 CONFIGURATION - KEYWORDS
7. Click on ACTIONS > CREATE NEW KEYWORD
8. Select your newly created service checks.
9. After clicking SUBMIT then RELOADING your Opsview configuration, you will see your website 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.
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:
Website Monitoring Checks
Web Server CheckThis 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.
[email protected]:~$ 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:
[email protected]:~$ check_http -H ov-dev-61 -w 5 -c 10 Connection refused HTTP CRITICAL - Unable to open TCP socket
Content Serving CheckThis 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.
[email protected]:~$ 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.
[email protected]:~$ 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’
Here’s an excellent monitor to ensure that your website is retrieved within an acceptable time-frame:
Retrieve In-Time Check
[[email protected] ~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!
Find out how to configure Opsview to pro-actively respond to website attacks at our Webinar on 2nd February.