Develop > Command-Line Interfaces > opr-node Command-Line Interface

opr-node Command-Line Interface

You can use the opr-node command-line interface (CLI) to manually add, modify, list, or delete nodes in the RTSM. You can also add a node to a node group, and add, modify, and delete node groups. This tool can act on CIs of the type node, computer, nt, unix and IpAddress.

You can use this tool instead of synchronizing nodes from another OM server or running OMi discovery tools. In automation cases when no real user is online, you can also use this tool to manage nodes.

For more information, see Monitored Nodes.

Location

<OMi_HOME>/opr/bin/opr-node[.bat|.sh]

You can run opr-node on a gateway or a data processing server. The server processes must be running.

Synopsis

opr-node -help | -version | -example |<CONNECTION_INFO> <operation>

Options

Exit Status

Exit Status

Description

Output

0

Successful completion of the requested operation

No output.
1

Failure of the requested operation

An error message stating why the operation failed, followed by the tool's help text.
300‑399

HTTP Redirection (300-399)

An error message stating the HTTP error number and description.

For more information about HTTP error status values, see publicly available HTTP documentation.

400‑499

HTTP Client Error (400-499)

500‑599

HTTP Internal Server Error (500-599)

Restrictions

  • Permissions. The user running the opr-node command-line interface must be an OMi user with Monitored Nodes access rights. For more information, see Monitored Nodes and Users, Groups, and Roles.

    Non-admin users also need the following file permissions to operate this command-line tool:

    File Windows Permissions Linux Permissions
    <OMi_HOME>/conf/TopazInfra.ini read r
    <OMi_HOME>/log/opr-clis.log full control rw

    <OMi_HOME>/log/opr-pgctl.log

    Note: This file is not available on gateway server systems.
    full control rw
    <OMi_HOME>/conf/encryption.properties read r
    <OMi_HOME>/conf/seed.properties read r
  • Examples

    This section shows a number of examples you can use as a starting point for developing your own opr-node commands.

    • List all OM nodes from RTSM:

      opr-node.sh -username user -password passwd -list_nodes -all
    • Add node mynode to RTSM as part of node group mygroup (IP address taken from name service):

      opr-node.sh -username user -password passwd -add_node -node_name
      mynode.example.com -ci_name mynode -os_type "Windows Server 2012 (6.2)"
      -processor_family x86_64 -ci_type nt -node_group mygroup

    • Add node mynode to RTSM as part of node group mysubgroup that is located under myparentgroup in the node group hierarchy (IP address taken from name service):

      opr-node.sh -username user -password passwd -add_node -node_name
      mynode.example.com -ci_name mynode -os_type "Windows Server 2012 (6.2)"
      -processor_family x86_64 -ci_type nt -node_group "/myparentgroup/mysubgroup"

    • Modify CI name node (display_label) of mynode in RTSM and add it to node group mygroup (all other attributes stay the same):

      opr-node.sh -username user -password passwd -modify_node -node_name
      mynode.example.com -ci_name MYNODE -node_group mygroup

    • Modify mynode in RTSM and remove it from node group mygroup:

      opr-node.sh -username user -password passwd -modify_node -node_name
      mynode.example.com -node_group mygroup -remove_from_node_group

    • Modify CI name (display_label) of mynode in RTSM (all other attributes stay the same):

      opr-node.sh -username user -password passwd -modify_node -node_name mynode.example.com -ci_name MYNODE

    • Modify mynode in RTSM and add IP address 192.168.1.123:

      opr-node.bat -username user -password passwd -modify_node -node_name mynode.example.com -ip_addrs 192.168.1.123 -add_ip

    • Modify mynode in RTSM and remove IP address 192.168.1.123:

      opopr-node.sh -username user -password passwd -modify_node -node_name mynode.example.com -ip_addrs 192.168.1.123 -del_ip

    • Modify mynode in RTSM and replace current IP address with 1.2.3.4:

      opr-node.bat -username user -password passwd -modify_node -node_name mynode.example.com -ip_addrs 1.2.3.4

    • Modify mynode in RTSM and replace current primary DNS name to mynewnode:

      opr-node.bat -username user -password passwd -modify_node -node_name mynode.example.com -new_node_name mynewnode.example.com

    • Add or override existing mynode and set its IP address to 1.2.3.4:

      opr-node.bat -username user -password passwd -add_node -node_name mynode.example.com -ip_addrs 1.2.3.4

    • Delete node with CI ID 11112222333344445555666677778888 from RTSM:

      opr-node.sh -username user -password passwd -del_node -ci 11112222333344445555666677778888

    • List all node groups including ID and description:

      opr-node.bat -username user -password passwd -list_node_groups -show_details

    • Add a new top-level node group called newTopLevelNG1:

      opr-node.bat -username user -password passwd -add_node_group -node_group newTopLevelNG1 -v

    • Add a new node group called newNG3 to the existing node group testNG2:

      opr-node.bat -username user -password passwd -add_node_group -node_group newNG3 -parent_node_group testNG2 -v

    • Modify the name of the node group newNG3 (with parent node group testNG2) to changed_newNG3:

      opr-node.bat -username user -password passwd -mod_node_group -node_group newNG3 -parent_node_group testNG2 -new_name changed_newNG3 -v

    • Delete the node group newNG3 (with parent node group testNG2):

      opr-node.bat -username user -password passwd -del_node_group -node_group newNG3 -parent_node_group testNG2 -v

    • List all node groups containing the node with the primary DNS name test.example.com:

      opr-node.bat -username user -password passwd -list_containing_node_groups -node_name test.example.com -v

    • List all node groups containing the node with the ID 11112222333344445555666677778888:

      opr-node.bat -username user -password passwd -list_containing_node_groups -ci_id 11112222333344445555666677778888 -v