Condition to perform dependant test

General chat about HostMonitor
Post Reply
govarlo
Posts: 5
Joined: Mon Aug 16, 2021 12:42 pm

Condition to perform dependant test

Post by govarlo »

Hi All,

First post on this blog. Just wondering if anyone knows how to create a Custom Monitoring condition for a test in the following scenario:

I have 2 servers which are Active-Standby configuration, both servers are configured the same way, currently I've monitor created to fetch info from each server with HTTP Test method by a GET Request and Checking specific Contents.

The Active server has 50 extensions registered and when tests are performed, all looks fine as the extensions are online, however on the Standby server, because it has no extensions registered, I get BAD Request status.

The servers could swap roles and then the previous Standby server will take over Active role and it will register 50 extensions to it, and to old Active one will un-register the extensions.

My goal is to create a Custom Condition test which allow me to check the Active server extensions status and for the Standby server, monitor it to check if Active server role and status are OK, and in case of failure of Active one, the Standby server becomes Active and start monitoring the extensions status for the new Active server.

Hope I express myself clearly enough!!!
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Not sure I understand.
How many tests have you set?
2 tests - one for each server?
Or 100 tests - 50 tests for each server?
Do you want to set 2 Master tests (one for each server) and 100 dependent tests (50 for each server)?

If you have just 2 tests, I assume you want to get some alerts when both tests returns "bad" status at the same time?
While "good"+"bad" test results should not trigger actions?

Regards
Alex
govarlo
Posts: 5
Joined: Mon Aug 16, 2021 12:42 pm

Post by govarlo »

I have 2 tests, one for each server. The test consist on an search for HTTP text string on a web page to confirm status of the 50 extensions. The Active server shows the 50 extensions registered, the standby server not, reason why I get BAD request.
My intention is to have alerts on Active server showing up, and alerts on Standby server on hold until it gets Active because failure of the other server.

I was thinking about to have 2 lines HTTP string search, but not sure how to make it to work as the files on "Text Method \ Advanced \ Check Contents has only one field to add text, reason why I was thinking on adding Custom Monitor to detect which server is active and only alert for the tests on active server and stays on-hold for Standby server until it gets online.

Thanks in advance for your help
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sorry, still do not understand :oops:
How exactly HTTP response looks in both cases?
What text should be detected for "good" test status?
What text should be detected for "bad" test status?

Something like:
"active" should be present and "failed" should not be detected for "good" status?
"standby" detected - set "good" status regardless of "failed" text presence?
"active"+"failed" - "bad" status?

Regards
Alex
govarlo
Posts: 5
Joined: Mon Aug 16, 2021 12:42 pm

Post by govarlo »

Sure, I understand is hard to get it as this is a very custom test.

The HTTP text that I'm currently searching is:
- Recording devices registered with DMCC - 50

But I need to add another extra search for:
- Recorder Role: Primary

In case both expressions match, that is the Active Server, so it basically confirms Registered extensions and Server role

My idea is something like this:

If "Server Role: Primary" and "Recording devices registered with DMCC - 50" then Status is: Host is Alive


If "Server Role: Backup" then Server Status "waiting for Primary"


The test should be smart enough to identify which server is primary and which one is backup in order to run the test for only Active server.

Does it makes more sense now?
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I think you don't need any master-dependant set of tests.

You may set 1 test (per server) with the following option
Check content: use expression "Server Role: Backup" or "Recording devices registered with DMCC - 50"

Test will set Bad status when (serverrole<>backup) and (DMCC<>50)
Otherwise HostMonitor will set Ok status.

Unless both servers may switch to "backup" mode and this should be detected as "bad" condition?

Regards
Alex
govarlo
Posts: 5
Joined: Mon Aug 16, 2021 12:42 pm

Post by govarlo »

That is correct, at the moment both tests are created searching for -Recording devices registered with DMCC - 50 - but the part of the Custom expression to make the test search for other conditions is the one I can't complete.

You are suggesting something like this: Test will set Bad status when (serverrole<>backup) and (DMCC<>50) which I believe is fine and I could start from there, however could you please show me some examples, or at least the structure that should contain the Custom Expression?

Thanks for your help.
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

however could you please show me some examples, or at least the structure that should contain the Custom Expression?
Please open window with URL test settings, find "Check content" option, set "use expression" mode.

Regards
Alex
govarlo
Posts: 5
Joined: Mon Aug 16, 2021 12:42 pm

Post by govarlo »

Hey Alex,

Sorry, I'm not getting you. You want me to open a web browser? or HostMonitor Test I've created? On the Test properties I can see This test depends on and I can set it up for Expression, which is the one I don't have the knowledge to create.

Regards,
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Please send e-mail to support, we will provide screen shots

Regards
Alex
Post Reply