Formatted output


Some action nodes support formatted output. Formatted output is anything from a MainView Middleware Monitor (MVMM) action that is formatted using Perl. Formatted output is useful and allows you to create generic actions that can be easily reused.

All Perl variables are accepted. See the Perl documentation for details about syntax, rules, and Perl-specific variables that can be used. MVMMuses its own Perl interpreter, which is installed on the computer with the MVMM Event Service.

Variable

Description

@QPASA_VARS

Inputs available MVMM topics to the script.
Each element of the array is a perl hash with the following key/value pairs:
my $value = $QPASA_VARS[0]{value}; 
my $physical_instance_path = $QPASA_VARS[0]{physical_instance_path}; 
my $physical_type_path = $QPASA_VARS[0]{physical_type_path}; 
my $is_transient_instance = $QPASA_VARS[0]{is_transient}; 
my $is_logical_instance = $QPASA_VARS[0]{is_logical}; 
my $logical_instance_path = $QPASA_VARS[0]{logical_instance_path}; 
my $logical_type_path = $QPASA_VARS[0]{logical_type_path};

Note

The following keys are deprecated as of this release, and might be removed in a future release:
my $instance_path = $QPASA_VARS[0]{path}; 
my $type_path = $QPASA_VARS[0]{type}

$QPASA_OUTPUT

Formatted string of the script and is what appears as the output (for example, text in an e-mail or file or SQL insert statements)

%QPASA_EVENT

An associative array, or "hash", which provides information about the event definition which invoked the format script.
my $trigger_name = $QPASA_EVENT{TriggerName}; 
my $template_name = $QPASA_EVENT{TemplateName); 
my $event_name = $QPASA_EVENT{EventName}; 
my $action_name = $QPASA_EVENT{ActionName); 
my $action_is_clear = $QPASA_EVENT{ClearAction}; 
my $event_duration = $QPASA_EVENT{EventDuration}; 
my $app_service_hostname = $QPASA_EVENT{ApplicationServiceHost}; 
my $app_service_port = $QPASA_EVENT{ApplicationServicePort}; 
my $trigger_true_uuid = $QPASA_EVENT{TriggerTrueUuid}; 
my $trigger_true_count = $QPASA_EVENT{TriggerTrueCount};

The following is an example for a formatted output for an e-mail. You could easily adapt it for SQL insert statements or to create the command line to start programs.

The result of the Perl formatting program is inserted into the final output.

Sample Perl code for formatted output

# @QPASA_VARS is an array of hashes (path, value)
# $QPASA_OUTPUT is the insertion string into the final
# formatted output
# %QPASA_EVENT is a hash containing the attributes of the # event including RuleName, ActionName, and TriggerName 

$a = "";
for $href (@QPASA_VARS)
{
$a .= "item $href->{path} $href->{value}\n";
}
$a .= "\n";
$QPASA_OUTPUT = $a;

The output of an e-mail looks like the following (assuming you created a rule for these five topics).

worddavee5220e48602a681a6f07a7cc01bf12c.png

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*