Sun Management Center Change Manager 1.0 Administration Guide

- Previous: Maintaining the Change Manager Topology by Using the Command-Line Interface (Task Map)
- Next: Chapter 10 Creating Shared Profiles and Host Properties (Reference)

# Maintaining the Change Manager Topology by Using the Command-Line Interface

To initiate deployment jobs, see Chapter 5, Installing Solaris Flash Archives on Managed Hosts (Tasks). To initiate audit jobs, see Chapter 6, Auditing Software Configurations (Tasks).

## How to Specify the Administrative Domain in Which to Add Hosts (Command Line)

1. Determine the name of the administrative domain you want to use.

2. Use the `-d` domain option with the `changemgr` command to supply the name of the administrative domain.

       $ changemgr subcommand other-options -d domain  operands

   For example, specify an administrative domain named `web-domain` in which to store the topology.

### Example-Specifying an Administrative Domain in Which to Add Hosts

Chris views the contents of the `web-server/ApacheServer` host group, which is in the `web-domain` administrative domain.

    $ changemgr hosts -d web-domain /web-server/ApacheServer

## How to Create a Host Group (Command Line)

1. Determine where to create the host group.

   For example, create a host group in the `web-server` host group.

2. Create a host group.

       $ changemgr mkgroup [ -u username ] [ -p file ] [ -d domain ] \
       grouppath ...

   `-u` username

     Specify the user name to authenticate. If this option is not specified, the user is the current UNIX user.

   `-p` file

     file consists of a single line, which contains the password. If file is `-`, then the user can supply the password as standard input.

     If the `-p` option is not supplied, then the `changemgr` command prompts the user for his password.

   `-d` domain

     Specify the administrative domain on which to operate. In the context of a session, the default is the domain specified for the session. If no domain is specified, domain is the user's home domain. By default, domain is the user's home domain.

   grouppath

     Specifies the path to a host group that is relative to the top of the selected administrative domain.

   Choose a host group name that indicates the types of managed hosts the host group contains. For example, create a host group named `apache` in which to group managed hosts that run the Apache web server.

### Example-Creating a Host Group

Chris creates the `apache` host group in the `web-server` host group.

    $ changemgr mkgroup /web-server/apache

## How to Rename a Managed Host or Host Group (Command Line)

You can rename only one managed host or host group at a time.

Note -

Changing the name of a managed host with the Change Manager only changes how that managed host is labeled in that particular host group.

Changing the name does not change the following:

- How that managed host is labeled in other host groups

- The name by which the managed host is known in the naming service

- The name the managed host calls itself

1. Determine which managed host or host group to rename.

   For example, rename the `web-server/apache` host group to be `web-server/ApacheServer`.

2. Rename the managed host or host group.

       $ changemgr hostmove [ -u username ] [ -p file ] [ -d domain ] \
       old_topopath new_topopath

   topopath

     Specifies the path to a managed host or host group that is relative to the top of the selected administrative domain.

   For descriptions of the other options, see How to Create a Host Group (Command Line).

### Example-Renaming a Managed Host or Host Group

Chris renames the `web-server/apache` host group to be `web-server/ApacheServer`.

    $ changemgr hostmove /web-server/apache \
    /web-server/ApacheServer

## How to Copy Managed Hosts to Another Host Group (Command Line)

To copy a managed host to another host group, you must add a managed host to that group. See How to Add Managed Hosts (Command Line).

Note -

Managed hosts can only be copied to an existing host group. To create a host group in which to copy a managed host, see How to Create a Host Group (Command Line).

## How to Move Managed Hosts and Host Groups to Another Host Group (Command Line)

1. Determine which managed hosts and host groups to move and the destination host group.

   For example, move `/web-server/host1` and `/web-server/host2` to the `web-server/ApacheServer` host group.

2. Move the managed hosts and host groups to the other host group.

       $ changemgr hostmove [ -u username ] [ -p file ] [ -d domain ] \
       old_topopath ... new_grouppath

   topopath

     Specifies the path to a managed host or host group that is relative to the top of the selected administrative domain.

   For descriptions of the other options, see How to Create a Host Group (Command Line).

### Example-Moving Managed Hosts to Another Host Group

Chris moves the `/web-server/host1` and `/web-server/host2` managed hosts to the `web-server/ApacheServer` host group.

    $ changemgr hostmove /web-server/host1 /web-server/host2 \
    /web-server/ApacheServer

### Example-Moving Host Groups to Another Host Group

Chris moves the `ApacheServer` and `NewServer` host groups to the `web-server` host group.

    $ changemgr hostmove ApacheServer NewServer /web-server

## How to Remove Managed Hosts and Host Groups (Command Line)

You can only remove a host group that is empty.

1. Determine which managed hosts and host groups to remove.

   For example, remove the `/web-server/host1` and `/web-server/host2` managed hosts and the `/web-server` host group.

2. Remove the managed hosts and host groups.

       $ changemgr remove [ -u username ] [ -p file ] [ -d domain ] \
       topopath ...

   topopath

     Specifies the path to a managed host or host group that is relative to the top of the selected administrative domain.

   For descriptions of the other options, see How to Create a Host Group (Command Line).

### Example-Removing Managed Hosts and Host Groups

Chris removes the `/web-server/host1` and `/web-server/host2` managed hosts and the `/web-server` host group.

    $ changemgr remove /web-server/host1 /web-server/host2 \
    /web-server

## How to View the Contents of a Host Group (Command Line)

A host group can contain managed hosts and other host groups.

To view host group properties, see How to View Host Group Properties (Command Line). To modify host group properties, see How to Modify Host Group Properties (Command Line).

1. Determine which host group to view.

   For example, view the contents of the `web-server` host group.

2. View the host group.

       $ changemgr hosts [ -u username ] [ -p file ] [ -d domain ] \
       [ -l ] [ -g ] [ -R ] [ -o format ] [ topopath ... ]

   `-l`

     Present detailed information about the specified managed hosts and host groups in tabular form.

   `-g`

     Present information about the host group itself, rather than about the host group's contents.

   `-R`

     Describe all the host group's descendents.

   `-o` format

     format is a blank-separated list or comma-separated list of property names. If you separate the property names with spaces, make sure that you surround the list of property names with quotes. The specified property values are displayed in a name-value format. If format is specified as `all`, then all properties are displayed. The output is suitable for programmatic parsing.

   topopath

     Specifies the path to a managed host or host group that is relative to the top of the selected administrative domain.

   For descriptions of the other options, see How to Create a Host Group (Command Line).

### Example-Viewing the Contents of the Current Host Group

Chris views the contents of the host group at the root of the administrative domain.

    $ changemgr hosts

### Example-Viewing Host Group Contents

Chris views the contents of the `web-server/ApacheServer` host group.

    $ changemgr hosts /web-server/ApacheServer

### Example-Viewing Information About the Host Group

Chris views the information about the `web-server/ApacheServer` host group.

    $ changemgr hosts -g /web-server/ApacheServer

### Example-Viewing Host Group Contents in Table Form

Chris views the contents of the `web-server/ApacheServer` host group in table form.

    $ changemgr hosts -l /web-server/ApacheServer

### Example-Viewing Host Group Contents and Contents of the Host Group's Descendents

Chris views the contents of the `web-server/ApacheServer` host group and its descendents.

    $ changemgr hosts -R /web-server/ApacheServer

### Example-Viewing Host Group Contents and Specific Properties

Chris views the contents of the `web-server/ApacheServer` host group. Chris wants to see the values of the `Description` property and the `base_config_templateName` property for each of the managed hosts in `/web-server/ApacheServer`. Note that you can use either format shown.

    $ changemgr hosts -o Description,base_config_templateName \
    /web-server/ApacheServer

    $ changemgr hosts -o "Description base_config_templateName" \
    /web-server/ApacheServer

### Example-Viewing Host Group Contents and All Properties

Chris views the contents of the `web-server/ApacheServer` host group and wants to see the values of all the properties for each managed host and host group.

    $ changemgr hosts -o all /web-server/ApacheServer

## How to View Managed Host Properties (Command Line)

To modify managed host properties, see How to Modify Managed Host Properties (Command Line).

1. Determine which managed host's properties to view.

   For example, view the properties of `web-server/ApacheServer/host1`.

2. View the properties of the managed host.

       $ changemgr hosts [ -u username ] [ -p file ] [ -d domain ] \
       [ -l ] [ -g ] [ -R ] [ -o format ] [ topopath ... ]

   `-l`

     Present detailed information about the specified managed hosts and host groups in tabular form.

   `-g`

     Present information about the host group itself, rather than about the host group's contents.

   `-R`

     Describe all the host group's descendents.

   `-o` format

     format is a blank-separated list or comma-separated list of property names. If you separate the property names with spaces, make sure that you surround the list of property names with quotes. The specified property values are displayed in a name-value format. If format is specified as `all`, then all properties are displayed. The output is suitable for programmatic parsing.

   topopath

     Specifies the path to a managed host or host group that is relative to the top of the selected administrative domain.

   For descriptions of the other options, see How to Create a Host Group (Command Line).

### Example-Viewing Managed Host Properties

Chris views the properties of `web-server/ApacheServer/host1`.

    $ changemgr hosts -o all /web-server/ApacheServer/host1

## How to Modify Managed Host Properties (Command Line)

For the list of properties, see Chapter 10, Creating Shared Profiles and Host Properties (Reference).

1. Determine the managed host's properties that you want to modify.

   For example, modify the properties of the `web-server/ApacheServer/host2` managed host.

2. Modify the property values of the managed host.

       $ changemgr hostset [ -u username ] [ -p file ] [ -d domain ] \
       [ -s name=value ] ... [ -s name ] ... topopath ...

   `-s` name=value

     Specify one or more name-value pairs. name is the property name, and value is the property value. Supply this option for each property value you want to set. If value is blank, then the property is assigned an empty value.

   `-s` name

     Specify one or more property names to delete, where name is the property name. Supply this option for each property you want to delete.

   topopath

     Specifies the path to a managed host or host group that is relative to the top of the selected administrative domain.

   For descriptions of the other options, see How to Create a Host Group (Command Line).

### Example-Modifying a Managed Host Property

Chris modifies the `Description` property of the `web-server/ApacheServer/host2` managed host.

    $ changemgr hostset -s Description="Apache Web Server: host2" \
    /web-server/ApacheServer/host2

### Example-Modifying Managed Host Properties

Chris modifies the `Description` and `base_config_target_arch` properties for `web-server/ApacheServer/host2`.

    $ changemgr hostset -s Description="Apache Web Server: host2" \
    -s base_config_target_arch=sun4u /web-server/ApacheServer/host2

### Example-Deleting a Managed Host Property

Chris deletes the `Description` property of the `web-server/ApacheServer/host2` managed host.

    $ changemgr hostset -s Description /web-server/ApacheServer/host2

### Example-Recursively Setting Host Group Properties

Chris recursively sets the `Description` property of the contents of the `web-server` host group.

    $ changemgr hostset -R -s Description="Web Server managed host" /web-server

## How to View Host Group Properties (Command Line)

To modify host group properties, see How to Modify Host Group Properties (Command Line).

1. Determine which host group's properties to view.

   For example, view the properties of the `web-server/ApacheServer` host group.

2. View host group properties.

       $ changemgr hosts [ -u username ] [ -p file ] [ -d domain ] \
       [ -l ] [ -g ] [ -R ] [ -o format ] [ topopath ... ]

   `-l`

     Present detailed information about the specified managed hosts and host groups in tabular form.

   `-g`

     Present information about the host group itself, rather than about the host group's contents.

   `-R`

     Describe all the host group's descendents.

   `-o` format

     format is a blank-separated list or comma-separated list of property names. If you separate the property names with spaces, make sure that you surround the list of property names with quotes. The specified property values are displayed in a name-value format. If format is specified as `all`, then all properties are displayed. The output is suitable for programmatic parsing.

   topopath

     Specifies the path to a managed host or host group that is relative to the top of the selected administrative domain.

   For descriptions of the other options, see How to Create a Host Group (Command Line).

### Example-Viewing Host Group Properties

Chris views the contents of the `web-server/ApacheServer` host group.

    $ changemgr hosts -g -o all /web-server/ApacheServer

## How to Modify Host Group Properties (Command Line)

For the list of properties, see Chapter 10, Creating Shared Profiles and Host Properties (Reference).

1. Determine the host group's properties that you want to modify.

   For example, modify the properties of the `web-server/ApacheServer` host group.

2. Modify host group properties.

       $ changemgr hostset [ -u username ] [ -p file ] \
       [ -s name=value ] ... [ -s name ] ... topopath ...

   `-s` name=value

     Specify one or more name-value pairs. name is the property name, and value is the property value. Supply this option for each property value you want to set. If value is blank, then the property is assigned an empty value.

   `-s` name

     Specify one or more property names to delete, where name is the property name. Supply this option for each property you want to delete.

   topopath

     Specifies the path to a managed host or host group that is relative to the top of the selected administrative domain.

   For descriptions of the other options, see How to Create a Host Group (Command Line).

### Example-Modifying Host Group Properties

Chris modifies the `Description` property of the `web-server/ApacheServer` host group.

    $ changemgr hostset \
    -s Description="Host group to hold Apache Web Server hosts" \
    /web-server/ApacheServer

- Previous: Maintaining the Change Manager Topology by Using the Command-Line Interface (Task Map)
- Next: Chapter 10 Creating Shared Profiles and Host Properties (Reference)

- © 2010, Oracle Corporation and/or its affiliates