Page 1 of 1

Help with Nagios check

Posted: Sun Nov 06, 2016 4:17 pm
by krishnar
Hi Experts,

This is my first post here. Please excuse me if I am asking a stupid question. I have seen a Nagios check config like this.

define command {
command_name check_site
command_line $USER1$/check_http -S -H $ARG1$ -I $HOSTADDRESS$ -p $ARG2$ -u /servlet/Test -e 200 -w 2 -c 4
}

I am having some difficulty in understand the -p and -I parameters. Why do we need -I which is the IP address of the host when we are passing the hostname in the $ARG1$. is it to bypass any local DNS resolution and enforce the IP address that is mentioned somewhere in the config?

Also, what does -P do? I thought -S is there to enforce https check

Krish

Re: Help with Nagios check

Posted: Mon Nov 07, 2016 2:33 pm
by dwhitfield
Have you read through /usr/local/nagios/libexec/check_http -h?

It's not necessary to use both -I and -H. -I is suggested to bypass DNS.

I'm not sure about the confusion about -P. It's for http POST. Lowercase -p is to specify a port number.

Perhaps I'm missing something in your question, so please rephrase the question if I haven't answered it. Thanks!

Re: Help with Nagios check

Posted: Wed Nov 09, 2016 10:35 pm
by krishnar
dwhitfield wrote:Have you read through /usr/local/nagios/libexec/check_http -h?

It's not necessary to use both -I and -H. -I is suggested to bypass DNS.

I'm not sure about the confusion about -P. It's for http POST. Lowercase -p is to specify a port number.

Perhaps I'm missing something in your question, so please rephrase the question if I haven't answered it. Thanks!
Hey,

would it cause some sort of confusion when there is both -H and -I parameters set in the command??

Also, I assume that -p option in that command is to force the port that is being passed in the argument rather than using the default SSL port 443.

Krish

Re: Help with Nagios check

Posted: Thu Nov 10, 2016 1:24 pm
by avandemore
You can test this out yourself by the following:

Code: Select all

# /usr/local/nagios/libexec/check_http -H localhost -I 127.0.0.1
HTTP OK: HTTP/1.1 200 OK - 3271 bytes in 0.001 second response time |time=0.000594s;;;0.000000 size=3271B;;;0
Please read the output of /usr/local/nagios/libexec/check_http -h, this states the following:
-p, --port=INTEGER
Port number (default: 80)