Nagios check_http for test string NEVER fails, ever!

Posted on 2009-02-23
Last Modified: 2013-12-07
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 "" -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 -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.


Question by:freymish
    LVL 48

    Accepted Solution

    check_command                check_http!-H "" -s "Welcome to the pants party"

    should be

    check_command                check_http_string!!'Welcome to the pants party"
    LVL 4

    Author Closing Comment

    Thanks!  All I can say for myself is... Doh!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now