Bobcares

Nagios check_website : How to use ?

by | Apr 21, 2022

Nagios check_website is a website checker that verifies that the downloaded content is correct. We’re here to give you more information about this.

As part of our Server Management service, Bobcares provides solutions for any query, big or small.

Lets take look in to more details on this.

Nagios check_website

check_website: A website checker that ensures that the correct content is downloaded. Above all, this plugin’s purpose is to ensure that the index page is properly served. Similarly, many plugins may check to see if port 80 is responding for a domain or if the site loads without realizing if it is failing due to a database tie-in. This creates a file in /tmp containing the index’s actual content. It will display a critical error if it does not respond correctly or with an error.

Most importantly, Nagios plugin’s goal is to download a web page with all of his content ( internals links only – maybe with option in a futur release ).

The following are the main characteristics:

  • Ruby small script. Its easy to understand.
  • http/https Parse HTML which is using the powerful and simple hpricot lib.
  • Multi-threading
  • Checking Keyword

Nagios check_website plugin Installation:

Firstly,use the command
$ wget https://raw.github.com/catinello/nagios-check-website/master/check_website
Then,
$ chmod +x check_website
Lastly,
$ mv check_website /#to#/#your#/nagios/libexec/

Usage:

Usage: check_website [OPTIONS] {HOSTNAME}
  {HOSTNAME}
	host to check (dns/ip)
  [OPTIONS]:
	-p PORT		port to check (default: 80)
	-u URL		url path (default: /)
	-f		use fake agent (windows xp/firefox 25)
	-s		use SSL via HTTPS (default: 443)
	-P PROXY	proxy access (hostname:port)
	-w WARNING	warning threshold in milliseconds (default: 500)
	-c CRITICAL	critical threshold in milliseconds (default: 2000)
	-n TRIES	number of times to try (default: 1)
	-t TIMEOUT	amount of time to wait in seconds (default: 10)
	-C CERTIFICATE	client certificate stored in file location (PEM AND DER file types allowed)
	-b IP		bind ip address used by wget (default: primary system address)

Examples:

Check with no options.

$ ./check_website www.domainname.com
HTTP OK: 174ms - http://www.domainname.com/|time=174ms;500;2000;0;

Verify with fake agent results into a warning because 740ms is above the default value of 500.

$ ./check_website -f www.domainname.com
HTTP WARNING: 740ms - http://www.domainname.com/|time=740ms;500;2000;0;

Check on a non default port with a fixed url expecting a ssl connection via proxy.

$ ./check_website -p 8080 -u /index.html -s -P 192.168.27.111:3128 -c 4000 -w 1500 www.domainname.com
HTTPS OK: 274ms - https://www.domainname.com:8080/index.html|time=274ms;1500;4000;0;

Verify through proxy passing client certificate for authentication.

./check_website -P proxy.domainname.com:3128 -u /ping -s -w 2000 -c 5000 -C /root/certs/client_cert.pem www.example.com
HTTPS OK: 412ms - https://www.domainname.com/ping|time=412ms;2000;5000;0;

 

Return Values:

Nagios return codes are :-

0 = OK
1 = WARNING
2 = CRITICAL
3 = UNKNOWN

[Looking for a solution to another query? We are just a click away.]

Conclusion

To sum up, our skilled Support engineers at Bobcares demonstrated how to use Nagios check_website with ease.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.