BACKEND VARA Objects

Use BACKEND VARA objects to execute commands on Operating Systems (Windows or UNIX) and provide the result as 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:

This page includes the following:

Overview

A BACKEND VARA object definition is made up of the following pages:

  • General Page

    Common to all object types, here you define basic object information and apply custom values to it

  • 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:

  • Version Management Page

    Common to all object types, here you find a list of all versions of the object

  • Documentation Page

    Common to all object types, here you enter information that you consider important to understand the configuration and behavior of the object

This topic describes how to configure the Variables and Commands pages.

To Define a BACKEND VARA Object

Variables Page

  1. In the Variable Settings section, specify how the VARA object is going to access the target system from which it retrieves the values:

    • Agent

      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.

    Note s :

    The following applies for the Agent and Login attributes:

    • You can include PromptSet variables here when using the dynamic reload feature for combo box 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 templates for Backend VARA objects use the PromptSet variables &AGENT# for their specified Agent and &LOGIN# for their login.
  2. Define the Data Types and Formatting.
  3. Define the Script Access.

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:

  1. In the Windows or UNIX sections specify the following:

    • OS Name

      Name of the Operating System on which the Agent runs. Use the value that is shown in the Administrationperspective (Agents page, Software column).

      Allowed characters: *

    • Version

      Version of the Agent that is shown in the Administration perspective (Agents page, Software column).

    • Command

      • Windows only supports PowerShell commands.
      • You can include PromptSet variables here when using the dynamic reload feature for combo box prompts.
      • When you use PromptSet variables in a dynamic Variable object, the Preview feature returns an error. The reason is that the PromptSet variables do not exist in the BACKEND VARA 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)

      This 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.

      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 and runlevel commands.

  2. Click the Preview button to run the command on the target computer and test the results.

  3. To export the content of the preview table to a CSV file, click Export Table. All rows and column are exported. Use this function if you need to further process the content of the CSV file (paste it to a different application for further processing and so on).

  4. To copy one or more rows in the Preview table, select the Copy button. The selected rows are copied to the clipboard and you can paste them to a third party tool (Google, Sheets, Excel, text editor, and so on).

    Note: This function is available only if https is used on the Automic Web Interface .

  5. Save your changes.

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 feature.

Their Agents are specified using the &AGENT# variable. Their login object is specified using the is &LOGIN# variable. 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

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 Lists all paused services. Service name
UC_RB_VARA_SERVICES_RUNNING Windows, Linux, AIX, SunOS Lists all started services. Service name
UC_RB_VARA_SERVICES_STOPPED Windows, Linux, AIX, SunOS Lists all stopped services. Service name
UC_RB_VARA_USERLIST Windows, Linux, AIX, SunOS

Lists all OS users.

Windows: Active Directory for PowerShell must be installed on the relevant computer.

User (account) name

See also: