Sun Management Center Change Manager 1.0.1 Administration Guide

- Previous: Auditing Software Configurations by Using the Command-Line Interface (Task Map)
- Next: Chapter 7 Monitoring Jobs (Tasks)

# Auditing Software Configurations by Using the Command-Line Interface

This section describes how to use the command-line interface to audit managed hosts.

To learn how to create folders and perform management tasks in the Change Manager repository, see Chapter 8, Maintaining the Change Manager Repository (Tasks). The procedures described in Chapter 8, Maintaining the Change Manager Repository (Tasks) are not required to perform audit tasks. However, you might want to create a hierarchy of folders in the repository.

To learn how to create host groups and perform management tasks on the Sun Management Center topology, see Chapter 9, Maintaining the Sun Management Center Topology (Tasks). The procedures described in Chapter 9, Maintaining the Sun Management Center Topology (Tasks) are not required to perform audit tasks. However, you might want to create a hierarchy of host groups in the topology.

## How to Import Audit Rules Files to the Change Manager Repository (Command Line)

The audit rules file is used to build manifests and audit managed hosts.

The time required to import a file to the Change Manager repository depends on the size of the file and the speed of the network.

1. Determine where the audit rules file exists and where to store it.

   For example, copy the audit rules file from `/net/test1/home/suzi/usr-only.brul` to the `web-server` folder.

2. Import an audit rules file to the Change Manager repository by using one of these `changemgr import` commands.

   - The following command line imports one file at a time. You can also use this command line to rename the file.

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

   - The following command line imports several files to a folder simultaneously.

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

   `-u` username

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

   filepath

     Specifies an absolute or relative path to a file. This file path is not within the Change Manager repository.

   reldirpath

     Specifies the path to a folder that is relative to the top of the Change Manager repository.

   relfilepath

     Specifies the path to a file, not including a folder, that is relative to the top of the Change Manager repository.

   .type

     Specifies the file name suffix that represents the file type. An audit rules file uses the `.brul` suffix.

   Choose a name that indicates the type of audit specified by the audit rules file. Use the `.brul` suffix. For example, create an audit rules file named `usr-only.brul`, which indicates that only files from `/usr` are cataloged.

### Example—Importing an Audit Rules File to the Change Manager Repository

Suzi copies the audit rules file called `/net/test1/home/suzi/usr-only.brul` to the `web-server` folder of the repository. She renames the file to be `usr_only.brul`.

    $ changemgr import /net/test1/home/suzi/usr-only.brul \
    /web-server/usr_only.brul

### Example—Importing Audit Rules Files to the Change Manager Repository

Suzi copies the audit rules files called `/net/test1/home/suzi/usr-only.brul` and `/net/test1/home/suzi/opt-only.brul` to the `/` folder of the repository.

    $ changemgr import /net/test1/home/suzi/usr-only.brul \
    /net/test1/home/suzi/opt-only.brul /

## How to Import Manifests to the Change Manager Repository (Command Line)

The manifests are created by the `changemgr manifest` command, which performs a per-file audit of a managed host.

The time required to import a file to the Change Manager repository depends on the size of the file and the speed of the network.

1. Determine where the manifest exists and where to store it.

   For example, copy the manifest from `/net/test1/home/suzi/host1-usr-only.bmft` to the `web-server` folder.

2. Import a manifest to the Change Manager repository by using one of these `changemgr import` commands.

   - The following command line imports one file at a time. You can also use this command line to rename the file.

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

   - The following command line imports several files to a folder simultaneously.

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

   For descriptions of the options, see How to Import Audit Rules Files to the Change Manager Repository (Command Line).

   Choose a name that indicates the name of the audited managed host and the type of audit specified by the audit rules file. Use the `.bmft` file suffix. For example, copy a manifest named `host1-usr-only.bmft`, which indicates that only files from `/usr` are cataloged for the `host1` managed host.

### Example—Importing a Manifest to the Change Manager Repository

Suzi copies the manifest called `/net/test1/home/suzi/host1-usr-only.bmft` to the `web-server` folder. She renames the file to be `host1_usr_only.bmft`.

    $ changemgr import \
    /net/test1/home/suzi/host1-usr-only.bmft \
    /web-server/host1_usr_only.bmft

### Example—Importing Manifests to the Change Manager Repository

Suzi copies the manifests called `/net/test1/home/suzi/host1-usr-only.bmft` and `/net/test1/home/suzi/host1-opt-only.bmft` to the `/` folder.

    $ changemgr import \
    /net/test1/home/suzi/host1-usr-only.bmft \
    /net/test1/home/suzi/host1-opt-only.bmft /

## How to Build Manifests for Managed Hosts (Command Line)

1. Determine which managed hosts you want to audit.

   For example, audit the `/web-server/host1` and `/web-server/host2` managed hosts.

2. Build manifests for the managed hosts.

       $ changemgr manifest [ -u username ] [ -p file ] [ -d domain ] \
       -o relfilepathprefix [ -r relfilepath.brul ] topopath ...

   `-u` username

     Specifies 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

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

   `-o` relfilepathprefix

     Specifies the prefix to be used when creating the output inventories. The name of the managed host and the `.bmft` suffix are appended to the prefix specified to form the name of the resulting manifest.

   `-r` `relfilepath.brul`

     Specifies the audit rules file to use to create the manifest.

   topopath

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

### Example—Building Manifests for Managed Hosts

Suzi builds manifests for the `/web-server/host1` and `/web-server/host2` managed hosts. She stores the files in the `/web-server` folder with a manifest file prefix of `usr-only`. The resulting file names are `/web-server/host1.bmft` and `/web-server/host2.bmft`.

    $ changemgr manifest -o /web-server/ -r usr-only.brul \
    /web-server/host1 /web-server/host2

Note –

If the argument to `-o` is a folder, terminate the argument with a slash. For example, if the argument to `-o` is `/web-server/baseline`, then `baseline` is prefixed to manifests created in the `/web-server` folder. If you use this prefix, you might see a manifest with a name like `/web-server/baselinehost1.bmft`.

## How to Audit Managed Hosts (Command Line)

The baseline manifest does not need to be built on the managed host. You can build a baseline manifest on a master system before creating the Solaris Flash archive.

1. Determine which managed hosts you want to audit.

   For example, audit the `/web-server/host1` and `/web-server/host2` managed hosts.

2. Audit managed hosts.

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

   `-o` `relfilepath.txt`

     Specifies where to write the report on manifest differences.

   `-r` `relfilepath.brul`

     Specifies the audit rules file to use to create the manifest.

   `relfilepath.bmft`

     Specifies the path to the manifest file that is relative to the top of the Change Manager repository.

   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 Build Manifests for Managed Hosts (Command Line).

### Example—Auditing Managed Hosts

Suzi audits the `/web-server/host1` managed host. She stores the report in the `/web-server/usr-only.txt` file. She audits the managed host by comparing its manifest against the baseline manifest called `/web-server/baseline.bmft`.

    $ changemgr audit suzi \
    -o /web-server/usr-only.txt -r usr-only.brul \
    /web-server/baseline.bmft /web-server/host1

To understand how to interpret the report results, see Comparison Report Format.

## How to Get the Software Status of Managed Hosts (Command Line)

1. Determine the managed hosts for which you want to get the software status.

   For example, get the software status for the `/web-server/host1` and `/web-server/host2` managed hosts.

2. Get the software status for a managed host.

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

   `-o` `relfilepath.txt`

     Specifies the path of the file that contains the software status report.

   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 Build Manifests for Managed Hosts (Command Line).

### Example—Getting the Software Status of Managed Hosts

Suzi gets the software status for the `/web-server/host1` managed host. She stores the report in the `/web-server/software-status.txt` file.

    $ changemgr info -o /web-server/software-status.txt \
    /web-server/host1

- Previous: Auditing Software Configurations by Using the Command-Line Interface (Task Map)
- Next: Chapter 7 Monitoring Jobs (Tasks)

- © 2010, Oracle Corporation and/or its affiliates