Page 1 of 1

[RESOLVED]How to define custom plugin "check_http"

Posted: Wed Mar 15, 2017 11:49 am
by nagios1_1
Hello, I wanted to ask you help.
I want using the plugin "check_http". I tried to use it with the following command:

./check_http -I 10.20.30.2 -p 80 -u http://10.20.30.2/mywiki

and it works.

Now I don't use it inside "definition service"

I wrote this:

Code: Select all

define service {
        host_name               NAS
        service_description     Wiki (HTTP)
        check_command           check_http
        max_check_attempts      5
        check_period            24x7
        #contacts               admins
        #contact_groups         admins
        notification_interval   30
        notification_period     24x7
}

define command {
        commnad_name            check_http
        command_line            $USER1$/check_http -H $HOSTADDRESS$ ?????????????
}

I don't writing the command_line

Re: How to define custom plugin "check_http"

Posted: Wed Mar 15, 2017 12:39 pm
by tmcdonald

Code: Select all

define service {
        host_name               NAS
        service_description     Wiki (HTTP)
        check_command           check_http!80!http://10.20.30.2/mywiki
        max_check_attempts      5
        check_period            24x7
        #contacts               admins
        #contact_groups         admins
        notification_interval   30
        notification_period     24x7
}

define command {
        commnad_name            check_http
        command_line            $USER1$/check_http -I $HOSTADDRESS$ -p $ARG1$ -u $ARG2$
}


Re: How to define custom plugin "check_http"

Posted: Wed Mar 15, 2017 5:06 pm
by nagios1_1
tmcdonald wrote:

Code: Select all

define service {
        host_name               NAS
        service_description     Wiki (HTTP)
        check_command           check_http!80!http://10.20.30.2/mywiki
        max_check_attempts      5
        check_period            24x7
        #contacts               admins
        #contact_groups         admins
        notification_interval   30
        notification_period     24x7
}

define command {
        commnad_name            check_http
        command_line            $USER1$/check_http -I $HOSTADDRESS$ -p $ARG1$ -u $ARG2$
}


Now I understand, thanks, It works.
I defined it in this way;

Code: Select all

define service {
        host_name               NAS
        service_description     Wiki
        check_command           check_http!80!http://10.10.10.11/wiki/
        max_check_attempts      5
        check_period            24x7
        contact_groups          admins
        notification_interval   30
        notification_period     24x7

}

Re: [RESOLVED]How to define custom plugin "check_http"

Posted: Thu Mar 16, 2017 9:07 am
by cdienger
Thanks for the update! Are we okay to close this?