Skip to content

User commands

User commands allow you to execute arbitrary shell commands from Resource Manager. A user command is executed in its appropriate container rather than the remote device unless the command explicitly uses SSH to connect to the remote device.

You can define and run user commands on a device or organizer (device class, system, group, location, or component group). You also can define commands globally. The User Commands menu bar shows the various functions that can be used in the User Commands screen.

Defining global user commands

Global commands appear in the Commands list of options located at the top of the Devices page.

To define global user commands:

  1. From the navigation menu, choose Advanced > Settings.
  2. In the left panel, choose Commands.
  3. In the Define Commands area, click the action menu and choose Add User Command.
  4. In the Add User Command dialog box, specify a name for the command, and then click OK. Only letters, numbers, and underscores are allowed in command names. Spaces are not allowed.
  5. In the Define Commands page, specify a description of what the command will do.
  6. In the Command section, enter the TALES expression-based command you want to run on the device.
  7. Enter your system account password for confirmation, and then click Save. The command is saved and added to the commands menu.

Global commands also can be edited from a specific device. Changes to a global command from a device are not limited to that device.

Running global user commands

To run a global user command, select one or more devices in the devices list, and then select a command from the Commands list of options.

Defining user commands for a single device

To define a user command for a device:

  1. From the navigation menu, choose INFRASTRUCTURE.
  2. In the device list, click a device name.
  3. In the left panel, choose Device Administration.
  4. In the User Commands area, click the Add a User Command icon.
  5. In the Add New User Command dialog box, specify the following information about the user command:
    • Name - Name of the user command.
    • Description - Description of what the command will do.
    • Command - TALES expression-based command you want to run.
    • Confirm Password - Enter your system account password for confirmation.
  6. Click Submit. The command is saved and added to the user commands menu.
  7. *Optional: *Test the command by selecting the command from the list and clicking the Run icon.

Running user commands for a single device

To run a command defined for a single device:

  1. Navigate to the INFRASTRUCTURE > DEVICES page.
  2. Click the device name in the device list to open the Device Overview page.
  3. Select the command from the Commands list of options located at the bottom of the page.

Defining user commands for all devices in an organizer

To define a user command for all devices in an organizer:

  1. On the INFRASTRUCTURE page, select a device organizer in the devices hierarchy; for example, /Server/Linux.
  2. Click Details.
  3. In the left panel, select Device Administration.
  4. In the User Commands area, click the Add a User Command icon.

  5. Enter the following information about the user command:

    • Name - Name of the user command.
    • Description - Description of what the command will do.
    • Command - TALES expression-based command you want to run.
    • Confirm Password - Enter your system account password for confirmation.
  6. Click Submit. The command is saved and added to the user commands menu.
  7. *Optional: *Test the command by selecting the command from the list and clicking the Run icon.

Running user commands for devices in an organizer

To run a command defined for devices in an organizer:

  1. On the INFRASTRUCTURE page, select a device organizer.
  2. Select one or more devices in the filtered view.
  3. Select the command from the Commands list located at the top of the page.

Example

This example shows how to create an echo user command. You can see the use of TALES expressions in the definition of this command.

  1. Add a command called "echoDevice"

  2. In the command definition, echo the name and IP address of the device:

    echo name = ${here/id} ip = ${here/manageIp}
    

    In a TALES expression, here is the object against which the expression is executed. Some TALES expressions in the system have other variables (such as evt for event, and dev or device for the device). For more information, see TALES expressions.

  3. Select a device and then run the command.

  4. Edit the command to add more information:

    echo name = ${here/id} ip = ${here/manageIp} hw = ${here/getHWProductName}
    
  5. Run the command against a group of devices and view the command outputs.