check_http (bogus) setup

Morris, Patrick patrick.morris at hp.com
Thu Apr 15 19:01:59 CEST 2010


Gerard Petersen wrote:
> Hi All,
>
> I've been testing with the check_http service. I always was under the 
> assumption that the setup below would check www.example.com
>
> define service{
>      use                             generic-service
>      host_name                       myhost1
>      service_description             http - www.example.com
>      check_command                   check_http!www.example.com!/
>      }
>
> With this service definition (as often installed out of the box):
>
> define command{
>      command_name    check_http
>      command_line   /usr/lib/nagios/plugins/check_http -H '$HOSTADDRESS$'
>      }
>
> Wrong! It would check for a webserver on myhost1. Since there's nothing 
> running at myhost1:80 i got a TCP error. Somewhat baffled I've been tailing 
> the access.log of www.example.com to see when I actually got a hit.
>   

Why would you assume it would check www.example.com?  Your service 
definition clearly tells it to check $HOSTADDRESS$, which is the address 
of the host the service is defined on.
> The funny thing is this (with no additional parms) even returns ok, would 
> you have a webserver listening on myhost1:80
>
> check_command                   check_http
>
> So, you would be wise to turn the command syntax into this:
>
> command_line    /usr/lib/nagios/plugins/check_http -H '$ARG1$' -u '$ARG2$'
>
> Then this will actually test www.example.com:
>
>   check_command                   check_http!www.example.com!/
>
> Is it me or is this check_http setup misleading? (ubuntu 9.10 in this case)
>   

It's you.  The plugin's parameters, and the value of Nagios's macros, 
are all very well-defined and well-documented.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list