create_service
Creates a service to be monitored by Enterprise Manager.
Format
emcli create_service -name='name' -type='type' -availType=test|system -availOp=and|or [-hostName=<host_name> [-agentURL=<agent_url> [-properties='pname1|pval1;pname2|pval2;...'] [-timezone_region=<gmt_offset>] [-systemname=<system_name>] [-systemtype=<system_type>] [-keycomponents='keycomp1name:keycomp1type;keycomp2name:keycomp2type;...'] [-beacons='bcn1name:bcn1isKey;bcn2name:bcn2isKey;...'] [-input_file="template:Template file name]"] [-input_file="variables:Variable file name]"] [-sysAvailType=<availability_type>] [ ] indicates that the parameter is optional
Options
-
name
Service name. Names cannot contain colons ( : ), semi-colons ( ; ), or any leading or trailing blanks.
-
type
Service type.
-
availType
Sets the availability to either test-based or system-based. If availability is set to
test
, template file, beacons, and variable are required arguments. If availability is set tosystem
, systemname, systemtype, and keycomponents are required. -
availOp
Availability operator. If
and
, uses all key tests/components to decide availability. Ifor
, uses any key tests/components to decide availability. -
hostName
Network name of the system running the Management Agent that is collecting data for this target instance.
-
agentURL
URL of the Management Agent that is collecting data for this target instance. If you enter the host name, the Agent URL of the host is automatically entered in this field.
-
properties
Name-value pair (that is, prop_name|prop_value) list of properties for the service instance.
-
timezone_region
GMT offset for this target instance (-7 or -04:00 are acceptable formats).
-
systemname
System name on which service resides.
-
systemtype
Type of system for which you want to create the service.
-
keycomponents
Name-type pair (that is,
keycomp_name:keycomp_type
) list of key components in the system that are used for the service. -
beacons
Name-isKey pairs that describe the beacons of the service. If isKey is set to
Y
, beacon is set as a key-beacon of the service. The service should have at least one key beacon if the availability is set to test-based. -
input_file
Template file name is the XML file that includes the template definition. Variable file defines the values for the template.
For more information about the input_file parameter, see -input_file Syntax Guidelines.
-
sysAvailType
Type of availability when the availType is system-based. Sets the availability to either system target directly or selected components of a system.
If availability is set to 'system target directly,' the system needs to have availability[status] defined. systemname and systemtype are required parameters.
If availability is set to 'selected components of a system,' systemname, systemtype and keycomponents are required parameters.
If availability is set to 'system target directly,' and if the system does not have availability[status] defined, the availability set is invalid. Therefore, the only option that can be set is 'selected components of a system'.
Examples
Example 1
This example creates a generic service named my_service with specified properties on a generic system named my_system. The availability is set as system-based, and the availability is based on system target status.
emcli create_service -name='my service' -type='generic_service' -availType='system' -availOp='or' -sysAvailType='system target directly' -properties='prop1:value1; prop2:value2' -timezone_region='PST8PDT' -systemname='my system' -systemtype='generic_system'
Example 2
This example creates a generic service named my_service
with specified properties on a generic system named my system
with specified key components. The availability is set as system-based.
emcli create_service -name='my_service' -type='generic_service' -availType='system' -availOp='or' -properties='prop1:value1; prop2:value2' -timezone_region='PST8PDT' -systemname='my system' -systemtype='generic_system' -keycomponents='database:oracle_database; mytestbeacon:oracle_beacon'