confirm_external/2—run an external program and wait for its termination to continue to process the current event

The confirm_external/2  runs an external program and wait for its  termination to continue to process the current  event

Note

The confirm_external/2 primitive can be used only in a refine rule.

confirm_external($PROG,$ARGS)

confirm_external/2 arguments

Argument

Mode

Type

Description

$PROG

input

STRING

Specifies the name of the external program to be run

$ARGS

input

LIST_OF ANY

Action argument list.
Required arguments for the program must be provided in the $ARGS list. The arguments are passed to the external program as command-line arguments.

Use confirm_external/2 to run the program specified in the $PROG argument as an external process on the current event and wait for the program to terminate before continuing to process the current event. The program location is determined in the same manner as it is for actions. See Actions for more information.

A call of confirm_external/2 suspends the processing of the current event. On termination of the program, processing of the current event is resumed. If the program is successful, 0 is returned as the exit status and the event passes through the remainder of the rules. If the program returns a non-zero exit status, the event is dropped and no other rules are applied to it.

In case of failure to start the external program, the refine rule is terminated immediately and the event is passed through subsequent rules.

The program is activated by using the slot name as environment variable name, in an environment that contains all the slots of the event. In addition, some system-defined variables are available.

confirm_external/2 example

confirm_external(mc_ping,[]);

In this example, the mc_ping script performs a ping operation to the host specified in the mc_host_address slot of the event that is currently in the refine rule phase. No arguments are required for this script; therefore, the empty list functions as the second argument of the call.

The script returns a 0 exit code if the ping succeeds. If the ping succeeds, the processing of the event will continue. If the ping fails, the event will be dropped.

Was this page helpful? Yes No Submitting... Thank you

Comments