Sun Update Connection - Enterprise 1.0 User's Guide

Inventory Commands

The following commands allow you to access, save, and compare the inventory (list of installed software) of a host or of a group.

This section includes the following:

Save Host Inventory (-shi) Command

The save-host-inventory command saves a snapshot (a record of the host’s inventory at the current time) of the given host.

Parameter

  • -h hostname Specify the name of the host.

  • -s snapshot-name Specify the name of the snapshot.

Syntax

uce_cli -shi -h hostname -s snapshot-name -u username -p password

Example

uce_cli -shi -h lnxsrvr13 -s beforeUpdate -u admin -p 123

To get valid values for -h, use the -lah command.

Save Group Inventory (-sgi) Command

The save-group-inventory command saves a snapshot of the inventory of each host in the given group.

Parameter

  • -g groupname Specify the name of the group.

  • -sn suffix-name Specify the name of the snapshot suffix. When you save a snapshot for a group, a snapshot is created with the following file name format: hostname-suffix-timestamp.

Syntax

uce_cli -sgi -g "groupname" -sn suffix -u username -p password

Example

uce_cli -sgi -g WebServers -sn wsrvrs -u admin -p 123

Result Example


lnx01-wsrvrs-932111203
lnx12-wsrvrs-933111203
admin0-wsrvrs-9341112033
web13-wsrvrs-93111203

To get valid values for -g, use the -lg command.

Delete Saved Snapshot (-dss) Command

The delete-saved-snapshot command deletes a selected saved snapshot.

Parameter

  • -h hostname Specify the name of the host.

  • -s snapshot-name Specify the name of the snapshot.

Syntax

uce_cli -dss -h hostname -s snapshot -u username -p password

Example

uce_cli -dss -h lnxsrvr13 -s inventory_beforeRestore -u admin -p 123

To get a valid value for the -h parameter, use the -lah command. To get a valid value for the -s parameter, use the -lss command.

Convert Inventory to Profile (-cip) Command

The convert-inventory-profile command saves the software inventory of a host into a profile. All software installed on the host is marked as Required on the profile; everything else is marked as Not Allowed.

Parameter

  • -h hostname Specify the name of the host.

  • -P profile Specify the name of the profile.

Syntax

uce_cli -cip -h hostname -P "profile" -u username -p password

Example

uce_cli -cip -h lnxsrvr13 -P lnxsrvrProfile -u admin -p 123

To get valid values for the -h parameter, use the -lah command.

Convert Snapshot to Profile (-csp) Command

The convert-snapshot-profile command converts a saved software inventory (a snapshot) of a host as a profile. All software listed in the snapshot is marked as Required on the profile; everything else is marked as Not Allowed.

Parameter

  • -h hostname Specify the name of the host.

  • -s snapshot-name Specify the name of the snapshot.

  • -P profile Specify the name of the profile.

Syntax

uce_cli -csp -h hostname -s snapshot-name -P "profile" -u username -p password

Example

uce_cli -csp -h lnxsrvr13 -s beforeUp -P oldSrv -u admin -p 123

To get a valid value for the -h parameter, use the -lah command. To get a valid value for the -s parameter, use the -lss command.

Compare Hosts and Inventories (-chi) Command

The compare-host-inventory command compares the installed software of two hosts, or the snapshots of two hosts. You may also compare the inventory or snapshot of a host against the snapshot of a group. The result of this command is the set of differences.

Parameter

  • -h hostname Specify the name of the source host.

  • -s snapshot-name Specify the name of the source snapshot.

  • -t hostname Specify the name of the target host.

  • -ts snapshot-name Specify the name of the target snapshot.

  • -dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -chi -h source-hostname [ -s source-snapshot ] -t target-hostname [ -ts target-snapshot ] [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -chi -h lnx13 -s lnxInvDec03 -t lnx29 -ts lnxInvDec18 -u admin -p 123

To get valid values for the -h and -t parameters, use the -lah command. To get values for the -s and -ts parameters, use the -lss command.

Whether -s and -ts are optional or mandatory depends on the type of comparison you are making. Comparison matrix:

Type 

-h

-t

-s

-ts

Compare two hosts, current inventories 

Different hosts 

Different hosts 

Not used 

Not used 

Compare two hosts, saved snapshots 

Different hosts 

Different hosts 

From -lss, each is a different snapshot

From -lss, each is a different snapshot

Compare current host to group snapshot 

Host in source group 

Target host 

From -lss

Not used 

Compare host at different stages of lifecycle 

Same host named for both parameters 

Same host named for both parameters 

From -lss, each is a different snapshot

From -lss, each is a different snapshot

Submit Compare Job (-scj) Command

The submit-compare-job command compares the installed software of two hosts, or the snapshots of two hosts, and then changes the inventory of the target host to duplicate the inventory of the source host. The result of this command is application provisioning to the target host.

If the hosts are Solaris machines, you can compare either Software or Patches in one compare job.

Parameter

  • -h hostname Specify the name of the source host.

  • -s snapshot-name Specify the name of the source snapshot.

  • -t hostname Specify the name of the target host.

  • -j jobname Specify the name of the job.

  • -C policy Specify the name of the policy.

Flag

  • -sm Run the job in simulation mode. This is the default mode.

  • -dp Run the job in deploy mode. If you want the job to actually make changes on the target host, you must use this flag.

Syntax

uce_cli -scj -h source-hostname [ -s source-snapshot ] -t target-hostname -j "jobname" -C "policy" [ -sm | -dp ] -u username -p password

Example

uce_cli -scj -h lnxsrvr13 -t lnxsrvr29 -j Make29Like13 -C autoSW -dp -u admin -p 123

To get a valid value for -h and -t, use the -lah command. To get a valid value for -s, use the -lss command. To get a valid value for -j, use the -ljs command. To get a valid value for -C, use the -lc command.