Sun Update Connection - Enterprise 1.0 User's Guide

Managing Groups (Task Map)

The following table identifies the tasks that you might perform when you want to manage groups.

Task 

Description 

For Instructions 

Create a group. 

You might want to create a group of managed hosts so that you can managed them by function rather than by operating system and platform architecture type. For example, you can create a group of web servers and manage them as a group rather than individually. 

To Create a Group

Create a nested group. 

You might want to create a nested group of managed hosts to clearly deliniate differences between different kinds of systems that perform similar functions. Or, you might use nested group to show how different hosts are related to each other. 

To Create a Nested Group

Edit a group. 

When you edit a group, you can change its name or change the list of hosts that is assigned to it. 

To Edit a Group

Delete a group. 

You can delete a group that you no longer want. 

To Delete a Group

Delete more than one group at a time. 

You can use this procedure to delete more than one group at a time. 

To Delete Multiple Groups

ProcedureTo Create a Group

In this procedure, you create groups of managed hosts. Your groups can be on the same level as the default groups, or you can create a hierarchy of groups. The first procedure explains how to create a group in general. Then there is a procedure for creating nested groups.

  1. Login as a user with full permissions or as the admin user.

  2. Do one of the following:

    • From the tool bar, click the Add Group button.

    • In the Host list, right-click and choose Add Group.

    • From the Hosts menu, choose Add Group.

    The New Group window opens.

    This screen capture shows the New Group window.
  3. Type a name for the group.

  4. If you want all hosts in this group to comply to a profile, select one from the Profile drop-down list.

    This does not lock the hosts to the profile; you can still run any job on the group. It does provide information, letting you know whenever one of the hosts in the group does not comply with the profile requirements.

  5. Type an optional, free-text description of the group.

  6. Select the hosts that you want to put into this group and then click the Add button.

    The Selected Hosts list shows the hosts that are to be assigned to this group.

  7. Click OK.

    The New Group window closes. The new group appears in the Hosts list of the main window.

ProcedureTo Create a Nested Group

  1. Do one of the following:

    • In the Hosts list, select an existing group. The new group will be a nested group of the selected group. Right-click the selected group and choose Add Group.

    • Do not select a group yet. You can choose the parent group when you create the new group. Click the Add Group button.

    The New Group window opens.

  2. Check the Parent Group field:

    • If you selected a group before opening the New Group window, notice that the name of the selected group appears in the Parent Group field.

    • If you want to assign the new group to a different parent group, including if you did not select a group beforehand, click the Group Select button.

    The Group Selection window opens.

  3. Select one group to be the parent of the new group and then click OK.

  4. Finish creating the new group as in the previous procedure.


Example 4–1 Creating a Group with the CLI

The Add Group command in the CLI can create a top-level group. It has an optional parameter to create a nested group. To add hosts to the created group, use the Add Host to Group command. See Add Group (-ag) Command and Add Host to Group (-ahg) Command.


#! /bin/bash

function login { 
   echo -n “Type your user name:” 
   read user 
   echo -n “Type your password:” 
   read password
} 

function groupBasics { 
   echo -n “Type a name for the new group:” 
   read newGroup 
   echo -n “Should the new group be nested? (y | n):” 
   read pGyes 
} 

function createGroupWParent { 
   echo “Existing groups are:” 
   uce_cli -lg -u “$user” -p “$password” 
   echo “Copy the name of the group to be the parent.” 
   echo -n “It cannot be a default group:” 
   read parentGroup 
   echo “Creating $newGroup under $parentGroup” 
   uce_cli -ag -g “$newGroup” -pG “$parentGroup” -u “$user” -p “$password” 
} 

function createGroupNoParent {
   echo “Creating group without parent” 
   uce_cli -ag -g “$newGroup” -u “$user” -p “$password” 
} 

function addHost { 
   echo “Add a host to $newGroup...” 
     echo “Hosts are:” 
   uce_cli -lah -u “$user” -p “$password” 
   echo -n “Copy the host name that you want to add:” 
   read hostname 
   uce_cli -ahg -h “$hostname” -g “$newGroup” -u “$user” -p “$password” 
} 

login 
groupBasics 
if [ “$pGyes” = “y” ]; then 
   createGroupWParent 
else 
   createGroupNoParent 
fi 
addHost

ProcedureTo Edit a Group

In this procedure you edit groups of managed hosts. Use this procedure to change the name of a group, or the list of managed hosts assigned to it. If the group is scheduled for future jobs, the host list of the job is updated for the added hosts.

You cannot edit a group in the following circumstances:

  1. Login as a user with full permissions or as the admin user.

  2. In the Hosts list, select the group that you want to edit.

  3. Do one of the following:

    • From the tool bar, click the Edit Group button.

    • Right-click the selected group in the Hosts list and choose Edit.

    • From the Hosts menu, choose Edit.

    The Group Properties window opens.

  4. Change any of the following:

    • Name

    • Parent Group

    • Profile

    • Description

    • Add more hosts

    • Remove hosts, if not in scheduled jobs


Example 4–2 Editing a Group with the CLI

A group can be edited with the CLI command to rename a group. See Rename Group (-rg) Command.


#! /bin/bash 

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 

echo “The list of existing groups is:” 
uce_cli -lg -u “$user” -p “$password” 
echo -n “Copy the full path and name of the group you want to rename:” 
read origName 
echo -n “Type a name for the new group:” 
read newName 

uce_cli -rg -sG “$origName” -tG “$newName” -u “$user” -p “$password”

ProcedureTo Delete a Group

In this procedure you delete user-defined groups. The hosts are not deleted, but nested groups are. Though you cannot delete default distribution groups, if you uninstall the Sun Update Connection – Enterprise Agent from the last managed host of a distribution group, that group is deleted automatically.

You cannot delete groups in the following circumstances:

  1. Login as a user with full permissions or as the admin user.

  2. In the Hosts list, select the group that you want to delete.

  3. Do one of the following:

    • From the tool bar, click the Delete Group button.

    • Right-click the selected group and choose Delete.

    • From the Hosts menu, choose Delete.

  4. In the dialog box that opens, click Delete again.

    The group and its child groups are deleted.

ProcedureTo Delete Multiple Groups

  1. Login as a user with full permissions or as the admin user.

  2. In the Hosts list, hold Shift or Control while selecting groups.

  3. Do one of the following:

    • From the tool bar, click the Delete Group button.

    • Right-click the selection and choose Delete.

    • From the Hosts menu, choose Delete.

  4. In the dialog box that opens, click one of the following:

    • Delete All – Delete all selected groups at the same time.

    • Delete – Delete each selected group one at a time.


Example 4–3 Deleting a Group with the CLI

The Delete Group command in the CLI deletes a given user-defined group and its nested groups. It does not delete hosts and cannot be used to delete default groups. See Delete Group (-dg) Command.


#! /bin/bash 

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 

echo “The list of existing groups is:” 
uce_cli -lg -u “$user” -p “$password” 
echo -n “Copy the full path and name of the group you want to delete:” 
read delGroup 
uce_cli -dg -g “$delGroup” -u “$user” -p “$password”