• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2573
  • Last Modified:

Nagios check_http for test string NEVER fails, ever!

I am trying to make Nagios tell me is a text string on a page exists and show a fault if it doesn't.  It never fails even if I put in a string that doesn't exist on the site.  I am doing something wrong.

Here's the check command:

  # 'check_http_string' command definition
define command{
    command_name    check_http_string
    command_line    $USER1$/check_http -H $ARG1$ -s $ARG2$
    }


I invoke this like so:
check_command                check_http!-H "www.mydomain.com" -s "Welcome to the pants party"

I can't get the darn thing to fail!  Needless to say the quote after the -s doesn't exist on the site.  (Yes, I'm sure!)

From a console session it works perfectly when entered like this:

./check_http -H www.mydomain.com -s "mitigate behavioral risk"

any change to the text string and it fails as it should.  I am doing something wrong but I don't know what that could be.

Help please before I pull out whats left of my hair... it wouldn't take long.

Thanks,

Freymish
0
freymish
Asked:
freymish
1 Solution
 
TintinCommented:
check_command                check_http!-H "www.mydomain.com" -s "Welcome to the pants party"

should be

check_command                check_http_string!www.mydomain.com!'Welcome to the pants party"
0
 
freymishAuthor Commented:
Thanks!  All I can say for myself is... Doh!
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now