Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1


Remember Me

Directory Tree


6 votes
Current Version
Last Release Date
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Nagios HTTP/HTTPS check via wget (with/without Proxy)
Check website accessibility by return code and execution time.

- specific URL support
- ssl option
- alternative port
- fake user agent
- proxy as parameter
- proxy from environment variable

Usage: check_website [OPTIONS] {HOSTNAME}
host to check (dns/ip)
-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)


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

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

$ ./check_website -p 8080 -u /index.html -s -P -c 4000 -w 1500
HTTPS OK: 274ms -|time=274ms;1500;4000;0;
Reviews (5)
byarendon, March 5, 2020
I have my command like this and it indicates that the port is invalid.
I share my scrip

define service {
use generic-service ; Inherit default values from a template
service_description HTTP
check_command check_http! :17000/CR_RCIEF/faces/Units/Login.jsp

define command {

command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ -p $_SERVICEport_number$ -u -A $ARG1$
Help me
bynishith, September 10, 2017
Here is my commands.cfg file:

check_website -H $HOSTADDRESS$ $ARG1$

My service Monitoring Command is,

check_website ""

It gives HTTP OK Message in Nagios Web Frontend.

Thanks for the script.
It was though only working on the CLI and not in Nagios, until I found out, that somehow there was the a wrong current working directory defined. So WGet tried to save into that non-writeable working directory and failed and the whole script returned state 'UNKNOWN'.
It was enough to just add

-P /tmp

to the wget call.
byLiberato, June 11, 2014

My conf in commands.cfg is:

define command{
command_name check_website
command_line $USER1$/

The status in service detail of url nagios is:

UNKNOWN 06-11-2014 14:08:23 0d 0h 33m 15s 3/3 HTTP UNKNOWN: N/A -

Do not know why the status is UNKNOWN. It should be OK as the other.

On the command line is ok:


HTTP OK: 234ms -|time=234ms;500;2000;0;

Can you help me?
byivani, June 2, 2014
0 of 1 people found this review helpful

Can you help me. What I must write in section "define service"? If I write it:

check_command check_website! -P -w 20000 -c 50000 - it is work not correctly.

In the commands.cfg I wrote it:

command_line $USER1$/ -P $ARG1$ -w $ARG2$ -c $ARG3$ $HOSTADDRESS$

If I try to run this script

/usr/lib/nagios/plugins/ -p 80 -u /index.html -P -w 22000 -c 50000 - all work!
Owner's reply

Hello Ivani,your proxy definition is missing the port number.

It works on the cli since you probably have a defined proxy environment value which is used in favor of the passed argument.

Try to use if that is your proxy ip and service port.

My script is lacking in argument checking. I'll have to fix that.