publish_event
Publishes a user-reported event to Enterprise Manager. This event is published as an event of the "User-reported event" class. Only users with Manage Target privilege can publish these events for a target. An error message is reported if the publish fails.
After an event is published with a severity other than CLEAR (see below), end-users with appropriate privileges can manually clear the event from the user interface, or you can publish a new event using a severity level of CLEAR and the same details to report clearing of the underlying situation.
Format
emcli publish_event -target_name="target_name" -target_type="target_type_internal_name" -message="message_for_event" -severity="severity_level" -name="event_name" [-key="sub_component_name" [-context="name1=value1;name2=value2;.."] [-separator=context="alt._pair_separator"] [-subseparator=context="alt._name-value_separator"] [ ] indicates that the parameter is optional
Options
-
target_name
Target name.
-
target_type
Target type name.
-
message
Message to associate for the event. The message cannot exceed 4000 characters.
-
severity
Numeric severity level to associate for the event. The supported values for severity level are as follows:
- "CLEAR"
- "MINOR_WARNING"
- "WARNING"
- "CRITICAL"
- "FATAL"
-
name
Name of the event to publish. The event name cannot exceed 128 characters.
This is indicative of the nature of the event. Examples include "Disk Used Percentage," "Process Down," "Number of Queues," and so on. The name must be repeated and identical when reporting different severities for the same sequence of events. This should not have any identifying information about a specific event; for example, "Process xyz is down." To identify any specific components within a target that the event is about, see the key below.
-
key
Name of the sub-component within a target this event is related to. Examples include a disk name on a host, name of a tablespace, and so forth. The key cannot exceed 256 characters.
-
context
Additional context that can be published for a given event. This is a series of strings of format name:value separated by a semi-colon. For example, it might be useful to report the percentage size of a disk when reporting space issues on the disk. You can override the default separator ":" by using the subseperator , and the pair separator ";" by using the separator .
The context names cannot exceed 256 characters, and the values cannot exceed 4000 characters.
-
separator
Set to override the default ";" separator. You typically use this option when the name or the value contains ";". Using "=" is not supported for this option.
-
subseparator
Set to override the default ":" separator between the name-value pairs. You typically use this option when the name or value contains ":". Using "=" is not supported for this .
Examples
Example 1
This example publishes a warning event for "my acme target" indicating that a HDD restore failed, and the failure related to a component called the "Finance DB machine" on this target.
emcli publish_event -target_name="my acme target" -target_type="oracle_acme" -name="HDD restore failed" -key="Finance DB machine" -message="HDD restoration failed due to corrupt disk" -severity=WARNING
Example 2
This example publishes a minor warning event for "my acme target" indicating that a HDD restore failed, and the failure related to a component called the "Finance DB machine" on this target. It specifies additional context indicating the related disk size and name using the default separators. Note the escaping of the \ in the disk name using an additional "\".
emcli publish_event -target_name="my acme target" -target_type="oracle_acme" -name="HDD restore failed" -key="Finance DB machine" -message="HDD restoration failed due to corrupt disk" -severity=MINOR_WARNING -context="disk size":800GB\;"disk name":\\uddo0111245