Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
PHP check-script which can check a website(URL) and react if errors like 404, 500 etc are returned.
Current Version
Last Release Date
September 21, 2011
Owner
egalstad
Compatible With
#!/usr/local/bin/php "; exit(2); } $url = "http://" . $argv[1]; $header = @get_headers($url, 1); if(!$header) { echo "Could not connect to $url"; exit(2); } if(preg_match('/200/', $header[0])) { print_r($header[0]); exit(0); } elseif(preg_match('/302/', $header[0])) { print_r($header[0]); exit(0); } elseif(preg_match('/301/', $header[0])) { print_r($header[0]); exit(0); } else { print_r($header[0]); exit(2); } ?> Remember to change /usr/local/bin/php to whereever your php-binary is located and chmod +x check_www. commands.cfg: define command{ command_name check_www command_line /usr/local/libexec/nagios/check_www $ARG1$ } services.cfg: define service{ use default-critical host_name webserver contact_groups it-department service_description Website: www.example.org check_command check_www!www.example.org } Users: * scaarup (Owner) Overall downloads: 106 Hits: 505 Added: 2010-07-07 11:58:03 Last Modified: 2010-07-07 12:04:03
You must be logged in to submit a review.
To:
From: