check host headers in iis and vhosts in apache

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
casey.franks
Posts: 4
Joined: Fri Apr 11, 2014 10:36 am

check host headers in iis and vhosts in apache

Post 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?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check host headers in iis and vhosts in apache

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
casey.franks
Posts: 4
Joined: Fri Apr 11, 2014 10:36 am

Re: check host headers in iis and vhosts in apache

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check host headers in iis and vhosts in apache

Post 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.
Former Nagios employee
Locked