Web page content help - using check_http

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Web page content help - using check_http

Post by ecarrasq »

System Info

Linux Distribution and version?

*Linux version 2.6.18-348.16.1.el5PAE #1 SMP Wed Aug 21 04:49:45 EDT 2013 i686 i686 i386 GNU/Linux
CentOS release 5.7 (Final)


32 or 64bit?

32 bit

VMware Image or Manual Install of XI?

VMware Image

Are there specials configurations on your system, ie; is Gnome installed? Are you using a proxy? Are you using SSL?

Forced SSL on NagiosXi login web screen

Nagios Xi version: Nagios XI 2012R2.3

Issue:

I need help in creating a web page content check using check_http (http://nagiosplugins.org/man/check_http), or another type of plugin that can do the following.

Scenario:

We have a web page that will show the word "GREEN, YELLOW, or RED" at any point in time with date following the text (GREEN, YELLOW, or RED".
Example:

YELLOW: 3.19 seconds for duration of call
I would like to alert, as follows:

GREEN = Ok
YELLOW = Warning with the text following the word YELLOW
RED = Critical with the text following the word RED

Any ideas?

Thank you very much,
Eddie
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Web page content help - using check_http

Post by BanditBBS »

If you can't find a plugin to do exactly what you want, there is this one: http://exchange.nagios.org/directory/Pl ... nt/details

Most plugins that check for web page content only check if content is there, if it is, then returns OK, if it isn't then returns Critical. The one I linked works like that, but it could be modified to look at your page for the three different results. relatively easy I think.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Web page content help - using check_http

Post by sreinhardt »

As bandit mentioned, most plugins are meant to check for one item. Considering yours is so specific, writing a bash or other script that pulled the webpage and searched for your three terms would not be terribly hard at all. Something like curl the page, grep the page for each of your terms, print the results to standard out, and exit with the correct code for OK, warning, or critical.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked