You are on page 1of 8

Opcnode command: Use the command opcnode to maintain nodes, node groups, template and category assignments.

It enables assignment of modified or new policies to nodes or node groups. Can add new nodes (using standard parameters) and assign them to node groups. Additionally, users can check the configuration of a node or node group by listing the assigned templates or nodes, change the communication type of a list of nodes, change the machine type of a list of nodes, change the node type of a list of nodes. ---------------------------------------------------------------------------------Operations: -----------add_node | -del_node | -list_nodes | -add_group | -del_group | -list_groups | -assign_templ | -deassign_templ | -list_ass_templs | -assign_node | -deassign_node | -list_ass_nodes | -move_nodes | -list_templs | -chg_nodetype | -chg_commtype | -chg_iptype | -chg_machtype | -chg_id | -del_id | -list_id | -set_physical | -set_virtual | -list_virtual | -assign_cat | -deassign_cat | -list_ass_cat | -assign_pol | -deassign_pol | -list_ass_pols | -assign_pol_group| -deassign_pol_group | -list_ass_pol_groups | -list_attrs | -list_mach_type Attributes: ----------node_name=<node_name> // Node Name node_label=<node_label> // Label of the node node_list='<list>' // List of nodes group_name=<nodegrp_name> // Nodegroup Name group_label=<group_label> // Label of the node group node_hier=<node_hierarchy> // Node Hierarchy Name layout_group=<layout_group> // Layout Group Name net_type=<network_type> // Network Type of the node mach_type=<machine_type> // Machine type of the node comm_type=<comm_type> // Communication type of the node node_type=<node_type> // Node type of the node templ_name=<templ_name> // Template name templ_type=<templ_type> // Template type id=<uuid> // Agent ID dynamic_ip=<yes|no> // Using dynamic IP address cluster_package=<cluster pkg ID> // HA resource group identifier sep=<separator character> // Optional separator for node list ip_addr=<IP Address> // IP address of the node cat_list='<comma separated categories>' // List of categories pol_name=<policy name> // Name of the policy pol_type=<policy type> // Type of the policy version=<policy version> // Version of the policy pol_group=<policy group name> // Name of the policy group mode=<assignment mode> // Mode of policy-to-node assignement

------------------------------------------------------------------------------------add_node: Adds a node to the HPOM Node Bank in the HPOM database. Mandatory attributes are: node_name, net_type, mach_type and group_name. Optional attributes are: node_label, comm_type, node_type, ip_addr, node_hier and layout_group. The node group (specified with group_name) and layout group (layout_group) must already exist because the node will be assigned to it directly after it is added to the database. All other node attributes, which cannot be specified here, are taken from the node defaults in the database for the specified node type. -del_node: Deletes the specified node from the Node Bank and the HPOM database. Mandatory attributes are: node_name and net_type. The node's assignments to node groups will be removed. -chg_commtype: Changes the communication type of one or more nodes. To specify the nodes give a node name or list of node names. This makes it possible to add opcnode as an HPOM Application to the HPOM Application Bank using opcappl command line tool. For more information see the HP Operations Manager for UNIX: Administrator's Reference and man page for opcappl. Mandatory attributes are: either node_name or node_list and comm_type. The node list must be enclosed in ' ' or " ". If net_type is not specified, NETWORK_IP is used. But it is also possible to specify another network type with net_type. -chg_machtype: Changes the machine type of one or more nodes with the network type IP. To specify the nodes give a node name or list of node names. This makes it possible to add opcnode as an HPOM Application to the HPOM Application Bank using opcappl command line tool. For more information see the HP Operations Manager for UNIX: Administrator's Reference and man page for opcappl. Mandatory attributes are: either node_name or node_list and mach_type. The node list must be enclosed in ' ' or " ". The network type of all specified nodes must be NETWORK_IP. It is not possible to specify another network type with net_type. -chg_nodetype: Changes the node type of one or more nodes. To specify the nodes give a node name or list of node names. This makes it possible to add opcnode as an HPOM Application to the HPOM Application Bank using opcappl command line tool. For more information see the HP Operations Manager for UNIX: Administrator's Reference and man page for opcappl. Mandatory attributes are: either node_name or node_list and node_type. The node list must be enclosed in ' ' or " ". If net_type is not specified, NETWORK_IP is used. But it is also possible to specify another network type with net_type. -list_nodes: Prints a list of all nodes in the HPOM database to stdout. The Name, Label, IP-Address, NetworkType, Machine-Type and the Communication-Type is printed for each node. The query can be restricted with the node_list and group_name attributes (if both are specified, all nodes meeting at least one of the criteria will be printed). Additionally you can restrict the results with the net_type, mach_type and comm_type attributes. -add_group: Adds a node group to the HPOM Node Group Bank in the HPOM database. Mandatory attributes are: group_name. Optional parameters are: group_label. It is then possible to assign nodes and templates to the node group.

-del_group: Deletes the specified Node Group from the HPOM Node Bank in the database. The node group must not contain any nodes. Mandatory attributes are: group_name. -list_ass_nodes: Lists all nodes which are assigned to an HPOM Node Group. -list_groups: Prints a list of all node groups in the HPOM database to stdout. The Name, Label and Description will be printed for each node group. -assign_templ (deprecated): Assigns a template or template group to a node or node group. Mandatory attributes are: templ_name, templ_type and group_name or templ_name, templ_type, node_name and net_type. This option is deprecated. Use -assign_pol instead. -deassign_templ (deprecated): Deassigns a template or template group from a node or node group. Mandatory attributes are: templ_name, templ_type and group_name or templ_name, templ_type, node_name and net_type. This option is deprecated. Use -deassign_pol instead. -list_ass_templs (deprecated): Prints a list to stdout of all assigned templates and template groups for a node or node group. The mandatory attributes are: group_name or node_name and net_type. This option is deprecated. For policies, use -list_ass_pols instead. For policy groups, use -list_ass_pol_groups instead. -list_templs: Prints a list of all templates and template groups in the HPOM database to stdout. -assign_node: Assigns a node to a node group. Mandatory attributes are: group_name, node_name and net_type. -deassign_node: Deassigns a node from a node group. Mandatory attributes are: group_name, node_name and net_type. -move_nodes: Moves a list of nodes into a new Layout Group. Mandatory attributes are: node_list and layout_group. The Layout Group has to exist. Optional parameters are net_type (default is NETWORK_IP) and node_hier (default is NodeBank). -chg_id: Change unique ID of given node. Mandatory attribute is: node_name. The network type of specified node must be NETWORK_IP. It is not possible to specify another network type with net_type. -del_id: Removes unique ID of given node. Mandatory attributes are: either node_name or node_list. The node list must be enclosed in ' ' or " ". The network type of all specified nodes must be NETWORK_IP. It is not possible to specify another network type with net_type. -list_id:

Lists unique ID of given node. Mandatory attributes are: either node_name or node_list. The node list must be enclosed in ' ' or " ". Only nodes with network type NETWORK_IP will be listed. -chg_iptype: Changes dynamic behaviour of IP address. Mandatory attributes are: either node_name or node_list and dynamic_ip. The node list must be enclosed in ' ' or " ". The network type of all specified nodes must be NETWORK_IP. It is not possible to specify another network type with net_type. -chg_machtype: Changes type of given machine. Mandatory attributes are: node_name and mach_type. -set_virtual Changes the node given by node_name to virtual. It needs at least one of node_list or cluster_package parameters. The first one will assign the given physical nodes to the virtual one. The later will assign the HA resource group to the virtual node. If one of the parameters is not given its parameters won't be changed. Please note that you might end up without assigned physical nodes when the node_list wasn't initially given. Please also note that all nodes given by node_name and node_list must be of the same machine type and that the node given by node_name must already exist. -set_physical: Changes the node back to a physical one. The only parameter used is node_name. The physical nodes are deassigned and the HA resource group name (aka cluster_package) will be removed from the virtual node. -list_virtual: Lists the HA resource group name and the assigned physical nodes to the virtual node given by node_name. -assign_cat: Assign categories to nodes. Mandatory attributes are: cat_list and node_list. Note: categories must be comma separated. -deassign_cat: Deassign categories from nodes. Mandatory attributes are: cat_list and node_list. Note: categories must be comma separated. -list_ass_cat: Lists all categories which are assigned to node. For each assigned category it is shown, if category is assigned to node directly or via policy. Mandatory attribute is: node_list. -list_attrs: Lists number of CPUs, OS attributes and MAC address per node. This option is applicable only for NETWORK_IP type of nodes. Mandatory attribute is: node_name. -list_mach_type Lists all possible values for the mach_type attribute. -assign_pol: Assigns the specfied policy to a node. If attribute version is not specified, the latest existing version is assigned. See description of mode attribute for different assignment modes. Mandatory attributes are: node_name, net_type, pol_name, pol_type. Optional attributes are: version, mode. -deassign_pol: Deassigns the specfied policy from a node. Mandatory attributes are: node_name, net_type, pol_name, pol_type, version.

-list_ass_pols: Lists all policies assigned to a node. This options will list only policies that have been directly assigned to the node. If a policy is assigned to the node through a policy group, it will not be displayed here. Mandatory attributes are: node_name, net_type -assign_pol_group: Assigns the specfied policy group to a node. Mandatory attributes are: node_name, net_type, pol_group -deassign_pol_group: Deassigns the specfied policy group from a node. Mandatory attributes are: node_name, net_type, pol_group -list_ass_pol_groups: Lists all policy groups that have been assigned to a node. Mandatory attributes are: node_name, net_type

Attributes
node_name: Specifies the node name. This can be the full qualified node name or the short version. node_label: The label is the 'name' that appears in the node's icon in the HPOM operator GUI. When no label is specified, the node_name is shown applies. node_label is an optional attribute. group_name: Specifies the name of a node group. group_label: The label is the 'name' that appears in the node's icon in the HPOM operator GUI. When no label is specified, the group_name applies. group_label is an optional attribute. net_type: net_type specifies the network type for a node in the HPOM Node Bank. Use this attribute to specify a node. This is mandatory in all operations that handle nodes, except chg_commtype, chg_machtype and chg_nodetype. Possible network types are: NETWORK_NO_NODE NETWORK_IP NETWORK_OTHER NETWORK_UNKNOWN PATTERN_IP_ADDR PATTERN_IP_NAME PATTERN_OTHER

mach_type: mach_type specifies the machine type for a node in the HPOM Node Bank. This attribute is mandatory for the add_node and chg_machtype operation. If a new introduced platform is not yet known by opcnode, the platform number will be used. Machine types are defined in AgentPlatform files. The code scheme does not directly corresponds to directories present or to names used in Admin GUI or to names used in inst.sh. Here is the list for version 9.01: MACH_BBC_SOL_SPARC MACH_BBC_HPUX_IPF32 MACH_BBC_HPUX_PA_RISC MACH_BBC_WIN2K3_X64 MACH_BBC_WINXP_IPF64 MACH_BBC_LX26RPM_X64 MACH_BBC_LX26RPM_X86 MACH_BBC_WINNT_X86 MACH_BBC_OTHER_NON_IP MACH_BBC_LX26RPM_IPF64 MACH_BBC_SOL10_X86 MACH_BBC_AIX_PPC MACH_BBC_AIX_K64_PPC MACH_BBC_OTHER_IP comm_type: comm_type specifies the communication type for a node. This attribute is mandatory when changing the communication type of one or more nodes. When adding a node it is an optional. Possible communication types are: COMM_UNSPEC_COMM COMM_BBC node_type: node_type specifies the node type for a node. This attribute is mandatory when changing the node type of one or more nodes. Possible node types are: DISABLED CONTROLLED MONITORED MESSAGE_ALLOWED node_list: node_list specifies the names of the nodes whose communication type, machine type or node type should be changed. The node names must be separated by blanks or separators, defined with sep, and enclosed in ' ' or " ". node_list is used for the operation chg_commtype, chg_machtype, chg_nodetype, assign_cat, deassign_cat and list_ass_cat. If no network type is specified, NETWORK_IP is used for all nodes. But it is also possible to specify another network type with net_type that is then used for all nodes in the node list. templ_name: templ_name specifies the name of a template or template group. templ_type: templ_type specifies the type of a template. To specify a template or template group, the name and the template type must be given. Possible template types are:

TEMPLATE_GROUP CONSOLE_TEMPLATE OPCMSG_TEMPLATE LOGFILE_TEMPLATE MONITOR_TEMPLATE SNMP_TEMPLATE EC_TEMPLATE SCHEDULE_TEMPLATE id: id specifies the agent ID of the given node. dynamic_ip: dynamic_ip specifies if the node address should be changeable by DHCP. cluster_package: cluster_package specifies the name of the new HA resource group. This parameter can only be used with the operation set_virtual. sep: sep specifies optional separator character for node_list. Default is blank. ip_addr: ip_addr specifies the IP Address of the node in "dot" notation (for example: ip_addr=15.1.2.3). Specifying the IP address allows to use a specific IP address when adding a node with mutliple IP addresses. cat_list: cat_list specifies optional separator character for node_list. Default is blank. pol_name: pol_name specifies the name of the policy to be (de)assigned to a node. A policy is uniquely identified by its name, type and version. pol_type: pol_type specifies the type of the policy to be (de)assigned to a node. Policy types registered on the Management Server can be obtained using the command line tool opcpoltype with option -list. A policy is uniquely identified by its name, type and version. version: version specifies the version of the policy to be (de)assigned to a node. Version must be in <major>.<minor> form, where both <major> and <minor> are numbers between 1 and 9999 inclusively. A policy is uniquely identified by its name, type and version. pol_group: pol_group specifies the name of the policy group to be (de)assigned to a node. Full path of the policy group must be specified e.g. /a/b/c.

mode: mode determines the way a policy is assigned to a node. The possible values of this attribute are: FIX (default) MINOR_TO_LATEST LATEST Option FIX assigns the specified policy version to the node. If option MINOR_TO_LATEST is used the highest minor version that has the specified major version is assigned to the node. If mode has value of LATEST, the absolute highest version of the policy is assigned to the node. In MINOR_TO_LATEST and LATEST cases, assignment changes automatically as new versions that satisfy the criteria are created. In case of MINOR_TO_LATEST, assignment will be updated if a new policy version which has the same major number as the originally assigned one is created. With LATEST, the assignment updates as soon as the new highest policy version is created. This command exits with value 0 after successful operation. In case of errors, 1 is returned and descriptive text sent to standard error. This command can only be issued by the root user. To enable other users to execute this command, the system administrator must change the file's attributes and copy it to a location which is included in the $PATH variable.

You might also like