Page 1 of 1

check host headers in iis and vhosts in apache

Posted: Fri Apr 11, 2014 10:44 am
by casey.franks
Hi,

I am running Nagios Core 3.4.1 and I need to monitor numerous sites that are running on a few servers. How do I setup Nagios to do a host header check since all the sites run off of one IP?

Re: check host headers in iis and vhosts in apache

Posted: Fri Apr 11, 2014 12:06 pm
by sreinhardt
Might you be looking for check_http and some of the flags such as:

Code: Select all

-H, --hostname=ADDRESS
    Host name argument for servers using host headers (virtual host)
    Append a port to include it in the header (eg: example.com:5000)
 -I, --IP-address=ADDRESS
    IP address or name (use numeric address if possible to bypass DNS lookup).
 -d, --header-string=STRING
    String to expect in the response headers
 -u, --url=PATH
    URL to GET or POST (default: /)
 -N, --no-body
    Don't wait for document body: stop reading after headers.
    (Note that this still does an HTTP GET or POST, not a HEAD.)
 -k, --header=STRING
    Any other tags to be sent in http header. Use multiple times for additional headers
I posted all the flags that I thought might be of use to you, try some out and see if they give the results you expect. If not please post what you have tried, what didn't work or wasn't expected, and what you would like to see instead.

Re: check host headers in iis and vhosts in apache

Posted: Sat Apr 12, 2014 1:46 pm
by casey.franks
This is exactly what I was looking for. Can I use the check_http -H as both a host and service check?

Re: check host headers in iis and vhosts in apache

Posted: Mon Apr 14, 2014 9:15 am
by tmcdonald
casey.franks wrote:Can I use the check_http -H as both a host and service check?
You absolutely can. That is true of all plugins, though some make more sense as a host check or vice versa.