unable to define the command in check HTTP in service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ikekim
Posts: 85
Joined: Wed Aug 16, 2017 12:21 pm

unable to define the command in check HTTP in service

Post by ikekim »

In using Nagios XI, using the configuration manager to create a service to use the "check_http" or "check_xi_service_http" I'm unable to configure this command that works from the command console.

The command that works and I want to configured this using CCM:

Code: Select all

/usr/local/nagios/libexec/check_http -H abc.xyz.com -u '/LinkWeb/LinkEntry' -S -p 443
But I'm unable to do this bacause when I select "check_http" command, the command view populates with $USER1$/check_http -I $HOSTADDRESS$ $ARG1$ whcih is not what I want because I don't want to use the -I switch.

When I select to use the "check_xi_service_http", then the command view populates with $USER1$/check_http -H $HOSTADDRESS$ $ARG1$ which is what I want because I want to use the -H switch, however, when I do the Run Check Command, the -H parameter value is automatically translated to IP address from the Host that was assigned rather than for me to be able to provide the -H parameter with abc.xyz.com.

How can I get around this? Isn't there a way for me to tell CCM to create the service that executes the exact command that I know it works?

thanks,
ik
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: unable to define the command in check HTTP in service

Post by npolovenko »

@ikekim, You should be able to click on Manage Hosts button, remove localhost from there and add another host to this service.
screen.png
OR you could just change the check_http command. Go to Configure in the top menu/Core Configuration Manager. Click on commands in the left column. Search for check_http command. Change -I to -H and click on save. Don't forget to click on Appy configuration afterwards.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
ikekim
Posts: 85
Joined: Wed Aug 16, 2017 12:21 pm

Re: unable to define the command in check HTTP in service

Post by ikekim »

@npolovenko,

thanks for the detailed and clear explanation. However, it still doesn't work for me because when I modify the command to use -H this still picks up the IP address rather than picking up abc.xyz.com, hence, I get the same error. I even tried configuring a host and defined the address using the host name instead of defining with the IP address and I added it to "Manage Host", but for some reason it keeps picking up the IP address after the -H switch.

I did apply all the configurations.

So my issue is that I can't get the command to pick up the abc.xyz.com host name after the -H switch, instead, it keeps forcing me to use the IP address which cause the error.

To me this almost seems like a bug in Nagios XI.

thanks,
ik
kyang

Re: unable to define the command in check HTTP in service

Post by kyang »

You aren't able to set this as a service under a host because in the Hosts fields it will list "address" --> Which is where you would put the hostname of your website.

If you set a website service under localhost and have it connected to the localhost. XI looks for the "address" in the host field.

The best way of doing this is to just run the website wizard with your web address --> go into the Core Config manager --> Hosts --> find the website you just added and in your $ARG1$ use

Code: Select all

-u '/LinkWeb/LinkEntry' -S -p 443


Try this out and let us know.
ikekim
Posts: 85
Joined: Wed Aug 16, 2017 12:21 pm

Re: unable to define the command in check HTTP in service

Post by ikekim »

When I run the website wizard automatically pick up the IP address and that results with the same issue that I'm having.

thanks.
kyang

Re: unable to define the command in check HTTP in service

Post by kyang »

Which wizard did you run? Monitor a website or Monitor a web URL?

I chose "monitor a website" and yes it shows the IP address, but the template uses the -H

In my "address" its listed as http://www.google.com and not the IP address.
Capture.PNG
Use the check_xi_service_http in the check command to get the -H and pass your $ARG1$
You do not have the required permissions to view the files attached to this post.
Locked