Page 1 of 1
Web Page Content Check Query
Posted: Thu Dec 08, 2011 3:44 am
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.
Re: Web Page Content Check Query
Posted: Thu Dec 08, 2011 3:03 pm
by lmiltchev
There is probably something wrong with your definition...or you do have a zebra out there...
Try running a check from the command line to see if it will pass. See an example bellow:
zebra.png
Re: Web Page Content Check Query
Posted: Fri Dec 09, 2011 3:04 am
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
Re: Web Page Content Check Query
Posted: Fri Dec 09, 2011 11:18 am
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:
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.