HP Operations Manager for Windows

SESSION parameters


Complicated threshold policies can contain multiple threshold levels or instance filter rule and conditions with threshold and reset scripts, but the parameter definition block is evaluated only from the first script.

However, if you define that the parameters are also stored as SESSION variables, you can use the SESSION variable to access the parameters in all scripts of the policy.

To define that a parameter should be stored in a SESSION variable:

Use the following syntax to save a parameter as a SESSION variable:

#PARAMETER <name> [STRING|INT|DOUBLE] DEFAULT <value> [SESSION ["<session name>"]]

If the SESSION keyword is used without a session name, the parameter name will be used also for the session variable. If the SESSION keyword is used, the created Perl code for the example above would be as shown:

#PARAMETERS START
#PARAMETER CriticalThreshold INT DEFAULT 95 SESSION
my $CriticalThreshold;
$CriticalThreshold = 95;
$Session->Value('CriticalThreshold', $CriticalThreshold);
#PARAMETERS END

The VBScript for the same situation is shown below:

'PARAMETERS START
'PARAMETER CriticalThreshold INT DEFAULT 95 SESSION
DIM CriticalThreshold
CriticalThreshold = 95
Session("CriticalThreshold") = CriticalThreshold
'PARAMETERS END

In other threshold level or instance rule scripts, it is now possible to use the SESSION variable to access the defined script parameter value. In a Perl script this would look like the following:

if ( $src->Value() > $Session->Value('CriticalThreshold') )
{
  $Rule->Status(TRUE);
}
The VBScript for the same situation is shown below:
If Src.Value > Session.Value("CriticalThreshold") Then 
  Rule.status = True
End If  
The Parameter definition keywords help topic contains additional keywords.