The CLI offers a set of commands to perform Sun Update Connection – Enterprise functions.
The commands can be divided into the following categories:
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:
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 |
|
|
Example |
uce_cli -ld -all -u admin -p 123 |
|
Result Example |
|
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.
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 |
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 |
|
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.
The list-host-inventory command outputs the list of software installed on a given host.
Parameter |
|
|
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 |
|
To get valid values for -h, use the -lah 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 |
|
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.
The list-group-hosts command outputs the hosts that are assigned to a given group.
Parameter |
|
|
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 |
(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.
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 |
|
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.
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 |
|
The Always Ask Me policy is the default policy. Even if you have not yet created policies, this command will have output.
The list-profile-attribute command outputs the attributes, the component-requirement combinations that make up a profile.
Parameter |
|
|
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 |
|
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.
The list-policy-attribute command outputs the attributes, the component-action-answer combinations, that make up a confirmation policy.
Parameter |
|
|
Syntax |
uce_cli -lca -C "policy" [ -dlt "delimiter" ] -u username -p password |
|
Example |
uce_cli -lca -C SWAutoYes -u admin -p 123 |
|
Result Example |
|
To get valid values for -C, use the -lc 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 |
|
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.
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 | ||
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 |
Explanation: job name, mode, start time, status; for two jobs: “makeWebServer” and “anotherJob.” |
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 |
|
|
Syntax |
uce_cli -ljsa -j "jobname" [ -dlt "delimiter" ] -u username -p password |
|
Example |
uce_cli -ljsa -j ProvServer -u admin -p 123 |
|
Result Example |
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.
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 |
|
|
Syntax |
uce_cli -lss ( -g group | -h host ) [ -dlt "delimiter" ] -u username -p password |
|
Example |
|
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.
The following commands allow you to view and manage hosts and groups of hosts.
This section includes the following:
The add-host command adds predefined host data to the system before agent installation. The agent on the host adds the host automatically. If there is already a host in the system with the given host name, the command results in an error.
Parameter |
|
Syntax |
uce_cli -ah -h hostname -D distribution -u username -p password |
Example |
uce_cli -ah -h wserver03 -D RH9_IA32 -u admin -p 123 |
To get valid values for the -D parameter, use the -ld command. The value of -h must not already be in the output of the -lah command.
The delete-host command removes a host from the management of the system. This command is effective only if the agent has been stopped or uninstalled.
Parameter |
-h hostname – Specify the name of the host. |
Syntax |
uce_cli -dh -h hostname -u username -p password |
Example |
uce_cli -dh -h wserver03 -u admin -p 123 |
To get valid values for the -h parameter, use the -lah command.
The rename-host command renames a host, from an existing name to a new name. The name of the host is not the DNS name (Unique String) of the machine, but the Sun Update Connection – Enterprise name of the host. You can change this name at any time without affecting the machine or its configurations.
Parameter |
|
Syntax |
uce_cli -rh -sH hostname -tH hostname -u username -p password |
Example |
uce_cli -rg -sH lnx013 -tH mailserver_2 -u admin -p 123 |
To get valid values for the -sH parameter, use the -lah command.
A valid value for the -tH parameter is a new, unique host name. This name must not appear in the output of the -lah command.
The add-group command creates a new group of hosts.
Parameter |
|
Syntax |
uce_cli -ag -g "groupname" [ -pG "groupname" ] -u username -p password |
Example |
uce_cli -ag -g ApacheServers -pG WebServers -u admin -p 123 |
To get valid values for the -pG parameter, use the -lg command.
The add-host-group command assigns a managed host to a group.
Parameter |
|
Syntax |
uce_cli -ahg -h hostname -g "groupname" -u username -p password |
Example |
uce_cli -ahg -h wsrvr03 -g WebServers -u admin -p 123 |
To get valid values for the -h parameter, use the -lah command.
Valid values and results for the -g parameter:
If the group exists (use the -lg command), the host is added to it.
If the group does not exist, it is created and the host is assigned to it.
If the group exists, but has a parent not given in the CLI command, a new top-level group is created by the same name. You can have same-named groups of different hierarchies.
If the named group is written as a nested group (“parent/nested”), and this group-path does not exist, all the groups are created.
The delete-group command deletes a group and its sub-groups from the system. It does not unregister the managed hosts. It cannot be used on default groups.
Parameter |
-g groupname – Specify the name of the group. |
Syntax |
uce_cli -dg -g "groupname" -u username -p password |
Example |
uce_cli -dg -g WebServers -u admin -p 123 |
To get valid values for the -g parameter, use the -lg command.
The rename-group command renames a group, from an existing name to a new name.
Parameter |
|
Syntax |
uce_cli -rg -sG "groupname" -tG "groupname" -u username -p password |
Example |
uce_cli -rg -sG WebServers -tG webserver -u admin -p 123 |
To get valid values for the -sG parameter, use the -lg command.
A valid value for the -tG parameter is a new, unique group name. It must not appear in the output of the -lg command.
The following commands are used to manage local software and files.
This section includes the following:
The add-local-category command creates a new category under Local, under Probes, Pre-actions, Post-actions, Macros, or Configuration Files.
Use this command if you want to upload scripts and files to the local knowledge base. You cannot upload a local file or script until you have created a category to hold it.
Parameter |
|
Syntax |
uce_cli -alc -T "category" [ -ds "description" ] -pT "parent-category" [ -D distribution ] -u username -p password |
Example |
uce_cli -alc -T "PrintcapVersions" -ds "various config files to set up different printers" -pT "Configuration files" -u admin -p 123 |
To get a list of the valid values for the -pT parameter, use the -fc command, with "Local" as the value of its -T parameter.
One or both of "ROOT/Local/Local RPMs" or "ROOT/Local/Local PKGs" is listed, but are not valid values for the -alc command; all the other items in this output are acceptable.
The add-software-package command pushes a local software package to the local knowledge base.
Parameter |
|
Flag |
-secure – Security fix mark. If present, the local package is a security fix for a previous version. |
Syntax |
uce_cli -asp -f "pathname" [ -secure ] -D distribution [ -T category ] -u username -p password |
Example |
uce_cli -asp -f "/usr/share/myApps/myApp01.05-73.rpm" -D RH9_IA32 -u admin -p 123 |
To learn more about the security fix mark and when to use the -secure flag, see To Fix Local Software Missing Dependencies and Fixing Local Dependencies.
To get valid values for the -D parameter, use the -ld command.
The add-file-declaration command adds a file declaration to the local knowledge base. A file declaration is the target path name for installation of a local Configuration file onto managed hosts.
Parameter |
|
Syntax |
uce_cli -afd -pT "category" [ -ds "description" ] -tfp "pathname" [ -D distribution ] -u username -p password |
Example |
uce_cli -afd -pT "Configuration files/PrintcapVersions" -ds "install directory for printcap versions" -tfp "/etc/printcap" -u admin -p 123 |
Before you can create a file declaration, you have to have a category under Configuration files. Use the -alc command to create a category. To see a list of categories, use the -fc command with -T "Local/Configuration files" -sons.
The output of this command would give valid values for the -pT parameter of the -afd command. You can shorten the path of the category component to Configuration files/category. You do not need to type the full path from the root.
The add-target-local command adds a file or a script to the local knowledge base.
Parameter |
|
Syntax |
uce_cli -atl -f "pathname" -pT category [ -ds "description>" ] ( -tF | -tM | -tP | -tR | -tS name ) [ -v version ] [ -D distribution ] -u username -p password |
Example: Config file |
uce_cli -atl -f "/home/admin/myFiles/print_v5" -pT "Configuration files/PrntVer" -ds "printcap Flr5" -tF "/etc/printcap" -v "05" -u admin -p 123 |
Example: Macro |
uce_cli -atl -f "/home/admin/scripts/findhost.sh" -pT "hostname" -ds "finds local hostname for file localization" -tM "hostname" -u admin -p 123 |
Notes |
Before performing this procedure, you must have created the category PrntVer under Configuration files and the category hostname under Macros (see Add Local Category (-alc) Command). You must also have created a script to upload as a macro. The example shows a script that finds the host name of the local host. |
To find a valid value for -pT, use -fc with -T "Local/default category>/" -sons.
To find a valid value for -D, use the -ld command. If you do not name a specific distribution, the named parent category (value of -pT) must also be in all distributions.
The -t* parameter that you choose to use must match the -pT parameter. For example, if -pT is Macros/localhostname then use -tM to name the macro.
The -tM, -tP, -tR, and -tS parameters take any new name as a value.
The -tF parameter needs a file declaration as its value. If you use a new path name for this value, it creates a new file declaration. If you use -tF, you must use -v to give the Configuration file a display version.
The following commands are for profiles and confirmation policies.
This section includes the following:
The add-profile-attribute command edits an existing profile by adding a new component-setting to the profile. It may also be used to create a new profile.
Parameter |
|
Flag |
|
Syntax |
uce_cli -apa -P "profile" -T "component" ( -N | -R | -U ) [ -D distribution ] -u username -p password |
Example |
uce_cli -apa -P myWebSvr -T "httpd" -R -u admin -p 123 uce_cli -apa -P myWebSvr -T "httpd" -U -u admin -p 123 |
Result Example |
The myWebSvr profile now has two more settings than it originally had: now httpd components are Required and must be Updated. If the profile did not exist before, it is created. |
To get a valid value for a name of an existing profile for the -P parameter, use the -lp command. To get a valid value for the -T parameter, use the -fc command. To get a valid value for the -D parameter, use the -ld command.
The add-policy-attribute command edits an existing policy, by adding a new component-action-answer to the policy. This command can also be used to create a new policy.
Parameter |
|
Syntax |
uce_cli -aca -C "policy" -T "component" ( -install | -downgrade | -fix | -remove | -upgrade | -ignore ) ( yes | no | ask_me ) [ -D distribution ] -u username -p password |
Example |
uce_cli -aca -C newPolicy -T "User Interface" -remove no -u admin -p 123 |
One action parameter, and only one, is mandatory, with a value of either yes, no, or ask_me.
To get a valid value for an existing policy name for the -C parameter, use the -lc command; or use a new one to create a new policy. To get a valid value for the -T parameter, use the -fc command. To get a valid value for the -D parameter, use the -ld command.
The copy-profile command copies an existing profile to a new one. You can then use -apa command to further customize the copied profile.
Parameter |
|
Syntax |
uce_cli -cp -sP source-profile -tP target-profile -u username -p password |
Example |
uce_cli -cp -sP webServer -tP webServerHTTP -u admin -p 123 |
To get a valid value for the -sP parameter, use the -lp command.
The copy-policy command copies an existing policy to a new one. You can then use the -aca command to further customize the copied policy.
Parameter |
|
Syntax |
uce_cli -cc -sC source-policy -tC target-policy -u username -p password |
Example |
uce_cli -cc -sC SWAutoYes -tC SWYesKernelNo -u admin -p 123 |
To get valid values for the -sC parameter, use the -lc command.
The export command allows you to export Profiles or Inventories to XML files. An Sun Update Connection – Enterprise object in XML format is easy to read and edit, and can be manipulated as a file.
Parameter |
|
Syntax |
uce_cli -exp -ent ( "Profile" | "Inventory" ) -f pathname.xml [ -T "profile,profile,..." | "hostname,hostname,..." ] -u username -p password |
Example |
uce_cli -exp -ent "Profile" -f /home/stuff/httpSverProfile.xml -u admin -p 123 |
Example |
uce_cli -exp -ent "Inventory" -f /home/stuff/myHost.xml -u admin -p 123 |
Example |
uce_cli -exp -ent "Inventory" -T "lnx13,lnx10" -f /home/stuff/rpmsOf13-10.xml -u admin -p 123 |
To get valid values for -T, use the -lp command to see profiles, or the -lah to see hosts.
Be aware that as this command creates a file outside of Sun Update Connection – Enterprise, the success of the command is dependent upon your user permissions: the machine user executing the command has to have permissions to write to the path give in the -f parameter.
The import command allows you to import XML files into Sun Update Connection – Enterprise and convert them back to profiles.
Parameter |
-f filename – Specify the full path name to the XML file to import. |
Syntax |
uce_cli -imp -f path/filename.xml -u username -p password |
Example |
uce_cli -imp -f /home/stuff/httpSverProfile.xml -u admin -p 123 |
The following commands create and manage jobs and job tracking.
This section includes:
The submit-job command creates a job from a profile, a confirmation policy, and a selected host or group, and submits it to the dependency manager.
Parameter |
|
Flag |
|
Syntax |
uce_cli -sj [ -j "jobname" ] -P "profile" -C "policy" ( -g "groupname" | -h hostname ) [ -us ] ( -dp | -sm ) -u username -p password |
Example |
uce_cli -sj -j MakeWebServer -P webserverApps -C autoSW -h lnx13 -us -dp -u admin -p 123 uce_cli -sj -j 31_12_2003 -P UpgradeApache -C "Always ask me" -g webservers -sm -u admin -p 123 |
Either -h or -g must be given. If you do not give either -dp or -sm, the default mode for the job is simulate (not deploy).
To get a valid value for the -j parameter, use the -ljs command. To get a valid value for the -P parameter, use the -lp command. To get a valid value for the -C parameter, use the -lc command. To get a valid value for the -h parameter, use the -lah command. To get a valid value for the -g parameter, use the -lg command.
The delete-job command deletes a completed job from the Status list (used to keep the output of -ljs relevant), or cancels and deletes an unfinished job.
Parameter |
-j jobname – Specify the name of the job. |
Syntax |
uce_cli -dj -j "jobname" -u username -p password |
Example |
uce_cli -dj -j "MakeWebServer" -u admin -p 123 |
To get valid values for the -j parameter, use the -ljs command.
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:
The save-host-inventory command saves a snapshot (a record of the host’s inventory at the current time) of the given host.
Parameter |
|
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.
The save-group-inventory command saves a snapshot of the inventory of each host in the given group.
Parameter |
|
|
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 |
|
To get valid values for -g, use the -lg command.
The delete-saved-snapshot command deletes a selected saved snapshot.
Parameter |
|
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.
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 |
|
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.
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 |
|
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.
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 |
|
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 |
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 |
|
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.
The following commands access helpful information.
The help command outputs usage information. Notice that this command does not operate with a user name and password.
Syntax |
|