Sun Update Connection - Enterprise 1.0 User's Guide

List and Find Commands

The commands in this section are useful for all the other commands. They are used to find the values of other parameters. For example, if you have a command that needs a distribution name, run the -ld command to get the list of valid input.

This section includes the following:

List Distributions (-ld) Command

The list-distributions command outputs the supported distributions on your local system.If you add the -all flag, all Sun Update Connection – Enterprise supported distributions are output.

Use this command to get valid values for the -D (distribution) parameter used in other CLI commands.

Flag

-all List all distributions supported by Sun Update Connection – Enterprise.

Without this flag, only the distributions that have been locally activated are listed. 

Syntax

uce_cli -ld [-all] -u username -p password

Example

uce_cli -ld -u admin -p 123

Result Example


Available Distributions:
RH9_IA32
SLES8_S390

Example

uce_cli -ld -all -u admin -p 123

Result Example


Available Distributions:
RH72_IA32
RH73_IA32
RH8_IA32
RH9_IA32
FC2_IA32
AS21_IA32
ES21_IA32
AS3_IA32
ES3_IA32
WS3_IA32
AS3_AMD64
WS3_AMD64
SUSE9_IA32
SUSE92_IA32
SLES8_IA32
SLES9_IA32
SLES7_S390
SLES8_S390
SLES8_AMD64
SUSE9_AMD64
SOLARIS8_SPARC

Find Component (-fc) Command

The find-component command returns the exact names of components.

Use this command to get the values for the -T or -pT parameter used by other commands.

Parameter

  • -T component Specify the name of the component. If you type part of a name, without -sons, the output will be all components that have this string in their names. The value you specify is case-insensitive.

  • -dlt delimiter Specify the delimiter for the output.

  • -D distribution Specify the distribution to use. If not specified, the command operates on all distributions.

Flag

-sons List the contained components of the component you specified with -T.

This flag operates only if the component listed with -T is the complete name of a category or package group holding packages.

If the -T value is not unique in the Components list, include the tree path; otherwise only the first component’s sons are output.

Syntax

uce_cli -fc -T "component" [ -sons ] [ -dlt "delimiter" ] [ -D distribution ] -u username -p password

Example

uce_cli -fc -T "ROOT" -sons -dlt ", " -D RH9_IA32 -u admin -p 123

Result Example

finding categories 

ROOT/, ROOT/ARCHITECTURES, ROOT/DISTRIBUTION, ROOT/FILESYSTEM, ROOT/HANDLER, ROOT/Hardware, ROOT/Local, ROOT/SPECIAL, ROOT/Software, ROOT/extensions

Example

uce_cli -fc -T "httpd" -sons -u admin -p 123

Result Example:

finding packages 


ROOT/Software/System Environment/Daemons/httpd/httpd-2.0.40-21
ROOT/Software/System Environment/Daemons/httpd/httpd-2.0.40-21.1
ROOT/Software/System Environment/Daemons/httpd/httpd-2.0.40-21.3
ROOT/Software/System Environment/Daemons/httpd/httpd-2.0.40-21.5
ROOT/Software/System Environment/Daemons/httpd/httpd-2.0.40-21.9

Example

uce_cli -fc -T "local" -u admin -p 123

Result Example:

partial string 


ROOT/Local
ROOT/Local/Local RPMs
ROOT/SPECIAL/active_rpmdb/Local RPM DataBase version 4.0
ROOT/Software/System/Libraries/glibc-locale
ROOT/Software/System/Libraries/glibc-locale/glibc-locale-2.3.3-118 [i586]

List All Hosts (-lah) Command

The list-all-hosts command outputs a complete list of all managed hosts in the system. Use this command to get values for the -h parameter of other parameters.

Parameter

-dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -lah [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -lah -u admin -p 123

List Host Properties (-lh) Command

The list-host command outputs the properties (such as IP address, distribution, and so on) of a given host.

Parameter

-h hostname Specify the host name.

Syntax

uce_cli -lh -h hostname -u username -p password

Example

uce_cli -lh -h webserver2 -u admin -p 123

Result Example


Host Data:
Host ID = 1
Host Name = webserver2
Unique String = lnx013
Host IP = 127.0.0.2
Host Type is: standard Host (maybe Master)
Host is Connected
Distribution ID is 9
Master Group ID = 0
Master Host ID =0
listen on port 8001

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

Note that even if a managed host is not connected to Sun Update Connection – Enterprise at the time of the command, the data is still retrieved. An error number will be given (example: FailedErrCode = 34014464) if the host is not online.

List Host Inventory (-lhi) Command

The list-host-inventory command outputs the list of software installed on a given host.

Parameter

  • -h hostname Specify the host name.

  • -dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -lhi -h hostname [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -lhi -h lnx013 -dlt " " -u admin -p 123

Result Example


up2date-gnome-2.1.7-1 wu-ftpd-2.6.1-6 shapecfg-2....

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

List Groups (-lg) Command

The list-group command lists all the groups. Use this command to get values for the -g parameter used in other CLI commands.

Parameter

-dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -lg [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -lg -u admin -p 123

Result Example


RH9_IA32 hosts
SLES8_S390 hosts
All Hosts
topGroup
topGroup/nestedGroup

Notice that nested groups are listed in a path. For any command that calls for the -g parameter to list a group, if you want a nested group, type its complete group path.

Groups that are named distribution_architecture hosts are default distribution groups. When an agent registers with the SDS, its distribution is recognized and the host is added to the appropriate distribution group. Each distribution group contains all the managed hosts of that distribution. The distribution groups’ host lists are system-defined and cannot be manually changed.

The All Hosts group is also a default group. It contains the complete list of managed hosts in your environment.

List Group’s Hosts (-lgh) Command

The list-group-hosts command outputs the hosts that are assigned to a given group.

Parameter

  • -g groupname Specify the name of the group.

  • -dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -lgh -g "groupname" [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -lgh -g "topGroup/nestedGroup" -u admin -p 123

Result Example


webserver2

(Note that quotations are required for group paths and for group names that contain spaces.) 

Example

uce_cli -lgh -g "nestedGroup" -u admin -p 123

Result Example

Error: Requested group not found.

(Error indicates that parent-group path is required for nested groups.) 

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

List Profiles (-lp) Command

The list-profiles command outputs a list of all existing profiles.

Use this command to get values for the -P parameter of other CLI commands.

Parameter

-dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -lp [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -lp -u admin -p 123

Result Example


Check System
Perform Restart
Check Security
Upgrade All Components
Check Bugs Fix
Perform Restart + Reconfigure
Local Software Review
Check Withdrawn Patches

Note that the profiles listed in the result example are the default, predefined profiles. Even if you have not yet created profiles, this command will have output.

List Policies (-lc) Command

The list-policies command outputs a list of all existing policies, predefined answers for a dependency resolver (DR). Use this command to get values for the -C parameter of other CLI commands.

Parameter

-dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -lc [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -lc -dlt ", " -u admin -p 123

Result Example


autoSWchanges, lockKernelNode, Always ask me

The Always Ask Me policy is the default policy. Even if you have not yet created policies, this command will have output.

List Profile Attributes (-lpa) Command

The list-profile-attribute command outputs the attributes, the component-requirement combinations that make up a profile.

Parameter

  • -P profile Specify the name of an existing profile.

  • -dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -lpa -P "profile" [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -lpa -P "create WebServer" -u admin -p 123

Result Example


Profile name = createWebServer
from node = httpd-devel (RH9_IA32)
Install
from node = httpd (RH9_IA32)
Install
from node = httpd-manual (RH9_IA32)
Install
from node = vsftpd (RH9_IA32)
Uninstall
from node = tftp (RH9_IA32)
Uninstall
from node = ftp (RH9_IA32)
Install

To get valid values for -P, use the -lp command.

If a predefined profile is used for the -P parameter, the output will be just the name of the profile.

Notice that the action is listed under the component (node). Although the action is listed as install or uninstall or upgrade or downgrade, a profile checks compliance. If the component is already installed and the action is “Install,” nothing is done and the profile succeeds.

List Policy Attributes (-lca) Command

The list-policy-attribute command outputs the attributes, the component-action-answer combinations, that make up a confirmation policy.

Parameter

  • -C policy Specify the name of the existing confirmation policy.

  • -dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -lca -C "policy" [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -lca -C SWAutoYes -u admin -p 123

Result Example


Policy name - SWAutoYes
from node = Software (RH9_IA32) Install Yes
from node = Software (RH9_IA32) Upgrade Yes
from node = Software (RH9_IA32) Apply Fix Yes

To get valid values for -C, use the -lc command.

List Logs (-ll) Command

The list-logs command outputs logs for actions on selected components of a host or of a group. You might ask to see, for example, uninstallation actions on Local RPMs for the WebServers group, installations of Networking components on one host, or any install or uninstall of Software on All Hosts.

Parameter

  • -A action Specify the action. Legal values are All Actions, Installs, and Uninstalls.

  • -dlt delimiter Specify the delimiter for the output.

  • -g groupname Specify the name of the group.

  • -h hostname Specify the name of the host.

Syntax

uce_cli -ll -A action [ -dlt "delimiter" ] ( -g group | -h host ) -u username -p password

Example

uce_cli -ll -A Installs -h lnx13 -u admin -p 123

Result Example

Tue May 4 16:32:17 2004 lnx13 Install httpd-devel-2.0.3-1 (RH9_IA32) Job_buildWebServer rochelle

Explanation: time, host name, action, component, distribution, job name, and user name. 

Use the -lg to get values for the -g. Use the -lah to get values for the -h. Use the -ld to get values for the -D. Use the -fc to get values for the -T.

List Jobs Status (-ljs) Command

The list-job-status command outputs a list of jobs that you created with the current user name, according to the status criteria that you choose.

Parameter

-dlt delimiter Specify the delimiter for the output.

Flag

  • -all List all jobs.

  • -ok List jobs that completed successfully.

  • -fl List jobs that failed.

  • -pr List jobs that are in process.

  • -wc List jobs that are waiting for user confirmation.

Syntax

uce_cli -ljs [ -dlt "delimiter" ] ( -all | -ok | -fl | -pr | -wc ) -u username -p password

Example

uce_cli -ljs -ok -u admin -p 123

Result Example


makeWebServer
Deploy
Tue May 6 9:30:09 2004
All hosts finished successfully
anotherJob
Verify
Tue May 6 11:32:15 2004
All hosts finished successfully

Explanation: job name, mode, start time, status; for two jobs: “makeWebServer” and “anotherJob.” 

List Job Status Attributes (-ljsa) Command

The list-job-status-attributes command outputs status information (current status, profile data, and so on) of one job that you created with the current user name.

Parameter

  • -j jobname Specify the name of the job.

  • -dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -ljsa -j "jobname" [ -dlt "delimiter" ] -u username -p password

Example

uce_cli -ljsa -j ProvServer -u admin -p 123

Result Example


makeWebServer
Deploy
Tue May 6 9:30:09 2004
All hosts finished successfully

Explanation: job name, job mode, start time, and status. 

To get valid values for the -j parameter, use the -ljs command.

If a host did not end successfully, more host and profile information is output.

List Saved Snapshots (-lss) Command

The list-saved-snapshots command outputs a list of saved snapshots. When you save an inventory of a host or of a group, you create a snapshot. A snapshot is also saved, for each selected host, before a job is deployed.

Parameter

  • -h hostname Specify the name of the host.

  • -g groupname Specify the name of the group.

  • -dlt delimiter Specify the delimiter for the output.

Syntax

uce_cli -lss ( -g group | -h host ) [ -dlt "delimiter" ] -u username -p password

Example


uce_cli -lss -g WebServers -u admin -p 123
uce_cli -lss -h lnxsrvr13 -u admin -p 123

You must specify either -h or -g.

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