by Tim Wort
This document is written for Oracle Enterprise Manager Ops Center version 12c. The command line interface
(CLI) documentation can be found at Command Line Interface.
tim@opsc12c:~$ /var/opt/sun/xvm/OCDoctor/cli/oc -V
OpsCenter Command Line Interface 12.1.1
tim@opsc12c:~$ /opt/SUNWoccli/bin/oc -V
OpsCenter Command Line Interface 12.1.1
Connecting via the CLI requires a Ops Center user and password.
The tab key can be used to print help messages.
Man pages and environment variables can be used.
tim@opsc12c:~$ /opt/SUNWoccli/bin/oc
Or if values are not passed with the connect command or partial values are defined then oc will prompt
for values and the password input is protected:
Pressing the tab key displays commands or sub-commands depending on the current mode of the tool.
opsc12c > [tab]
Setting the pager environment variable to true allows the use of the man command:
opsc12c > man oc
NAME
oc - Command to invoke the Oracle Enterprise Manager Ops
Center Command Line Interface.
SYNOPSIS
oc
exit
DESCRIPTION
The Oracle Enterprise Manager Ops Center Command Line Inter-
face provides a set of modes to manage the Oracle Enterprise
Manager Ops Center environment. Each mode has a set of sub-
commands to managed the objects controlled by the mode.
--More--(8%)
The sub sections of the oc are called modes, you and get information about each mode through the man page
facility or through the Command Line Interface documentation.
opsc12c > man discover
NAME
discover - Command to initiate the Discover mode and to use
its subcommands.
SYNOPSIS
clear
commit
create
execute -i profile_ID -t UFN[,UFN2,...UFNn [-n UUID] [-r UUID][-c credentialID] [-
m credentialID] [-s credentialID] [-a]
list_credentials [-i credentialID]
list_networks
list_profiles [-i profile_ID]
list_profile_credentials [-i profile_ID]
list_profile_ranges -i profile_ID
list_profiles
list_ranges [-i ipaddress_spec]
set ipaddrs=ipaddress_spec
set ipmi_user=username
set ipmi_password=password
set jmx_user=username
set jmx_password=password
set snmp_user=username
set snmp_community_string=string
set snmpv3_user=username
--More--(4%)
The next example uses a existing profile and credential for discovery:
Next the discovery is performed with the profile against a target IP address.
opsc12c/discover > execute --id 8953 -t 192.168.0.114
Using Default Driver Credentials set: [8952]
Management Mode: Agent
Job: opsc12c.83 was created using Discovery Profile ID: 8953 for discovery.
opsc12c >
NAME
groups - Command to initiate the Groups mode and to use its
subcommands.
SYNOPSIS
attach -g groupname-n assetname
create -g groupname [-d string] -p parentgroup
delete -g groupname [-c]
detach -g groupname -n assetname
list [-l]
list_members -g groupname
list_membership -n assetname [-U|--UUID assetuuid]
move -n assetname [-U|--UUID assetuuid] -f groupname_source -g
groupname_destination
poweroff -g groupname
poweron -g groupname [-n]
reset -g groupname [-f] [ -n ]
update -g groupname [-n new_groupname] [-d text] [-p parentgroup]
DESCRIPTION
The Groups mode is one of a set of modes provided by the
Oracle Enterprise Manager Ops Center Command Line Interface.
Use Groups subcommands to create sets and subsets of assets.
You can power on and power off all the assets in a group.
opsc12c/groups >
List assets and using commands without changing modes (sub-command scope):
opsc12c > gear.list
Registered Gear:
UFN | Manage state | Description
| Asset Type | UUID |
---------------------------------------------------------------------------------------
------------------------------------------------------------------------------
baxter | MANAGED | 192.168.10.100
| GlobalZone | cfe7dfa3-c8db-4d33-a504-e137a2fa69d4
opsc12c | MANAGED | Enterprise Controller OS
| GlobalZone | 31022121-6ade-4f7f-932b-1b07ac9cc1a5
sol10-12c | MANAGED | 192.168.0.114
| GlobalZone | 10a67603-00f6-4dfa-871e-3a622b2620a2
zone1 | MANAGED | zone1
| NonGlobalZone | 8a570c4d-a6cd-4c98-9f79-3b70f6a575c1
192-168-0-113 | MANAGED | Global Zone OS
| GlobalZone | e5ceffc5-e8ea-4f60-b0f4-f86290d7823f
opsc12c | MANAGED | Enterprise Controller Server
| Server | a97c58a6-9053-41f6-a1f5-b12d46624679
Soll11Client | MANAGED | None
| Server | e48ea027-7d9b-45fa-8a3b-e2b93b321e85
baxter | MANAGED | 192.168.10.100
| Server | 16dc6f4e-0611-429d-8614-0c71e4bbf8c6
Sol10-12c | MANAGED | 192.168.0.114
| Server | 72dd6eeb-01e8-4a5f-8677-2db5b9f6cde0
zone1 | MANAGED | zone1
| NonGlobalZone | d46082ee-7ec8-4146-b349-8bc395bfbeac
sol10-12c | MANAGED | Global Zone Control Domain Server
| GlobalZone | d52f7320-0ca5-4e7a-8d8d-0c653516ed2b
Sol10Client | MANAGED | Global Zone Server
| Server | 350626ff-58df-4dbd-9267-76ddf73bd9fb
192-168-0-113 | MANAGED | Global Zone Control Domain Server
| GlobalZone | 5ba1ae8c-d558-4f1c-9ece-237daf548998
sol10-12c | MANAGED | Global Zone
| GlobalZone | 2c89fedb-23e3-4b9d-9465-3bb22b879204
192-168-0-113 | MANAGED | Global Zone
| GlobalZone | bad5e492-ab93-4ed2-97cd-47b735898d16
Deleting a group.
opsc12c/groups > delete -g sol11-serv
opsc12c/groups > list -b
Groups list:
Name |
-------------------------
Sol11-zones
Sol11-update
RHEL 6
SPARC
Other Servers
Sun Blade 8000 Series
Other Chassis
RHEL 5
x86 32-bit
x64
Sun Blade 6000 / Sun Netra 6000 Series
Chassis
Other Linux
SUSE 9
Other Solaris
U-Class
Solaris 11
Oracle Linux
Oracle Linux 6
Soll Serv
V-Class
Solaris 10
Windows
Solaris 9
Other x86
Oracle Linux 5
Solaris
M-Series
Operating Systems
SUSE Linux
Other SPARC
RHEL 4
Servers
SUSE 10
Solaris 8
SUSE 11
x86
M-Series Servers
Red Hat Enterprise Linux
Dynamic System Domains
Ops Center users require an account in the OS, this exaple create a new user in Solaris 11 on the EC:
import -f [-d ] -n
Options:
-h, --help show this help message and exit
-f FILE, --filename=FILE
Specifies the location of the image file.
-d DESC, --description=DESC
Describes the image.
-n NAME, --name=NAME Name of the image
Installs a new ISO image from an image that resides on the Entreprise
controller local file system.
NAME
fwimage - Command to initiate the Fwimage mode and to use
its subcommands.
SYNOPSIS
create
delete -i imagename
list [-l]
update
DESCRIPTION
The Fwimage mode is one of a set of modes provided by the
Oracle Enterprise Manager Ops Center Command Line Interface.
Use Fwimage subcommands to create and manage firmware image
packages.
Subcommands
list [-l]
--More--(7%)
In order to delete a Firmware or OS image via the command line requires that and
profile and plan associated with the image be removed first.
NAME
deploy - Command to initiate the Deploy mode and to use its
subcommands.
SYNOPSIS
add "attribute={string|integer|true|false}[,attribute2...attributen]"
apply
dryrun
plan [-v version] plan_name ]
set "attribute={string|integer|true|false}[,attribute2...attributen]"
show [plan|results]
target [-a] [-d] [-g] [-U] assetname[,assetname2...assetnamen]
DESCRIPTION
The Deploy mode is one of a set of modes provided by the
Oracle Enterprise Manager Ops Center Command Line Interface.
Use Deploy subcommands to specify the attributes of a
deployment plan and then to deploy the plan on target
assets. You can modify the plan before you apply it; how-
ever, your changes are not saved and no new version of the
plan is created.
--More--(7%)
plan target
After deploy-setup completes the prompt drops to deploy and attributes for the plan are set,
which attributes depends on the plan type, see the chart below for plan and attribute mappings.
}
,
{
sizeOption: free
partitionType: None
mountPoint: /
device: rootdisk.s0
size: 0
fileSystemType: zfs
]
jetParamList:
[
]
class: class com.sun.xvm.services.osdeployment.SolarisManifest
timeZone: US/Mountain
scriptList: None
nis: None
userPassword: None
ldap: None
distributionTypes:
[
Developer System Support
]
serverPool: None
iscsiManualMode: False
SSHPublicKey: None
iscsiVolumeGroup: None
nameService: none
profileSubtype: Solaris_sparc
register: True
jetModules:
language: C
useIscsiDisk: False
termType: vt100
dns: None
managementCredentials: -1
baud: 9600
{
network:
{
option: None
ipmpConfig: None
{
networkConfig:
{
networkInterfaces:
[
{
gateway: None
serverInfoDevice: None
dhcpClientId: None
staticIP: False
device: GB_0
bootDevice: True
nameserver: None
networkIp: None
domainname: None
networkAllocationType: STATIC
ip: None
netmask: None
mac: None
hostname: None
network: com.sun.hss.domain:name=NORM-
192.168.103.0_24,type=Network
}
}
linkAggregationConfig: None
}
}
profileName: profile-sol-10-u9-ga-sparc-dvd
iscsiLun: 0
nfsv4DomainName: dynamic
image: sol-10-u9-ga-sparc-dvd
rootPassword: cangetin
userID: None
--------------------------------------------------
}
,
{
sizeOption: free
partitionType: None
mountPoint: /
device: rootdisk.s0
size: 0
fileSystemType: zfs
]
jetParamList:
[
]
class: class com.sun.xvm.services.osdeployment.SolarisManifest
timeZone: US/Mountain
scriptList: None
nis: None
userPassword: None
ldap: None
distributionTypes:
[
Developer System Support
]
serverPool: None
iscsiManualMode: False
SSHPublicKey: None
iscsiVolumeGroup: None
nameService: none
profileSubtype: Solaris_sparc
register: True
jetModules:
language: C
useIscsiDisk: False
termType: vt100
dns: None
managementCredentials: -1
baud: 9600
{
network:
{
option: None
ipmpConfig: None
{
networkConfig:
{
networkInterfaces:
[
{
gateway: None
serverInfoDevice: None
dhcpClientId: None
staticIP: False
device: GB_0
bootDevice: True
nameserver: None
networkIp: None
domainname: None
networkAllocationType: STATIC
ip: 192.168.103.81
netmask: None
mac: None
hostname: None
network: com.sun.hss.domain:name=NORM-
192.168.103.0_24,type=Network
}
}
{
linkAggregationConfig:
{
ip: 192.168.103.81
}
}
}
}
profileName: profile-sol-10-u9-ga-sparc-dvd
iscsiLun: 0
nfsv4DomainName: dynamic
image: sol-10-u9-ga-sparc-dvd
rootPassword: cangetin
userID: None
--------------------------------------------------
ec-08.18
SYNOPSIS
add_configuration_file -f filename -p pathname -v version -c category -d
description -C channel
add_file_to_distro -f path_name -o distro_name -a category [-s]
add_local_action -a action -f filename -p parent_category -d description -c
channel-t macro|postaction|preaction|probe
add_local_category -c category_name -p parent_category -d description -o
distro_name [-r]
apply_profile_to_gear -g asset_name -y policy_name -f profile_name [-r continue|
abort_any] [ -x sequential|parallel] [ -j job_name] [-e job_description] [-k
task_name] [-o seconds] [-a]
bulk_upload_directory -D distribution -d directory
check_disconnected_mode
check_guus [-u username] [-p password] [--proxy proxy_hostname [--port proxy_port
[--proxyuser proxy_username] [--proxypass proxypassword]
check_inventory [-a| -g asset_name] [-t snapshot_name] [-f filename] [-c] [ -d
delimiter] [-e enclosure] [-r [ -p ]
create_historical_snapshot -g asset_name -s snapshot_name [-d description]
create_profile [-o][ --si =searchstring_install] [--su=searchstring_upgrade] [--
sr=searchstring_uninstall] [--ni=nodeID_install] [--nu=nodeID_upgrade] [--
nr=nodeID_uninstall] [--sisubstring] [ --susubstring ] [ --srsubstring ] [ -f
profile_name] [-l profile_description] [-n creatorname ] [-a] [ -c ] [ -d ] [ -r ]
create_profile_from_inventory -g asset_name [-t snapshot_name] [-f profile_name]
[-l description] [-n creator_name] -r
delete_component -i node_id -d distribution [-k]
delete_profiles -p profile_name|profile_name1, profile_name2...profile_namen
delete_snapshots [-g assetname] [-s snapshotname]
find_nodes -s searchstring [-a] [ -l ] [ -c ] [ -d ]
get_job_status -i jobID [-a] [ -l ] [ -c ] [ -r ] [ -f filename] [-t
snapshot_name] [-d delimiter] [-e enclosure] [-p]
job_history -g asset_name|asset_name1,...asset_namen [-f from_date] [-t to_date]
[-i jobid|jobid1,...jobidn] [-l] [ --fail ] [ --ok ] [ ---warning ] [ --nostatus ] [
--install ] [ -upgrade ] [ --uninstall ] [ --downgrade ] [ --detail ]
list_distros [-a]
list_policies [-l]
list_profiles [-l] -p profile_name
list_snapshots [-g assetname]
load_kb_bundle -f path_name
modify_gear -g assetname [--si=searchstring_install] [--su=searchstring_upgrade]
[--sr=searchstring_uninstall] [--ni=nodeID_install] [--nu=nodeID_upgrade] [--
nr=nodeID_uninstall] [--sisubstring] [ --susubstring ] [ --srsubstring ] [ -j jobID]
[-e job_description] [-k task] -y policy [-f profilename] [-l profile_description] [-r
failure_policy] [-x execution_policy] [-n creatorname] [-o seconds] seconds [-c] [ -a ]
[ -d ] [ -p ]
search_inventory [-g assetname] [-a] -s searchstring [-t snapshot_name] [-n] [
-l ] [ -c ] [ -f filename] [-d delimiter] [-e enclosure] [-p] [ -o nb_loop]
set_component_file -n component_name -d distro_name -f filename
set_connected_mode [-c]|[ -d ]
DESCRIPTION
The Update mode is one of a set of modes provided by the
Oracle Enterprise Manager Ops Center Command Line Interface.
Use Update subcommands to manage the local inventory of a
host.
--More--(4%)
Name: No To All
Description: System policy that denies all actions
Policy Type: SYSTEM
Last Update: Sat Oct 27 14:13:18 GMT-07:00 2012
--More--(38%)
add_configuration_file add_file_to_distro
add_local_action add_local_category
apply_profile_to_gear bulk_upload_directory
check_disconnected check_guus
check_inventory create_historical_snapshot
create_profile create_profile_from_inventory
delete_component delete_profiles
delete_snapshots find_nodes
get_job_status job_history
list_distros list_policies
list_profiles list_snapshots
load_kb_bundle modify_gear
search_inventory set_component_file
set_connected_mode
Create a profile from packages that match one or more of the criteria
---------------------------------------------------------------------------------------
--
You must supply a search string or node id.
---------------------------------------------------------------------------------------
--
Checking Connectivity.
ec-08/update > check_disconnected
---------------------------------------------------------------------------------------
--------------
xVM Ops Center is in disconnected mode.
---------------------------------------------------------------------------------------
--------------
NAME
incidents - Command to initiate the Incidents mode and to
use its subcommands. The Incidents subcommands manages
notices that thresholds have been exceeded and hardware
faults.
SYNOPSIS
acknowledge -i|--incidents incidentID[,incidentID2,..,incidentIDn] [-n|--note
text]
annotate -i|--incidents incidentID[,incidentID2,..,incidentIDn] [-n|--note text]
[-s|--synopsis text] [-t|--type comment|suggested_action]
assign -i|--incidents incidentID[,incidentID2,..,incidentIDn] -u|--user owner
close -i|--incidents incidentID[,incidentID2,..,incidentIDn] -n|--note text -d|--
disable-delay minutes
list [-l|--details] [ -s|--state state] [-u|--user owner]
show -i|--incidents incidentID[,incidentID2,..,incidentIDn]
DESCRIPTION
The Incidents mode is one of a set of modes provided by the
Oracle Enterprise Manager Ops Center Command Line Interface.
Use Incidents subcommands to
Subcommands
list [-l|--details] [-s|--state state] [-u|--user owner]
splays a list of current incidents. You can restrict
the list to the specified type of incident (state) or to
assigned owner.
acknowledge -i|--incidents
incidentID[,incidentID2,..,incidentIDn] [-n|--note text]
ccepts the assignment of one or more incidents. You can
add some text to the detailed information to indicate
activity on the incidents such as the type of investiga-
tion or status.
annotate -i|--incidents
incidentID[,incidentID2,..,incidentIDn] [-s|--synopsis text
[-n|--note text] [-t|--type comment|suggested_action]
dds a synopsis of your new information to the detailed
--More--(21%)
08 > incidents
opsc12c/incidents > [tab]
root@ec-08:~ # /opt/SUNWoccli/bin/oc
root@opsc12c:~#