pw group

To view group information, run the following command: pw group

Example:

Because the child group name is duplicated, if you want to edit, list, or delete the child group that is under the parent group, you must specify the path as /parent/child.

If the group name is unique, you need to specify only the group name to edit, list, or delete the group. For example, to edit the test group in the example, you only need to specify test because the test group name is unique.

The following are the available pw group commands:

Note

The complete path of the group must be given for pw group delete, pw group list and pw group add_monitor, pw group delete_monitor, pw groupdevice_add, and pw group device_delete commands if the group exists below the parent level.

pw group add

The pw group add command adds a group to the Group Matrix folder. If required, add a description for the group that you are creating.

pw group add <group_name> 

[-d <group_description> -tag <tag_value>]

To add a group test1, with a description testing and tag value new_groups, run the following command:

pw group add test1 -d testing -tag new_groups

<group_description>—Description of the group that you create

<tag value> — The tag value specified are associated with the group being created

pw group delete

The pw group delete command deletes the group specified from the Group Matrix folder and the rule-based groups.

To delete a group, run the following command:

pw group delete <group name> 

Example: pw group delete test

The command deletes a group called "test."

pw group device_add

Use the pw group device_add command to add a device to an existing group in the Infrastructure Management system.

Device_name is the actual name of the device used in Infrastructure Management. The IP address of the device cannot be used as device_name. If the group specified does not exist, the system returns a bad status code and an appropriate message. Adding the device causes all monitors under that device to be added to the group (and the device).

Note

This command replaces the pw addmo command.

pw group device_add <group name> <device Name1> [device Name2]...[device NameN] 

For example, to add devices "test1" and "test2" to a group called "test," run the following command:

pw group device_add test test1 test2

pw group device_delete

The pw group device_delete command deletes devices from the group specified. Deleting a device causes all monitors under that device to be deleted from the group, including the device.

Note

This command replaces the pw delmo command.

pw group device_delete <group name> <device Name1> [device Name2]...[device NameN] 

For example, to delete devices "test1" and "test2" from a group called "test," run the following command:

pw group device_delete test test1 test2

pw group add_subgroup

The pw group add_subgroup command adds the specified group as a subgroup to the specified parent group.

Adding subgroups to an existing parent group is allowed if the parent group contains other groups or if the parent group is empty.

pw group add_subgroup -p <parent_group>[-d <group_description>] -c <child_group1>[-c <child_group2> -c <child_group3>]

Note

When adding a child group as a subgroup, the child group must already exist. The pw group add_subgroup command will not create the group.

For example:

  • To add a subgroup named "child" to an existing parent group named "parent," run the following command:
    pw group add_subgroup -p parent -c child
  • To add a set of subgroups called as "child1," "child2," and "child3" to a parent group "parent," run the following command:

      pw group add_subgroup -p parent -c child1 -c child2 -c child3

Use the [-d <group_description>] option only when you are creating a parent group.

pw group delete_subgroup 

The pw group delete_subgroup command deletes the group specified from the parent.

For example: To delete subgroup1 from parent1, run the following command:

pw group delete_subgroup -p <parent_group> -c <child_group>

When more than one group have same subgroup name, you must  specify the full path. For example, if  group1 and group2 have the same subgroup name "child", then you must specify the following path:
group1/parent1/child and  group1/parent2/child.

 The following scenarios exists for the subgroups with the same name in more than one group:

  • If  the subgroup has same group instance (same ID) under two different parent groups, then the pw group delete_subgroup -p /group1/parent1 -c child command will work and the following message is displayed:
    Successfully removed subgroup "child" from parent "/group1/parent1"
  • If the subgroup has different group instances (different IDs) under two different parent groups, then the pw group delete_subgroup -p /group1/parent1 -c child command will not work and the following message is displayed:
    Multiple instances of Group Name, use full path for Group Name 

The pw group delete_subgroup command does not delete the group. The command only removes the parent-child relationship. When removing subgroups from parent groups after all the parent groups are removed, the subgroup will be at the  top-level group.

 To  delete a group at the top level or at the child node, you must run the following  pw group delete command:

pw group delete /group1/parent1/child
pw group delete /group1/parent/child

 This command deletes the group from the database

pw group add_rule_based groups

Groups can also be created by specifying rules; these groups are known as rule-based groups. Rule-based groups are dynamic groups. Run the following command to add rule based groups:

pw group add_ rule_based <groupName>[-d <description>][-tag <tag_value>]-configuration <group|device|monitor> -name_pattern "<pattern_string>" -tag_pattern "<pattern_string>"[-p <parent group name> -dp <description for parent group>][-mtype <mtype_name1>-mtype<mtype_name2> ...... -mtype <mtype_nameN>]

pw group edit_rule_based groups

Run the following command to edit rule-based groups:

pw group edit_ rule_based <groupName>[-d <description>][-tag <tag_value>] -configuration < group|device|monitor > -name_pattern "<pattern_string>" -tag_pattern "<pattern_string>" [-p <parent group name> -dp <description for parent group> -add_mtype <mtype_name1> -add_mtype <mtype_nameN> -add_mtype all|-remove_mtype <mtype_name1> -remove_mtype <mtype_nameN> -remove_mtype all ]

<groupName>—This option allows you specify a name (maximum length of 60 characters with no spaces) for the new group.

<group|device>—This option allows you to choose between group name or device name. This option is mandatory.

Tag <pattern_string>—This option allows you to specify multiple name-value pairs, text, or both (name-value pair and text) and allows you specify group objects in different forms. Special characters &"/<>' in the tag field are not allowed.

Name <pattern_string>—Instances belonging to any of the matching groups or devices will automatically be included as the members of this group. This supports all the Java Regular Expression pattern matches.

Note

  • The -tag_pattern or -name_pattern option must be present in the command.
  • The value of the <pattern_string> fields must be specified within double quotes(" ").


<mtype_nameN>—This option allows you to specify the monitor types that must be associated with the group. If the -mtype option is not present, by default, all monitor types will be considered.

Tag <tag_value>—This option allows you to provide a tag value to the group.

-p <parent group name>—This option allows you to add a rule-based group as a subgroup of another group. If the parent group does not exist and if it is not a subgroup itself, then the parent group will be created and the rule based group will be added to it. Provide the absolute path separated by a slash in case of hierarchical parent group. If the rule based group is to be added to a hierarchical parent group, then that hierarchical parent group must exist.

Note

When adding a rule based group to an existing parent group, the description provided for the parent must not be updated by the rule based group, because there is no option to edit the parent group. For example, when you run the command pw group add_rule_based ABC -d childgroup -configuration monitor -name_pattern vm -mtype "WindowsProcess" -p India and add the child to the parent group india with the command pw group add_rule_based XYZ -d childgroup -configuration monitor -name_pattern vm -mtype "WindowsProcess" -p India -dp "country," the parent (india) description must be blank and not updated with country.


dp <description for parent group>—This option allows you to add a description to the parent group. The description will be added only if the parent group does not exist.

-add_mtype <mtype_nameN>—This option is valid only for editing a rule based group. This option allows you to add new monitor types that have instances. This option also accepts all as the value, which selects all monitor types that have instances present in the computer.

-remove_mtype <mtype_nameN>—This option is valid only for editing a rule based group. This option allows you to remove existing monitor types from the group. This option also accepts all as the value, which removes all the existing monitor types from a group.

Note

You can use either add_mtype or remove_mtype. You must not use them together.

Was this page helpful? Yes No Submitting... Thank you

Comments