monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check a string in a web page of more than 256 bytes


From: David Llanos
Subject: Re: Check a string in a web page of more than 256 bytes
Date: Wed, 05 Jul 2006 13:33:04 +0200

        Thanks for the response.
        I have tested it with a web page in my apache and it works
perfectly:
check host myHost with address 10.96.115.223
if failed url http://10.96.115.223/testpage.html
and content == "StringToTest"
timeout 30 seconds 2 times within 3 cycles
then alert

        But when i try it with a page of BEA WebLogic Server it doesn't
work:
check host beaServer with address 10.96.115.223
if failed url
http://10.96.115.223:8080/Portal_State/PortalState?operation.invoke=sayState
and content == "StringToTest"
timeout 30 seconds 2 times within 3 cycles
then alert

        Do you know if there is any limitation with the content??? The
string I want to test in the second case is in the middle of a page of 10
KB. In the log I see:
[ Jul  5 13:26:27] error    : HTTP error: Failed regular expression test on
content returned from server
[ Jul  5 13:26:27] error    : 'beaServer' failed protocol test [HTTP] at
INET[10.96.115.223:8080] via TCP

        Thanks in advance.

        David.

----- Original Message ----- 
From: "Jan-Henrik Haukeland" <address@hidden>
To: "This is the general mailing list for monit" <address@hidden>
Sent: Tuesday, July 04, 2006 2:10 PM
Subject: Re: Check a string in a web page of more than 256 bytes


>
> On 4. jul. 2006, at 13.27, David Llanos wrote:
>
> >         is there a possibility to check (with the SEND/EXPECT
> > schema) if a determined string is inside a web page, although it is
> > not in the first 256 Bytes of the page???
>
> No, send/expect is limited to testing the first 256 bytes. However
> you can use the url test to check for up to 1 MB of content in a web
> page. From the manual:
> Testing the content returned by the server is optional. If used, you
> can test if the content match or does not match a regular expression.
> Here's an example on how the URL statement can be used in a check
> service:
>
>   check host FOO with address www.foo.bar
>        if failed url
>           http://user:address@hidden:8080/?querystring
>           and content == 'action="j_security_check"'
>        then ...
> Monit will look at the content-length header returned by the server
> and download this amount before testing the content. That is, if the
> content-length is more than 1Mb or this header is not set by the
> server monit will default to download up to 1 Mb and not more.
>
> Only the http(s) protocol is supported in an URL statement. If the
> protocol is https monit will use SSL when connecting to the server.
>
>
>
>
>
>
> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general





reply via email to

[Prev in Thread] Current Thread [Next in Thread]