We have a host being monitored using NRPE, let's call it server1. Attached to that same host, we are monitoring several URLs that are being hosted on server1 (e.g. http://www.website1.com, http://www.website2.com, etc.). If we view these checks in the CCM, the "check command" being used is "check_https_url." In the $ARG1$ field, the URL is shown.
This is a basic check, and doesn't actually tell us if there is a problem with the website (for example, if the page loads, but is 404, the check will still succeed).
We are monitoring another host using NRPE, let's call it server2. Server2 also has a couple website checks attached to it. I'm pretty sure these were done using the "Website" Configuration Wizard, and then the option for "Web Page Content" was selected. A string was input to check for, so that even if the page loads, but it is 404 or some other error, the check won't succeed. If we view these checks in the CCM, the "check command" being used is "check_xi_service_http." In the $ARG1$ field, we have the string that we are looking for, along with the IP address of the website (not the URL, for some reason). Note, the IP of the website is different from the IP of the host (server2), even though they are both on the same box.
If I try to use the same wizard, or even duplicate the service check in the CCM, and change it so that we are on server1, it never works. It ignores the IP of the website we want to check (specified in $ARG1$), and uses the IP of the host (server1).
How can I check a website for a certain string, but have it attached to the host that serves it, even if that host is being monitored using a different IP address? I'd be fine with monitoring the website using the URL and not the IP, but the wizard always seems to take the URL I type in and changes it (in the service check) to the IP (not that it actually uses that IP. It seems to only use the IP of the host itself for the check. Very odd.).
Monitoring a URL - wrong address being used
Re: Monitoring a URL - wrong address being used
Something sounds off with the configuration. check_xi_service_http's configuration by default should use:
$USER1$/check_http -H $HOSTADDRESS$ $ARG1$
where $HOSTADDRESS$ is a macro holding the address defined in the host's configuration. Can you provide screenshots of the hosts' and services' settings ?
$USER1$/check_http -H $HOSTADDRESS$ $ARG1$
where $HOSTADDRESS$ is a macro holding the address defined in the host's configuration. Can you provide screenshots of the hosts' and services' settings ?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Monitoring a URL - wrong address being used
So, I just tried it one more time, and now it is working. Not sure what I was doing wrong before, but I got it to work now. Sorry! I guess this can be closed.
I went in to the CCM, cloned the service from server2, that was monitoring the content (string) of one of the websites, and modified it so that it was attached to server1, and monitoring the website on server1, along with the content (string) specific for the new site I wanted to modify. It now appears to work, monitoring the correct website that was specified in the command string, by IP address.
I went in to the CCM, cloned the service from server2, that was monitoring the content (string) of one of the websites, and modified it so that it was attached to server1, and monitoring the website on server1, along with the content (string) specific for the new site I wanted to modify. It now appears to work, monitoring the correct website that was specified in the command string, by IP address.
Re: Monitoring a URL - wrong address being used
Glad to help 
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.