check_www

check_www

PHP check-script which can check a website(URL) and react if errors like 404, 500 etc are returned.

Usage:

./check_www [url (without http://)]

Remember to change /usr/local/bin/php to whereever your php-binary is located and chmod +x check_www.

Define Command:

commands.cfg:

define command{
       command_name check_www
       command_line /usr/local/libexec/nagios/check_www $ARG1$
} 

Define Service:

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
        }