Sun Update Connection - Enterprise 1.0 User's Guide

Managing Hosts (Task Map)

A managed host is any computer or virtual machine:

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

Task 

Description 

For Instructions 

Enable Add Host creation in the console. 

The Add Host commands on the console are disabled by default. Use the flag that permits you to add hosts manually before starting or restarting the console. 

To Enable Add Hosts Commands

Create a host. 

Use this procedure to manually add a host to Sun Update Connection – Enterprise. Usually, Sun Update Connection – Enterprise recognizes and automatically adds hosts when their agents rise. 

To Add a Host

Assign a host to one or more groups. 

You assign a managed host to user-defined groups. This does the same as adding hosts to groups, but from the perspective of each host and the groups it should belong to, rather than adding hosts to a single group. 

To Assign a Host to Groups

Edit a managed host. 

View and edit the properties of a managed host. 

To Edit a Managed Host

Delete a managed host. 

You can delete a managed host that you no longer want. 

To Delete a Managed Host from Sun Update Connection – Enterprise

Delete more than one managed host at a time. 

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

To Delete Multiple Managed Hosts from Sun Update Connection – Enterprise

ProcedureTo Enable Add Hosts Commands

The Add Host commands on the console are disabled by default. Turn on the flag that permits you to add hosts manually before starting or restarting the console.

  1. Copy the following line from /usr/local/uce/console/bin/uce.rc to .uce.rc and change its value to true.


    ( all ) ( invisible.gui.__general.manual_host_create, false );
  2. Start the console with the parameter and value.

    • Linux: uce_console -manual_host_create true

    • Windows: uce_console.exe -manual_host_create true

ProcedureTo Add a Host

In this procedure, you manually add a host to Sun Update Connection – Enterprise. As Sun Update Connection – Enterprise will recognize and automatically add hosts when their agents rise, you will not use this procedure in general. Use the Add Host feature to predefine hosts.

  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 Host button.

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

    • From the Hosts menu, choose Add Host.

    The New Host window opens.

  3. In the Host Name text box, create an Sun Update Connection – Enterprise name for the host.

  4. In the Unique String text box, type the unique string of the machine.

  5. From the Distro list, click one of the locally activated distributions.

  6. From the Profile list, optionally click a user-defined profile to attach to this host.

  7. Type an optional description of the host.

  8. In the Groups list, select a user-defined group and click the Add button.

  9. Click OK.

    The New Host window closes.


Example 4–4 Adding a Host with the CLI

The Add Host to Group command allows you to predefine a host, before it has an installed agent. In this command, the -D parameter is mandatory. See 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 addHost { 
   echo “Add a host” 
   echo “Existing hosts are:” 
   uce_cli -lah -u “$user” -p “$password” 
   echo -n “Create a new name, one not already used:” 
   read hostname 
   echo “Active distros are:” 
   uce_cli -ld -u “$user” -p “$password” 
   echo -n “What is the distribution of the host?” 
   read distro 
   uce_cli -ah -h “$hostname” -D “$distro” -u “$user” -p “$password” 
} 
login addHost

ProcedureTo Assign a Host to Groups

You assign a managed host to user-defined groups. This does the same as adding hosts to groups, but from the perspective of each host and the groups it should belong to, rather than adding hosts to a single group.

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

  2. In the Hosts list, expand a group and select a single managed host.

  3. Do one of the following:

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

    • Right-click the managed host and choose Edit.

    • From the Hosts menu, choose Edit.

    The Host Properties window opens.

  4. In the Groups list, select a group and click the Add button.

    The host is added to the selected group. You can assign a managed host to multiple user-defined groups of any hierarchy.

  5. Click OK.

    The Host Properties window closes.


Example 4–5 Assigning a Host to a Group with the CLI

The Add Host to Group command allows you to add a single host to a single group. See Add Host to Group (-ahg) Command.

See Example 4–1 for an example script.


ProcedureTo Edit a Managed Host

In this procedure you will view and edit properties of a managed host.

You cannot edit managed hosts in the following circumstances:

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

  2. In the Hosts list, expand a group and select a single managed host.

  3. Do one of the following:

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

    • Right-click the managed host and choose Edit.

    • From the Hosts menu, choose Edit.

    The Host Properties window opens.

  4. (Optional) Change the Host Name.

    The name is for Sun Update Connection – Enterprise display only and the name does not affect the host. You cannot change the Unique String, IP Address, or Distribution.

  5. (Optional) Change the Profile of the host.

    This step does not lock the host to the profile. You can still run any job on the managed host. This step does provide information, letting you know whenever the host does not comply with the profile requirements.

  6. (Optional) Change the free-text description.

  7. (Optional) Add more groups to the Selected Groups list of this host.

  8. (Optional) Remove groups from the Selected Groups list, but only if the groups are not selected for active or scheduled jobs.

  9. Click OK.

    The Host Properties window closes.

ProcedureTo Delete a Managed Host from Sun Update Connection – Enterprise

You cannot delete managed hosts in the following circumstances:

  1. Log into a terminal with root permissions and stop the agent application.


    # /etc/init.d/uce_agent stop
    
  2. Log in to Sun Update Connection – Enterprise as a user with full permissions or as the admin user.

  3. In the Hosts list, select the host from within any group.

  4. Do one of the following:

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

    • Right-click the selected host and choose Delete.

    • From the Hosts menu, choose Delete.

  5. In the confirmation dialog box that opens, click Delete.

    The host name is removed from all groups and the host is deleted from Sun Update Connection – Enterprise.

ProcedureTo Delete Multiple Managed Hosts from Sun Update Connection – Enterprise

You cannot delete managed hosts in the following circumstances:

  1. Log into a terminal with root permissions and stop the agent application on each managed host.


    # /etc/init.d/uce_agent stop
    
  2. Log into Sun Update Connection – Enterprise as a user with full permissions or as the admin user.

  3. In the Hosts list, hold Shift or Control while selecting hosts.

  4. Do one of the following:

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

    • Right-click the selection and choose Delete.

    • From the Hosts menu, choose Delete.

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

    • Delete All – Delete all selected hosts at once.

    • Delete – Delete selected hosts separately.


Example 4–6 Deleting a Managed Host with the CLI

The Delete Host command functions only if the agent is already stopped. The following script example stops the agent, so the user would need root permissions to run it. See Delete Host (-dh) Command.


#! /bin/bash

echo “To run this script, you need root permissions.” 
echo “If you are not root, exit this script and re-login.” 
echo -n “Enter your Sun Update Connection – Enterprise user name:” 
read user 
echo -n “Enter your password:” 
read password 

echo -n “Enter the name of the host you want to delete:” 
read host 
echo “Stopping the agent...” 
/etc/init.d/uce_agent stop 
echo “Deleting the host...” 
uce_cli -dh -h “$host” -u “$user” -p “$password”