Previous 6.4 Thresholds Next

6.4.9 Threshold custom commands

The parameters passed to an external command when an alarm is created or closed can be configured here. The application only uses a command argument specified here if:

·       The Command attribute of the threshold is set

·       The type attribute of the threshold is set

·       If the violation occurs then this type has the “Alarm command” parameter set, if it ends then it has the “Clear command” parameter set

If the first condition is met but any of the other conditions isn’t met then the system will call the command with its default arguments:

·       Threshold id

·       Threshold name

·       Threshold level code or 0 if the alarm is closed

·       Date/time

·       Other site-equipment-measurement parameters, but only if the alarm is created, not when it is closed

 

Figure 54. Threshold custom command configuration I.

 

Every command has one main parameter:

·       Name: the unique name of the trap

During the creation of a new command definition the elements of an already existing command can be copied to the new command using the “Copy elements from this command” drop-down list.

 

Every command can contain more than one element: these will be in the argument list in the same order as they appear in the definition. The elements can be edited with the [elements] link. The elements page shows the main parameters of the command along with an “Example threshold” field. With the help of this field the user can choose an already existing threshold, and the application will show the actual values it would place into the argument list would this threshold violate.

Figure 55. Threshold custom command configuration II.

During the creation of an element the following fields has to be filled in:

·       Object: the object represented in the element. If the comand already has elements then the application will automatically choose the object of the last element. The possible types:

o   Constant: the given value will be sent out

Figure 56. Constant custom command element

o   Threshold: a threshold attribute can be chosen

Figure 57. Threshold custom command element

o   Measurement: the measurement type needs to be selected first (you can use the “any measurement type” option as well). A threshold can have more than one measurement of the same kind in its expression (for example: “if traffic A > 10MB or traffic B > 10MB”), so the user has the possibility to choose between them with the “Measurement number” field. The application sorts the measurements by their name, so the measurement A in the previous example is the first and the B is the second. It is important to notice that this the number between the measurements with the same type. So for example if the previous expression would contain a CPU measurement called C then it would have the number 1 too. After this the user has to decide which object he wants to use: the measurement itself, its parent equipment, any of the parent site of its equipment or the complete site hierarchy

Figure 58. Measurement custom command element

·       Field: which field of the object has to be used. The possible values depend on the type of the object, while in case on a constant type this is a text field which contains the string to be sent

 

Each element – if it isn’t a constant – has two other optional fields: a regular expression and a format parameter. With the help of the regular expression it is possible to check the value of the field or to split it up into several pieces. The format parameter can be used to modify/customize the data before sending it out: it can contain any text and with the help of the elements $1, $2, … it can contain the values of the match groups in the regular expression. For example if the threshold has a parameter with the value „switch1.intranet.company.local”, the expression is „([^.]+)” and the format is „Eq: $1”, then the value „Eq: switch1” will be sent out.