New check_over_http features

Yesterday I finished up some more features to Plugin::Nagios::OverHTTP. Before the only parameter that could be passed was url. Now this parameter can still be passed, but you may also pass other individual parameters, including hostname, path, and ssl. This helps improve the check_over_http utility which would be used in the Nagios checking. Typically the command definition would have been something like the following:

define command{
        command_name check_over_http
        command_line check_over_http --url=$ARG1$ $ARG2$
        }

This means the following would need to be in a service definition:

define service{
        use                            noncritical-service

        host_name                      server1
        service_description            Connection to MySQL
        notes                          Checks if the server can connect to remote MySQL
        check_command                  check_over_http!http://server1/nagios/check_remote_mysql
        }

As you can see, the check command duplicates the hostname, which is not the way of Nagios plugins. Now With version 0.04 and up, we can have the following definitions:

define command{
        command_name check_over_http
        command_line check_over_http --hostname=$HOSTADDRESS$ --path=$ARG1$ $ARG2$
        }
define service{
        use                            noncritical-service

        host_name                      server1
        service_description            Connection to MySQL
        notes                          Checks if the server can connect to remote MySQL
        check_command                  check_over_http!/nagios/check_remote_mysql
        }

Leave a Reply