URL (HTTP) use expression

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Mikevirtu
Posts: 41
Joined: Sat Mar 01, 2014 8:12 am

URL (HTTP) use expression

Post by Mikevirtu »

Hi, Alex!
I use HostMonitor v.9.90.
I have 3 situation.
1. If I try use URL test from Active RMA agent
URL = http://ya.ru:80
I have Status- Host Alive

2. If I try use URL test from Active RMA agent
URL = http://ya.ru:80
with advanced flag "Check contents" and "use expression" with value
'HTTP' and '200' and 'Ok'
I have Status- Host Alive

3. If I try use URL test from Active RMA agent
URL = http://ya.ru:80
with advanced flag "Check contents" and "use expression" with value
'HTTP/1.1' and '200' and 'Ok'
I have Status - Bad contents

Please help resolve this problem with expression.
Mike.
Mikevirtu
Posts: 41
Joined: Sat Mar 01, 2014 8:12 am

Post by Mikevirtu »

Responce from server by use IP-TOOLs(Tools - HTTP) below.
Requesting ya.ru .. Ok
Reply received (reply time: 112 ms)
-----------------------------------
HTTP/1.1 200 Ok
Server: nginx
Date: Wed, 13 May 2015 06:44:43 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 10011
Connection: close
Cache-Control: no-cache,no-store,max-age=0,must-revalidate
Expires: Wed, 13 May 2015 06:44:43 GMT
Last-Modified: Wed, 13 May 2015 06:44:43 GMT
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' https://yastatic.net *.yandex.ru yandex.ru *.yandex.net https://*.yandex.ru https://yandex.ru https://*.yandex.net yandex.st yastatic.net *.yastatic.net ws://portal-xiva.yandex.net wss://portal-xiva.yandex.net wss://push.yandex.ru; img-src data: 'self' https://yastatic.net *.yandex.ru yandex.ru *.tns-counter.ru *.gemius.pl https://*.yandex.ru https://yandex.ru https://*.tns-counter.ru https://*.gemius.pl yandex.st *.yandex.net yastatic.net *.yastatic.net; report-uri http://www.yandex.ru/log/csp?from=yaru. ... 1431499483;
P3P: policyref="/w3c/p3p.xml", CP="NON DSP ADM DEV PSD IVDo OUR IND STP PHY PRE NAV UNI"
Set-Cookie: yandexuid=2537527181431499483; Expires=Sat, 10-May-2025 06:44:43 GMT; Domain=.ya.ru; Path=/
X-Frame-Options: DENY
X-XRDS-Location: http://openid.yandex.ru/server_xrds/
Mikevirtu
Posts: 41
Joined: Sat Mar 01, 2014 8:12 am

Post by Mikevirtu »

4. situation
if 'HTTP' and '201' and 'Ok' - I have Status Host is Alive.
5. situation
if 'HTTP' and '2015' and 'Ok' - I have Status Bad contents - Why?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

URL request does not check HTTP header contents.
It can check only HTTP page content.
Your page contains "class="i-flashcookie ", "/2000/svg" and "<head xmlns:og="http://" strings, but it does not contains "HTTP/1.1" word.

If you need to use URL request test, you may use "Use Warning Status if" option (located on "Test properties" dialog) with expression like the following:
%HTTPCode%<>200

Or, you may use HTTP test. It can check HTTP headers.

Please check for details at:
http://www.ks-soft.net/hostmon.eng/mfra ... s.htm#http
Mikevirtu
Posts: 41
Joined: Sat Mar 01, 2014 8:12 am

Post by Mikevirtu »

If you need to use URL request test, you may use "Use Warning Status if" option (located on "Test properties" dialog) with expression like the following:
%HTTPCode%<>200
Thank's! It's working!

I have any question.
I try test HTTP on Active RMA (Windows). I set on RMA agent on field Enable the following actions - flag HTTP request.
URL=http://www.ya.ru
Request=HEADER
In Hostmonitor I have Status Unknown and Reply not implemented.
I not check while in HTTP test properties flag Check header.

I tried button Test - and recieve -
Test status:Host is alive
Error code:0.
But in Hostmon status Unknown and Reply not implemented?
Mikevirtu
Posts: 41
Joined: Sat Mar 01, 2014 8:12 am

Post by Mikevirtu »

I did not undestand what happend. I created another URL request and set Use Warning status if = %HTTPCode%<>200
I have Warning Message - missed operand in expression: <>200
Why? What I did bad?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

If it's new ,just created test, use quotes in expression:
'%HTTPCode%'<>200
Mikevirtu
Posts: 41
Joined: Sat Mar 01, 2014 8:12 am

Post by Mikevirtu »

Thank's. in quoites it work!

And what I must do with HTTP test?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

HTTP test may check HTTP header directly using your expression:
'HTTP/1.1' and '200' and 'Ok'
Just open "Adbanced..." settings of Test properties dialog (HTTP test), mark "Check header", select "use expression" and provide your expression. e.g.:
'HTTP/1.1' and '200' and 'Ok'
Mikevirtu
Posts: 41
Joined: Sat Mar 01, 2014 8:12 am

Post by Mikevirtu »

I try test HTTP on Active RMA (Windows). I set on RMA agent on field Enable the following actions - flag HTTP request.
URL=http://www.ya.ru
Request=HEADER
In Hostmonitor I have Status Unknown and Reply not implemented.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Sorry, HTTP test is not supported by RMA.
Mikevirtu
Posts: 41
Joined: Sat Mar 01, 2014 8:12 am

Post by Mikevirtu »

it is planned to make?
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

low priority task (there is URL test supported by RMA and usually you don't need agents for HTTP checks - this protocol opened on most firewalls)

Regards
Alex
Mikevirtu
Posts: 41
Joined: Sat Mar 01, 2014 8:12 am

Post by Mikevirtu »

I have problem with certificate. I use URL test and test host by IP
https://192.168.0.1
I use "Use Warning status if = '%HTTPCode%'<>200"
and recieve Warning.
Test working from active RMA.
I checked in Advanced
HTTP/HTTPS:Code 302 (redirect) is Ok
HTTPS:Ignore unknown certificate authority problems
HTTPS:Accept certificates with invalid host name
HTTPS:Accept certificates with invalid dates
despite this I get - Warning.
Please help me.
Thank's.
Mike
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

What HTTP code returned by server?
What status do you see with disabled "use warning status" option?

Regards
Alex
Post Reply