Web Page Content Check Query

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
clx002
Posts: 5
Joined: Thu Dec 08, 2011 3:34 am

Web Page Content Check Query

Post by clx002 »

Using Nagios XI I am monitoring a URL (ping / http / dns check etc) - I have selected the option to check 'Web Page Content' - in the 'Content String To Expect:' I have typed the work Zebra (as a test) knowing that this word does not appear anywhere on the page of the site being monitored. When Nagios checks the URL it passes the Web Page Content check as successful and i am confused as to why?

Any ideas would be much appreciated.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Web Page Content Check Query

Post by lmiltchev »

There is probably something wrong with your definition...or you do have a zebra out there... :D

Try running a check from the command line to see if it will pass. See an example bellow:
zebra.png
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
clx002
Posts: 5
Joined: Thu Dec 08, 2011 3:34 am

Re: Web Page Content Check Query

Post by clx002 »

Thanks for your response, i'll test your command line suggestion.

Just for clarity, through the XI gui in the section, 'Content String To Expect' once you have selected 'Web Page Content' you do enter a word that you want Nagios to check is apparent on the page it is monitoring i.e. you dont enter code etc...?

Thanks again
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Web Page Content Check Query

Post by lmiltchev »

Go to the Core Config Manager->Monitoring->Services and filter the results through the "Config name filter" by selecting your host. Click on "Modify" Action button next to the "Web Page Content" service. Under the "Common Settings" tab you can see the "Command view", which should look like this:

Code: Select all

$USER1$/check_http -H $HOSTADDRESS$ $ARG1$
$USER1$ is basically your plugins folder - "/usr/local/nagios/libexec"
To test your check command from the command line, go to your plugins folder:

Code: Select all

# cd /usr/local/nagios/libexec
and run:

Code: Select all

# ./check_http -H $HOSTADDRESS$ $ARG1$
where you substitute $HOSTADDRESS$ and $ARG1$ with the appropriate values (you can see the $ARG1$ under the "Common Settings" tab)

Here is our documentation on how to check commands from the command line:

http://support.nagios.com/wiki/index.ph ... mmand-line

Once, your command is working from the command line, you can modify your existing check command through the Core Config Manager.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked