Information
Important This documentation space contains information about PATROL Agents when deployed in a TrueSight Operations Management environment. If you are a BMC Helix Operations Management user, see PATROL Agent 22.1 for BMC Helix Operations Management.

Where variables are stored


The main issues to remember about variables are as follows:

  • Name your local variables; otherwise, PATROL will do it for you, and you will not be able to use them in your script later.
  • Use configuration variables only when necessary (resource usage).
  • Beware of cumulative global variables (memory usage).

Browsing the Namespace

This section provides an example script for browsing a namespace.

function print_parameters(instpath)
{
    local parm, parms, parmpath;
    parms=get_vars(instpath,"subnodes");
    foreach parm (parms)
    {
        parmpath=instpath."/".parm;
        if (get(parmpath."/__type__") == "PARAM_INSTANCE")
        {
            print(" PARAMETER : ".parmpath."\n");
        }
    }
}
function print_instances(applpath)
{
    local inst , instances, instpath;
    instances=get(applpath."/instances");
    foreach inst (instances)
    {
        instpath=applpath."/".inst;
        print(" INSTANCE : ".inst."\n");
        print_parameters(instpath);
    }
}
function print_applications()
{
    local appl, applications, applpath;
    applications=get_vars("/","subnodes");
    foreach appl (applications)
    {
        applpath="/".appl;
        if ( get(applpath."/__type__") == "APPLICATION")
        {
            print("APPLICATION : ".appl."\n");
            print_instances(applpath);
        }
    }
}
print_applications ();


Namespace and Attributes

The PATROL namespace is a hierarchical structure of objects. The hierarchy is made up of the following objects, with each their own attributes.

  • Root object '/'
  • Application class level
  • Application instance level
  • Parameter level

Each of these objects have a set of attributes. Some of them are shown on the slide below. Besides the builtin attributes, the namespace also contains configuration variables and user defined global variables. The local variables are local to a PSL process and not accessible in the namespace. The following figure shows the attributes in the PATROL namespace. 

Attributes in the PATROL namespace 

AttributesNamespace.PNG

Context of a PSL Process

When a PSL process is started, it gets launched in a certain context. The following figure shows the context for PSL processes. 

Context of a PSL process 

PSLProcess.PNG

 

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

BMC PATROL Agent 22.1