Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

Use standard and custom commands

You can use IIoT Core Services to run commands remotely on your geographically dispersed gateway devices.

You can use standard commands for common operations or create custom commands to add customized functionality.

Start a task

You can run a standard or a custom command on your gateway from IIoT Core Services by initiating a task.

Procedure

  1. In the IIoT Core Services UI, select the Device tab, then Devices.

  2. For a given device, click the Task button.

  3. In the Start Task window, open the Select Command list to select a command.

    Custom commands are prefixed with the word Custom.Make the necessary parameter selections in the Environment Variables section.These are the available standard commands:
    Standard commandsDescription
    rebootReboot the gateway device.
    network informationGet network information, including firewall and port information.
    device infoGet device information for the gateway device, including number of core devices, memory, and disk size.
    resource usageView usage of computing resources (CPU, memory, disk space).
    get firewall rulesShow the current firewall rules in the gateway.
    add port to firewall rulesEnable a port to accept traffic to the gateway. This command is useful when you want to load and run your own container with an application that requires a port to be open on the gateway.
    NoteAn open port may expose the gateway to cyber exploits or attacks. Follow network security best practices or consult your IT security administrator before using this command.
    remove port from firewall rulesDisable traffic to a specified port on the gateway. Use this command to reverse the Add port to firewall rules command when the corresponding container application is no longer needed. This command helps reduce the security risk.
    list containersList all running containers.
    purge container volumeClean up data in the container volume on the gateway.
  4. Click Confirm.

Results

The task is created. To see the newly created task and its status, click the Tasks sub-tab.

Delete a task

You can use IIoT Core Services to delete a task from the Task list.

NoteOnce the intended command has been transmitted to the gateway, it will be executed and cannot be undone. The Delete function simply removes the corresponding task from the task repository in IIoT Core Services.

Procedure

  1. In the IIoT Core Services UI, select the Device tab, then Tasks.

  2. To delete a task, select the Actions menu ( GUID-860D1A4B-E960-45FE-81C1-4D6E31957DF8-low.png ), then Delete.

  3. Select Delete to confirm deletion of the task or Cancel to keep the task.

Results

If the task is in the Started or Ongoing state when you select Delete, the task is interrupted and terminated before it is sent to the gateway. If the task is in the Success state, it is removed from the Task list.

View tasks and task status

You can view current tasks running on a gateway device along with their status in the IIoT Core Services UI.

The task status overview is found on the Tasks sub-tab of the Device tab. The task status is found in the Status column.

The following table lists the available tasks statuses.

Task statusDescription
QueuedA task is placed in a queue when a condition, such as a lost connection, is preventing the task from being transmitted to the gateway device.
RunningThe task is running and active.
SuccessThe task has successfully completed.
FailedThe task encountered an error and did not complete. Restart the task.
CanceledThe task has been cancelled while in Queued and Running state.

Click the task to view the task output, which is the output produced on the gateway device.

Create a custom command

You can create a custom command in IIoT Core Services by writing a Shell script or by uploading a file that runs the needed functionality.

Procedure

  1. In the IIoT Core Services UI, select the Device tab, then Commands.

  2. Click the + Add button.

  3. Complete the needed information on the Create Command page.

    FieldDescription
    NameEnter a descriptive name for the custom command. This name appears in the Select Task list when you start a command.
    Version (Optional)Specify a version number of your choice to track the command version.
    Description (Optional)Provide a convenient description, such as the purpose of the command.
    Timeout SecondsSpecify how long the command should try to execute before canceling the attempt.
    Type (Optional)

    Specify the runtime (Shell, Python, or custom).

    If you select a custom type, click the Container Image Type list to select from available images in the software repository.

    NoteMake sure the image has been pushed to the Docker Trusted Registry beforehand.
  4. (Optional) Add environment values if needed by clicking the + Add button.

    FieldDescription
    Key Names

    Name of a parameter to appear in the Environment Variables area of the Start Task window.

    Example: Set Start Time

    Default Value

    Default value for the new parameter.

    Description

    Helpful information about the command, such as the purpose of the parameter.

  5. In the Upload window, upload a container application, either by using drag-and-drop or by browsing to select the file.

    The file name appears in the list right above the Upload window along with other options.
  6. Under File Path, specify the file path of the container application.

  7. In the Entry Point Shell Script window, enter the shell commands needed to launch the container that you are attaching.

  8. Click Save.

Results

The custom command is sent to the gateway and is added to the Commands page in IIoT Core Services.

Edit a custom command

You can edit a custom command in the Commands inventory in IIoT Core Services.

NoteYou cannot edit standard commands.

Procedure

  1. In the IIoT Core Services UI, select the Device tab, then the Commands tab.

  2. To edit a custom command, select Edit from the Actions menu ( GUID-860D1A4B-E960-45FE-81C1-4D6E31957DF8-low.png ) for that command.

  3. Make the necessary edits.

  4. Click Save.

Results

The edits are saved in the repository and the custom command information is updated in the Commands list.

Delete a custom command

You can delete a custom command from the Commands inventory in IIoT Core Services.

NoteYou cannot delete standard commands.

Procedure

  1. In the IIoT Core Services UI, select the Device tab, then the Commands tab.

  2. To delete a custom command, select Delete from the Actions menu ( GUID-860D1A4B-E960-45FE-81C1-4D6E31957DF8-low.png ) for that command.

  3. Confirm the deletion by clicking Delete, or click Cancel to keep the command in the inventory.

Results

The deleted custom command is removed from the Commands list.