Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Nagios HTTP/HTTPS check via wget (with/without Proxy)
Current Version
0.1
Last Release Date
2013-11-28
Owner
Antonino Catinello
Website
https://github.com/catinello/nagios-check-website
Download URL
https://raw.github.com/catinello/nagios-check-website/master/check_website
License
MIT
Compatible With
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} {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)
Examples:
$ ./check_website www.google.com HTTP OK: 174ms - http://www.google.com/|time=174ms;500;2000;0;
$ ./check_website -f www.amazon.com HTTP WARNING: 740ms - http://www.amazon.com/|time=740ms;500;2000;0;
$ ./check_website -p 8080 -u /index.html -s -P 192.168.27.111:3128 -c 4000 -w 1500 www.myweb.com HTTPS OK: 274ms - https://www.myweb.com:8080/index.html|time=274ms;1500;4000;0;
Hi! 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 host_name RCIEF_EXTERNOS service_description HTTP check_command check_http!192.168.105.09 :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
Here is my commands.cfg file: check_website -H $HOSTADDRESS$ $ARG1$ My service Monitoring Command is, check_website "www.example.com/login.aspx" It gives HTTP OK Message in Nagios Web Frontend.
Hi, 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.
Hello, My conf in commands.cfg is: url define command{ command_name check_website command_line $USER1$/check_website.sh www.globo.com 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 - http://www.globo.com/ Do not know why the status is UNKNOWN. It should be OK as the other. On the command line is ok: /usr/local/nagios/libexec/check_website.sh www.globo.com HTTP OK: 234ms - http://www.globo.com/|time=234ms;500;2000;0; Can you help me?
Hello, Can you help me. What I must write in section "define service"? If I write it: check_command check_website! -P 203.146.82.253 -w 20000 -c 50000 www.name.com - it is work not correctly. In the commands.cfg I wrote it: command_line $USER1$/check_website.sh -P $ARG1$ -w $ARG2$ -c $ARG3$ $HOSTADDRESS$ If I try to run this script /usr/lib/nagios/plugins/check_website.sh -p 80 -u /index.html -P 203.146.82.253 -w 22000 -c 50000 www.name.com - all work!
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 203.146.82.253:3128 if that is your proxy ip and service port. My script is lacking in argument checking. I'll have to fix that.
You must be logged in to submit a review.
To:
From:
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!