A condition is a key component of an event rule or incident trigger. It tests whether a rule is appropriate to the current event, and therefore whether the actions within the rule should be applied. If a condition is not specified, then the rule is always applied.
You can combine conditions to make more complex tests. When combining conditions, you can determine how strict the test is, either:
- All tests must succeed - requires the event to meet all conditions.
- At least one test must succeed - requires just the event to meet just the first condition.
You can also invert the result of a test, which is useful in cases where the failure of the test is the correct outcome. In this case, the reported failure is inverted to reflect the real success of the test.
If you want to reuse conditions, you should define them via the Conditions tab on the Event Administration page. When setting rules and triggers, you can select these saved conditions. The Conditions tab also allows you to globally change a condition.
Types of condition:
The standard conditions in ENA are as follows:
|Event Attribute Test||all events share a set of standard attributes. You can select an attribute and compare its value to a set value, using one of the comparison operators. Each attribute has a tooltip help.|
|Event Severity Test||
enter the severity level against which to test events. This is the internal numeric severity level. Valid values are as follows:
|Event Type Test||
select an event type to test against.
|Incident Attribute Test||all incidents share a set of standard attributes. You can select an attribute and compare its value to a set value, using one of the comparison operators. Each attribute has tooltip help.|
|Incident Severity Test||
enter the severity level against which to test incidents. This is the internal numeric severity level, and valid values are as follows:
|Incident Type Test||select one or more incident types to test against.|
Both events and incidents:
|Groovy Script||expressions developed using Groovy Script (an object-oriented programming language for the Java platform). Through Groovy, you can access the database, e.g. the Filter Port Status Events rule evaluates whether ENA is configured to raise events against the current port.|
|IP Test||allows the management IP to be compared to a specified IP, and IP range or a subnet using either a mask or mask length.|
|Trap Varbind Test||
allows you to test varbind name values, e.g. the value may determine the event type to raise. When you select Trap Varbing Test, ENA allows you to:
|Variable Test||tests the value of a variable. This is intended for test and debug scenarios, and allows the contents of a project variable to be checked so that you can enable or disable one or more rules.|
|View Membership Test||tests whether the event is raised from an object within the selected View. Specify a View against which you test whether the source object of the current event is a member. You can therefore apply actions to sets of objects that you have already segregated, e.g. the key routers on a particular network.|
To create a new condition:
- Click Main Menu and then Administration.
- On the Administration page, click Event Administration.
- On the Event Administration page, click the Conditions tab. Click Add at the bottom of the screen.
- This will open the Add Condition window. Enter an appropriate Name and Description for the condition.
- Add, Edit, or Delete a parameter or parameters in the Parameters field.
- Clicking Add will open the New Parameter window, wherein you can enter a Name, Description and a Default Value for the parameter.
- Click Choose to open the Choose Variable or Function window, which allows you to choose the Function Call or Variable Reference that will form the basis of how this condition operates. Please see this article on creating variables for further help and information.
- In the Condition dropdown field, select one of the following (see above):
- All tests must succeed.
- At least one test must succeed.
- In the Tests field, specify the test or tests that you want to run against events in this condition. Click Add to open the Add Test window.
- In the Type dropdown field, choose from one of the standard tests or a custom test (see Types of test table above). Any previous conditions that you have created will be listed under 'Custom Conditions'.
- Tick the invert result box if you wish to invert the result, which is useful in cases where the failure of the test is the correct outcome. In this case, the reported failure is inverted to reflect the real success of the test.
- The fields available in this window will depend on the type of test that you select. If you select Variable Test as the type, the Variable dropdown field will appear. This will be populated by the variables specified under the Variables tab on the Event Administration page.
- Once you have specified the test, click OK to save and return to the Add Condition window,o otherwise click Cancel. You can add as many tests as you like.
- Click OK to save the condition and return to the Event Administration page, otherwise click Cancel.