Logic test

Need new test, action, option? Post request here.
Post Reply
Guest

Logic test

Post by Guest »

It would be good to be able to create a test that was nothing more than a logical test on other tests.

So if TestA and TestB are two tests then:-

TestC = (TestA==UP) or (TestB==UP)
TestC = (TestA==UP) and (TestB==UP)
etc

You can currently use logic to determine if a test is run. However I don't want to do that. I just want a test result that is a logical formulation of the status of multiple other tests.
Guest

Post by Guest »

other options:-

TestC = if( TestA==UP, 54, 0 )
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

It would be good to be able to create a test that was nothing more than a logical test on other tests.
I think there is simple workaround - use dependant test with predefined result, e.g. Ping 127.0.0.1. If condition is True, test will ping localhost and return "alive" status; otherwise HM sets specified status ("Bad").
TestC = if( TestA==UP, 54, 0 )
Sorry, I do not understand what that means. Something like "If TestA returns UP status 54 time in a row and never returns DOWN status"??

Regards
Alex
terje
Posts: 88
Joined: Mon Jul 25, 2005 7:45 pm
Location: Sydney

Post by terje »

I think there is simple workaround - use dependant test with predefined result, e.g. Ping 127.0.0.1. If condition is True, test will ping localhost and return "alive" status; otherwise HM sets specified status ("Bad").
I tried exactly this approach myself but it does not achieve the objective.

If the status of the logic evaluates to false then the workaround test simply does not run rather than returning a BAD status.

It would seem that not running the test is not the same as an UNKNOWN status so the checkbox that says to evaluate UNKNOWN as BAD never comes into play.

After lots of testing I believe that achieving the objective requires new functionality.
terje
Posts: 88
Joined: Mon Jul 25, 2005 7:45 pm
Location: Sydney

Post by terje »

Just to elaborate more the specifics of what I am trying to do.

We have two SMTP gateways into our organisation. I don't care if one of them is down but I want to know if they are both down. Also I have lots of tests that are only relevant if both are down. If only one of them is down then we don't need to do many of the tests and associated alerts.

I have setup two tests:-

SMTP1 that attempts an SMTP connection to the first SMTP gateway.
SMTP2 that attempts an SMTP to the second parallel SMTP gateway.

I created a third test as follows.

TEST3 called: SMTP-system

The test pings 127.0.0.1.

The relevant logic settings are:-
The test depends on: Expression.

Perform test if: ('%::SMTP1::SimpleStatus%'=='UP') or ('%::SMTP2::SimpleStatus%'=='UP')

OtherwiseStatus: No Answer
The problem is that when run the status of test3 always says: Wait for Master

I have tried other settings for the OtherwiseStatus such as BAD and UNKNOWN but with no success. I refresh the test and it always says that the status is Wait for Master.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

We have two SMTP gateways into our organisation. I don't care if one of them is down but I want to know if they are both down. Also I have lots of tests that are only relevant if both are down. If only one of them is down then we don't need to do many of the tests and associated alerts.
If you want to start alert when both servers do not respond, use "advanced" mode for the action and condition like ('%::TestA::SimpleStatus%'=='DOWN') and ('%::TestB::SimpleStatus%'=='DOWN') and ((%::TestA::Recurrences%==1) or (%::TestB::Recurrences%==1))

To setup dependant tests you may use similar condition, e.g. ('%::TestA::SimpleStatus%'=='DOWN') and ('%::TestB::SimpleStatus%'=='DOWN')
I have tried other settings for the OtherwiseStatus such as BAD and UNKNOWN but with no success. I refresh the test and it always says that the status is Wait for Master.
Mark "Synchronize status&alerts" option in the Test Properties dialog

Regards
Alex
terje
Posts: 88
Joined: Mon Jul 25, 2005 7:45 pm
Location: Sydney

Post by terje »

Thanks. I seem to have it working now.
Post Reply