Solved

How to monitor web sites properly via Nagios

Posted on 2010-08-19
6
659 Views
Last Modified: 2012-05-10
Hi Experts,

We have an issue with Nagios at the moment attempting to monitor Web sites.

Nagios reports as ok if port 80 is open - if the site is parked, Nagios wouldn't know.

Is there a better solution to check if the website is down or changed?

Can you monitor a particular picture or text in the site?

Perhaps a more powerful plugin is available?

Please help...
Thanks!
0
Comment
Question by:bossagroup
  • 3
  • 2
6 Comments
 
LVL 12

Assisted Solution

by:hfraser
hfraser earned 333 total points
ID: 33481765
The check_http plugin allows you to search the content for a specific string (--string) or regular expression (--regex or --eregi). If the site is a secure site (SSL), you can check for a valid certificate. Finally, you can check to see if the page is re-directed.
0
 

Author Comment

by:bossagroup
ID: 33481774
so can a specific string be a image on the webpage?

If so can you please show me the command to use?
0
 
LVL 12

Assisted Solution

by:hfraser
hfraser earned 333 total points
ID: 33482090
The check_http command can look for any string in the content of a web page. For example, the command:

check_http --string "Welcome to my site" mywebsite.,com -u welcome.html

would check for the string "Welcome to my web site" on http://mywebsite.com/welcome.html

This plugin is designed to search the entire content of a web page (including mime-encoded image files) for a specific string, but not well suited to tell if the web page has changed in any way. If you want to do this, you could do a simple check to see if the page size has changed (check_http -m min:max) or write a simple script to compare an md5 hash of the image file.

0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 9

Accepted Solution

by:
jeremycrussell earned 167 total points
ID: 33485605
To add to hfraser's response... To check for an image, just use the --string reponse and check for the image path/name

i.e  check_http -H host --string "/path/to/images/image.jpg"
0
 
LVL 12

Expert Comment

by:hfraser
ID: 33488140
Checking for a change to a link to an included image file isn't the same as checking for a change to the image file itself (ie. it's a different image). But it depends upon what you want to check.
0
 

Author Closing Comment

by:bossagroup
ID: 33527534
Thanks guys,

Exactly what I was after!
0

Featured Post

Now Available: Firebox Cloud for AWS and FireboxV

Firebox Cloud brings the protection of WatchGuard’s leading Firebox UTM appliances to public cloud environments. It enables organizations to extend their security perimeter to protect business-critical assets in Amazon Web Services (AWS).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question