Sun Management Center Change Manager 1.0.1 Reference Manual

## changemgr(1MCM)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | SUBCOMMANDS | SEE ALSO | EXAMPLES

#### NAME

changemgr– Sun Management Center Change Manager command-line interface

#### SYNOPSIS

`/opt/SUNWichange/bin/changemgr` command [options] [operands]

#### DESCRIPTION

The changemgr(1MCM) command is the command-line interface for the Sun Management Center Change Manager, henceforth referred to as Change Manager. This command-line interface performs the same operations that can be performed by using the browser user interface, such as software deployment tasks and system audit tasks.

Change Manager commands must be run by an authenticated user.

The command-line interface can be used to initiate a Change Manager session. A Change Manager session is a subshell in which you can run Change Manager commands as an authenticated user. You authenticate when you initiate the session. All operations run within the session are owned by the authenticated user.

The command-line interface can also run custom scripts that execute multiple Change Manager commands. The script support facilitates the execution of multiple Change Manager operations. Authentication is performed once for the script instead of once per command-line invocation.

#### OPTIONS

The `changemgr` command supports several command-line options.

#### Authentication Options

Other than the `changemgr help` commands, all commands must be authenticated. In the context of a session, the session's authenticated identity is used.

The following authentication options are supported:

`-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.

`-u` username

  Specifies the user name to authenticate. If the `-u` option is not supplied, the user is the current UNIX real user ID, as reported by id(1M).

#### Common Options

These options are used by more than one command:

`-d` domain

  Specifies the Sun Management Center administrative domain on which to operate. In the context of a session, the default is the domain specified by the session, if any. By default, domain is the user's home domain.

`-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.

  The output lists each file or folder on a line by itself. The name can be followed by property lines, which consist of a tab, property name, equals sign, and a property value. Each file or folder entry is separated from the next entry by a blank line.

  For example, the output is arranged as follows:

      path
              name=value
              ...

      path
              name=value
              ...

      ...

#### OPERANDS

The following operands are supported:

filepath

  An absolute path to a file or a relative (to the current directory) path to a file. This file path is not in the Change Manager repository.

relpath

  Path to a file-like object (including a folder) that is relative to the top of the Change Manager repository.

relfilepath

  Path to a file-like object (not including a folder) that is relative to the top of the Change Manager repository.

reldirpath

  Path to a folder-like object that is relative to the top of the Change Manager repository.

`.type`

  File name suffix that specifies the file type. File type suffixes are: `.flar` for archives, `.miniroot` for boot images, `.bmft` for manifests, `.brul` for audit rules files, `.txt` for reports, and `.cmsp` for shared profiles. Folders do not require a file name suffix.

topopath

  Path to a topology object (including a host group) that is relative to the top of the selected administrative domain.

hostpath

  Path to a managed host that is relative to the top of the selected administrative domain.

hostname

  Network name of a host, for example, `netherfield.sun.com`.

grouppath

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

#### SUBCOMMANDS

The following sections describe the `changemgr` subcommands.

#### Sessions

`changemgr session` [`-u` username] [`-p` file] [`-d` domain] [command [command-arguments]]

  Run the specified command in the context of a Change Manager session so that individual commands in a script (command) do not need authentication and startup overhead. The authentication and startup overhead is amoritized over all of the commands.

  command is normally an sh(1) or ksh(1) script that contains Change Manager commands in the form of the command-line interface.

  If command is `sh` or `ksh`, a subshell is spawned to create an interactive session. You are required to authenticate to initiate the session.

  If command is not supplied, then an interactive subshell of `$SHELL` starts, if known to be compatible. If `$SHELL` is not compatible, then an interactive `ksh` subshell starts.

  Note –

  The csh(1) shell cannot be used to run scripts or initiate a session.

#### File Management Operations

`changemgr mkdir` [`-u` username] [`-p` file] `new_reldirpath`...

  Create one or more folders in the Change Manager repository.

`changemgr import` [`-u` username] [`-p` file] `filepath`.[`type`] `relfilepath.type`

  Import a single file, `filepath`.[`type`], to the repository as `relfilepath.type`. The file being imported can have any file suffix, but the file name in the repository must have the appropriate suffix.

`changemgr import` [`-u` username] [`-p` file] `filepath.type`... `reldirpath`

  Import one or more files to the specified folder, `reldirpath`, in the repository.

  Because this command uses the original file names when creating the files in the repository, the original names must have the appropriate suffixes.

`changemgr export` [`-u` username] [`-p` file] `relfilepath` `filepath`

  Export a single file, `relfilepath`, from the repository as `filepath`.

`changemgr export` [`-u` username] [`-p` file] `relfilepath`... `dirpath`

  Export one or more files to the specified folder, `dirpath`, outside of the repository.

`changemgr files` [`-u` username] [`-p` file] [`-l`] [`-d`] [`-R`] [`-o` format] [`relpath`...]

  List the specified files and folders, or the contents of the specified folders. When no path is specified, the objects in the root of the repository are listed.

  The default output format is one file or folder name per line.

  `-d`

    Presents information about the folder itself, rather than about the folder's contents.

  `-l`

    Presents more information in tabular output. This output is not suitable for programmatic parsing.

  `-R`

    Recursively lists the contents of a folder.

`changemgr delete` [`-u` username] [`-p` file] `relpath`...

  Delete the specified files and folders.

  Note that only empty folders can be deleted.

`changemgr fileset` [`-u` username] [`-p` file] [`-s` name=value]... [`-s` name]... `relpath`...

  Set properties for the specified files and folders by using the `-s` name=value option. The `-s` option with just the property name deletes the property.

  `-s` name=value

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

  `-s` name

    Specifies one or more property names to delete, where name is the property name. Supply the `-s` option for each property you want to delete.

`changemgr filemove` [`-u` username] [`-p` file] `old_relpath`... `new_dirpath`

  Move files and folders to another folder. The original file and folder names are unchanged. The destination folder must already exist.

  `old_relpath` can be a folder or a file.

`changemgr filemove` [`-u` username] [`-p` file] `old_relpath.type` `new_relpath.type`

  Rename a file or a folder. The type of the renamed file must stay the same.

#### Topology Operations

`changemgr mkgroup` [`-u` username] [`-p` file] [`-d` domain] `new_grouppath`...

  Create one or more host groups.

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

  List information about `topopath`, which represents the specified managed hosts or host groups. With no path arguments, information is listed about the managed hosts and host groups in the root of the administrative domain.

  The default output format is one managed host or host group name per line.

  `-g`

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

  `-l`

    Presents more information in tabular output. This output is not suitable for programmatic parsing.

  `-R`

    Recursively lists the contents of a group.

`changemgr add` [`-u` username] [`-p` file] [`-d` domain] `hostname` `hostpath`

  Register a network host name as a Sun Management Center host name. The host path includes the host group and the host name. The name of the managed host can be different from the network host name.

`changemgr add` [`-u` username] [`-p` file] [`-d` domain] `hostname`... `grouppath`

  Add the specified managed hosts to the specified host group, with the managed host names equal to the network host names.

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

  Remove managed hosts and host groups from the topology.

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

  Set properties for the specified managed hosts and host groups by using the `-s` name=value option. The `-s` option with just the property name deletes the property.

  `-s` name=value

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

  `-s` name

    Specifies one or more property names to delete, where name is the property name. Supply the `-s` option for each property you want to delete.

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

  Move managed hosts or host groups to another host group. The destination host group must already exist.

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

  Rename a single managed host or host group.

#### Host Operations

`changemgr update` [`-u` username] [`-p` file] [`-d` domain] [`-x` operation] `topopath`...

  Update the specified managed hosts to conform to the configuration specified by their properties.

  If `topopath` is a host group, all members of the host group are updated.

  `-x` operation

    Specifies the action to take after the update completes. If operation is `reboot`, then activate the newly installed software stack and reboot. If operation is `halt`, then activate the newly installed software stack and halt. The default operation is to reboot the managed host.

`changemgr fallback` [`-u` username] [`-p` file] [`-d` domain] [`-x` operation] `topopath`...

  Restore the specified managed hosts to their state prior to the last `changemgr update` operation. This action only undoes the last update operation. This action does not change the parameters associated with the managed host. After the fallback operation, the managed host's running configuration will not match the parameters selected for it, which is the case immediately prior the update operation.

  If `topopath` is a host group, all members of the host group are restored.

  `-x` operation

    Specifies the action to take after the fallback completes. If operation is `reboot`, then activate the newly selected software stack and reboot. If operation is `halt`, then activate the newly selected software stack and halt. The default operation is to reboot the managed host.

`changemgr reinstall` [`-u` username] [`-p` file] [`-d` domain] `topopath`...

  Reinstall the specified managed hosts. The reinstallation is equivalent to this:

      # reboot -- net - install

  If `topopath` is a host group, all members of the host group are reinstalled.

`changemgr setup` [`-u` username] [`-p` file] [`-d` domain] `topopath`...

  Set up files for initial installation. This operation is required before manually running `boot net `-` install` on the consoles of managed hosts.

  If `topopath` is a host group, all files for the members of the host group are set up.

`changemgr reboot` [`-u` username] [`-p` file] [`-d` domain] `topopath`...

  Reboot the specified managed hosts.

  If `topopath` is a host group, all members of the host group are rebooted.

`changemgr halt` [`-u` username] [`-p` file] [`-d` domain] `topopath`...

  Halt the specified managed hosts.

  If `topopath` is a host group, all members of the host group are halted.

`changemgr manifest` [`-u` username] [`-p` file] [`-d` domain] `-o` `relpathprefix` [`-r` `relfilepath.brul`] `topopath`...

  Create manifests for the specified managed hosts.

  `-o` relpathprefix

    Specifies the prefix to use when creating manifests. The host name and suffix are appended to the prefix to form the name of the manifest.

  `-r` `relfilepath.brul`

    Specifies the audit rules file to use when building manifests.

`changemgr audit` [`-u` username] [`-p` file] [`-d` domain] `-o` `relfilepath.txt` [`-r` `relfilepath.brul`] `relfilepath.bmft` `topopath`...

  Compare managed host contents against a baseline manifest.

  `-o` `relfilepath.txt`

    Specifies the file path of the report.

  `-r` `relfilepath.brul`

    Specifies the audit rules file to use when auditing hosts.

`changemgr info` [`-u` username] [`-p` file] [`-d` domain] `-o` `relfilepath.txt` `topopath`...

  Get software status information about the specified managed hosts. Store the results in the specified report.

  `-o` `relfilepath.txt`

    Specifies the file path of the report.

#### Job Management Operations

`changemgr jobs` [`-u` username] [`-p` file] [`-l`] [`-o` format] [id...]

  Display the status of all outstanding jobs or of specified jobs.

  `-l`

    Presents more information in tabular output. This output is not suitable for programmatic parsing.

`changemgr kill` [`-u` username] [`-p` file] id...

  Cancel currently running jobs or pending jobs.

`changemgr ack` [`-u` username] [`-p` file] id...

  Acknowledge the completion of the specified jobs. This action discards the status of the specified jobs.

  Use this command to purge completed job entries from the job list that were initiated by the browser interface.

#### Miscellaneous

`changemgr help`

  Provide a one-line summary of the available subcommands. No authentication is required.

`changemgr help` subcommand

  Provide a summary of the specified subcommand. No authentication is required.

#### SEE ALSO

csh(1), date(1), ksh(1), sh(1), id(1M)

#### EXAMPLES

##### Example 1 Running Commands in an Interactive Change Manager Session

The following example shows an interactive Change Manager session. The `changemgr session` command starts a subshell in which you can run authenticated `changemgr` commands.

This example shows how to purge a completed job from the job queue. This job, `IC_1`, was initiated from the browser interface. When the tasks are completed, exit the session by typing `exit` at the subshell prompt.

    $ changemgr session
    Password: password
    $ changemgr jobs -l IC_1
    IC_1     succeeded
    $ changemgr ack IC_1
    $ changemgr jobs l IC_1
    $ exit

##### Example 2 Running Scripts in a Change Manager Session

This example shows how to use the `changemgr session` command to run a script.

The following command line runs the `deploy-web` script.

    $ changemgr session deploy-web web.flar host1

The `deploy-web` script contains the following:

    $ cat deploy-web
    #/bin/sh
    changemgr import "$1" /
    changemgr fileset -s MediaName=s9.miniroot "$1"
    changemgr hostset -s base_config_flar_archive="/$1" "$2"
    changemgr update "$2"
    $

SunOS 5.9 Last Revised 18 February 2003

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | SUBCOMMANDS | SEE ALSO | EXAMPLES

- © 2010, Oracle Corporation and/or its affiliates