Administer > Policies > Open Message Interface Policies > opcmsg Command Line Tool

opcmsg Command-Line Tool

The command opcmsg generates a message that Operations Connector open message interface policies evaluate.

The opcmsg command-line tool is located in:

  • Windows 32-bit: %OvInstallDir%/bin/opcmsg

  • Windows 64-bit: %OvInstallDir%/bin/win64/opcmsg

  • Linux: /opt/OV/bin/opcmsg

To enable the opcmsg command-line tool, at least one open message interface policy must be activated on the Operations Connector server. Otherwise the command displays the following message:

The OVO Message Command is not configured on this system. Contact your OVO Administrator to configure it. (OpC30-913)

Command Synopsis and Options

opcmsg [-help] 
       [-id] 
       [severity=normal|warning|minor|major|critical] 
       application=<application> 
       object=<object> 
       msg_text=<text> 
       [msg_grp=<message group>] 
       [node=<node>] 
       [service_id=<svcid>] 
       [-option <var>=<value>] 

You can specify any unique prefix for the available options. Note that the prefix for the option severity is s while the prefix for the option service_id is ser.

Option Description
[-help] Optional. Prints the usage message of opcmsg. All other options are ignored and no message is submitted.
[-id] Optional. Returns the message ID of the submitted message to stdout. This option also sets the OPCDATA_REMARK_FOR_ACK flag of the message, so that the manager information of the message is held by the message agent.
[severity=normal|warning|
minor|major|critical]
Optional. Sets the severity of the message. The following severities are supported: normal, warning, minor, major, critical. By default, the severity normal is applied.
application=<application>

Sets the application of the message.

Specify the name of the application (or script or program) that is affected by or has detected the event or problem.

object=<object>

Sets the object of the message.

Specify the name of the object (or process or sub-program) that is affected by or has detected the event or problem.

msg_text=<text>

Sets the message text of the message.

Specify a descriptive text that explains the event or problem in more detail.

[msg_grp=<message group>] Optional. Sets the message group to which the message belongs. By default, no message group is assigned.
[node=<node>]

Optional. Sets the node of the message. By default the system name of the Operations Connector system is applied.

Specify the fully qualified domain name, the system name, or the IP address of the system on which the event or problem is detected.

[service_id=<svcid>] Optional. Sets the service ID of the message. This is the ID of the service associated with the event. A service ID is a unique identifier for a service and can be used in OMi to identify the node and CI associated with the event.
[-option <var>=<value>]

Optional. Sets the variable <$OPTION(variable)> to value. You can use this variable within the policy conditions to access the value passed the opcmsg call.

Special characters must be escaped.

Exit Values

Value Description
0 Message is successfully generated.
1 Internal error.
2 Syntax or usage error. An error message displays.

Example

To submit a normal message issued when a user logs onto the system, you could set up the following scheduled task

opcmsg appl=ScheduledTask obj=login severity=normal msg_t="%USERNAME% logged onto system %COMPUTERNAME%" -option CIHint=myApplication@@%COMPUTERNAME%