Check_HTTP query

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.
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Check_HTTP query

Post by neworderfac33 »

Afternoon.

The host is neither an IP or a hostname, but a URL!

Code: Select all

define host{
    host_name                    URL1
    hostgroups                   000-URL1
    address                      MyURL.dev.com
    max_check_attempts           5
    check_period                 24x7
    contact_groups               admins
    notification_period          24x7
    }

define command{
        command_name    check_http_url
        command_line    $USER1$/check_http -H $HOSTADDRESS$ -u $ARG1$
}

define service{
   use                          generic-service
   service_description          
   check_command                check_http_url!/my/url/path/ -r "" --expect=200
   host_name                    URL1
   }
I don't think it's fair to ask you guys to pursue this any more - if I run a CLI command, it clearly indicates that there is no content,

Code: Select all

/usr/local/nagios/libexec/check_http -H MyURL -u /my/url/path/ --expect=200 --eregi="" -v

STATUS: HTTP/1.1 200 OK
**** HEADER ****
Cache-Control: private
Pragma: no-cache
Content-Type: text/html
X-AspNet-Version: 4.0.30319
Set-Cookie: session=processform=0; path=/
Set-Cookie: aps03=lng=1&tzi=1; expires=Wed, 05-Aug-2026 12:57:21 GMT; path=/
Date: Fri, 05 Aug 2016 12:57:21 GMT
Content-Length: 0
NS-LB-VSERVER: lb=010-xxxxxxxxxxxxxxxxxx
NS-ORIGIN-SERVER: 99.99.99.99

**** CONTENT ****

Status line output matched "200" -
HTTP OK: Status line output matched "200" - 374 bytes in 0.010 second response time |time=0.010167s;;;0.000000 size=374B;;;0
yet if I map to MYURL/my/url/path/ in my browser, I can see stuff there. I think it's the NATURE of what's there that's confusing Nagios - you can see that here I'm searching for an empty REGEX string and the web interface reports OK - using "-s" with an empty string returns OK too (but confusingly, both -r and -R return OK) - perhaps what I can see are controls that LOOK like text (for example, I can see are two checkboxes, but there is what looks like "flat" text there too - which obviously isn't).

I'll have to go back to the owner of the webpage and see if he can help, but it's fair to say that I've learned a HUGE amount over the course of this post, so thank you all! :-)

I think you can close this thread now.

Regards

Pete
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Check_HTTP query

Post by bwallace »

Glad we could help! I'll go ahead and lock this thread now.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked