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 for BMC Helix Operations Management 24.1.

Global Variables


Global variables are accessible from within any PSL process and have the following variables associated with them:

Global variables are typically addressed with their PATH definition in the PATROL agent's object store (also known as heap). Below is a list of global variable examples:

  • /ipAddress
  • /MYAPP/myvar
  • /AgentSetup/defaultAccount
  • /ORACLE/instances

The following sections describe two types of global variables: nonpermanent and permanent.

Nonpermanent Variables

Nonpermanent variables are lost after an agent restarts and use fewer resources than permanent variables. They will remain resident in the agent's memory as long as the agent keeps running. A KM developer can freely assign any name for a global variable using the get() and set() function. The unset() function will remove the variable from the agent's memory. These variables are read-write. 

Using nonpermanent global variables allows developers to pass information from one PSL process to another. Nonpermanent variables must be used when you want someone to enable debug on an instance. In that case, you can set the following variable: 

set("/<MYAPP>/<myinst>/parameterdebug","TRUE"), 

And every parameter can check whether debug was turned on by using get("../parameterdebug");

Permanent Variables

Permanent variables include configuration and system variables and require extra resources when they are executed.

Configuration Variables

Configuration variables are stored inside the configuration database of the agent. They remain resident during the life of the agent even after an agent restart because the agent reloads its configuration database when it is started. 

You normally access these variables by using the pconfig() function call. This call always goes to the configuration database and costs operations more than nonpermanent variables do. Even a read operation will go to the configuration database so that the configuration database can be updated from outside the PATROL Agent (using the OS pconfig command). These variables are read-write.

Warning

Note

You might have noticed that a normal get() operation will work on these kinds of variables also. It will have the same cost as using the pconfig() call.

System Variables

System variables are any variables that are executed on the host OS on demand, for example: /ipAddress.

 

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

BMC PATROL Agent 24.1