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
Help with Nagios check
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Help with Nagios check
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!
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
Hey,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!
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
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: Help with Nagios check
You can test this out yourself by the following:
Please read the output of /usr/local/nagios/libexec/check_http -h, this states 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-p, --port=INTEGER
Port number (default: 80)
Previous Nagios employee