Solved

How to monitor web sites properly via Nagios

Posted on 2010-08-19
6
656 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Transparency shows that a company is the kind of business that it wants people to think it is.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

777 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