BACKEND VARA Objects
As a developer and object designer, you define BACKEND VARA objects to execute a command on an operating system (Windows or UNIX) and supply the result in the form of values that are shown in columns. You can store the commands for different operating systems, system names, and versions in one BACKEND VARA object. When the VARA object is resolved, the correct command of the Agent in question is automatically selected and executed.
Notes:
- You need a specific privilege to create and modify BACKEND VARA objects.
- The VAR_TIMEOUT (UC_HOSTCHAR_DEFAULT - Host Characteristics) and BACKENDVAR_MAX_ROWS in the UC_SYSTEM_SETTINGS - Systemwide Settings are also available for BACKEND VARA objects.
- PromptSet variables are supported in select fields for BACKEND, EXEC, FILELIST, SEC_SQLI, SEC_SQL, SQLI, SQL, and XML variable types. Using PromptSet variables is necessary when using the Dynamic Reload (Combobox Prompts) feature.
-
PromptSet variables are supported in select fields for BACKEND, EXEC, FILELIST, SEC_SQLI, SEC_SQL, SQLI, SQL, and XML variable types. Using PromptSet variables is necessary when using the Dynamic Reload (Combobox Prompts) feature.
This page includes the following:
Defining BACKEND VARA Objects
A BACKEND VARA object definition is made up of the following pages:
- General Page
-
Variables
Here you define the object-specific settings. Some sections on this page are common to all VARA objects and are described for all of them in dedicated topics:
- Variable Settings, see below
- Parameters
- Data Types and Formatting
- Script Access
- Client 0 VARA Objects in Other Clients
- Preview, see below
- Version Management Page
- Documentation Page
Variable Settings Section
Specify how the VARA object is going to access the target system from which it retrieves the values.
-
The Agent where the command is executed.
-
Apply Task Agent
Applies the Agent of the task that uses the VARA object. If the task does not have an Agent (such as, for example, in Script objects), the Agent of the VARA object is used. If neither the VARA object nor the task has an Agent, an error occurs.
-
Login (LOGIN) object that allows the VARA object to access the target operation system.
-
Apply Task Login
Applies the login of the task that uses the VARA object.
If the task does not have a Login object assigned, (such as, or example, in Script objects), the Login assigned to the VARA object is used. If neither the VARA object nor the task has a Login object, an error occurs.
Notes:
The following applies for the Agent and Login attributes:
- You can include PromptSet variables here when using the Dynamic Reload (Combobox Prompts) feature for Combobox prompts. When you use PromptSet variables in a dynamic Variable object, the Preview feature returns an error. This is because the PromptSet variables do not exist in the dynamic Variable object. However, the PromptSet variables will be resolved when objects including the PromptSet are executed.
- The supplied Predefined BACKEND VARA Objects (Templates) for Backend VARA objects use the PromptSet variables &AGENT# for their specified Agent and &LOGIN# for their login.
Commands Page
BACKEND VARA objects execute exactly one command on the target operating systems. This applies to both Windows and Unix. You enter the command on this page:
-
OS Name
Name of the Operating System the Agent is running on. Use the value that is shown in the Administration perspective perspective (Agents page, Software column). You can use the wildcard character "*".
-
Version
Version of the Agent that is shown in the Administration perspective (Agents page, Software column).
-
Windows only supports PowerShell commands.
You can include PromptSet variables here when using the Dynamic Reload (Combobox Prompts) feature for Combobox prompts. When you use PromptSet variables in a dynamic Variable object, the Preview feature returns an error. This is because the PromptSet variables do not exist in the dynamic Variable object. However, the PromptSet variables will be resolved when objects including the PromptSet are executed.
-
Column format
Defines how the result should be split into columns. Use the following syntax:
column name:start position(length) [;column name:start position(length) . . .]
Where:
- Column name = Name of the column, user-defined
- Start position = Position of the character where the column starts.
- Length = Number of characters that determines the column's size.
Important!
- Semicolons (;) must only be used between several columns. They are not required at the end of the complete definition.
- You must define at least one value column (minimum requirement).
Example:
process:1(20);pid:25(10)
The previous example splits the output of the command into two columns. The process column starts with the first character and has a length of 20 characters. "pid" starts at character 25 and is 10 characters long.
Notes:
-
Windows
-
The commands are not batch lines. You must define a specific program to be executed.
Examples:
Listing the directory: cmd /c dir C:\temp
Ping: ping localhost -n 10
-
The return code is automatically set to 1 if a command results in an error. In this case, if you use the VARA object within a script, the script aborts. To avoid it, you can append
& set ERRORLEVEL=0
at the end of the Windows command. For example:cmd /c dir /b /o:d C:\temp\*.xml & set ERRORLEVEL=0
This command lists the files of a directory. The return code is always 0, regardless of whether files are found or not. This way you can ensure that the tasks using this VARA object do not abort.
-
-
Unix
The user who is specified in the Login object must have the right to execute the corresponding command.
-
Windows and Unix
In the OS Name and Version columns you can filter for the names (such as a particular UNIX derivative) and OS version. The suitable line for the specified Agent is automatically used when the VARA object is executed. The first entry that matches the OS, OS name, and version of the Agent is used.
-
Linux
Root rights are required for the
chkconfig
andrunlevel
commands.
Preview
You can run the command on the defined computer and test the results.
Predefined BACKEND VARA Objects (Templates)
Predefined BACKEND VARA objects are supplied in Client 0 in the UC _RB_VARIABLES folder. They can be used for the Dynamic Reload (Combobox Prompts) feature. Their specified Agent is the variable name &AGENT#, and their login is &LOGIN#. Ensure that you use these names for the PromptSet variables of the required elements.
Object name | Operating System | Function | Columns |
---|---|---|---|
UC_RB_VARA_PROCESSLIST | Windows, Linux, AIX, SunOS, HP-UX |
Lists the active processes. The maximum ProcessID length may differ depending on the UNIX system used. Adjust the column length in the Variable object if necessary. |
ProcessID Process name |
UC_RB_VARA_SERVICES_PAUSED | Windows, Linux, AIX, SunOS, HP-UX | Lists all paused services. | Service name |
UC_RB_VARA_SERVICES_RUNNING | Windows, Linux, AIX, SunOS, HP-UX | Lists all started services. | Service name |
UC_RB_VARA_SERVICES_STOPPED | Windows, Linux, AIX, SunOS, HP-UX | Lists all stopped services. | Service name |
UC_RB_VARA_USERLIST | Windows, Linux, AIX, SunOS, HP-UX |
Lists all OS users. Windows: Active Directory for PowerShell must be installed on the relevant computer. |
User (account) name |
See also: