Develop > Command-Line Interfaces > opr-close-events Command-Line Tool

opr-close-events Command-Line Tool

It is possible that a certain problem in the IT environment results in the generation of a very large number of similar events (event storm) which are received by OMi. Browsing through and filtering a large number of events can be time-consuming and can lead to time-out errors. After an event storm occurs, for example, you can use the opr-close-events command-line tool to close all active events that are related to a specific node, related CI, or a combination of both node and related CI.

Time-outs may be experienced as a result of delays in processing a large number of events in the web application, for example, when you select all events in the browser and attempt to close them. The user interface server may take a long time to start up or may experience a memory bottleneck.

You can use the opr-close-events command-line tool to close a large number of events, including related events, as experienced during an event storm, even when the OMi user interface is not responding.

Note Event processing might stop for some time after the tool finishes execution.

Location

The opr-close-events command-line tool is available only on data processing servers at:

<OMi_HOME>/bin/opr-close-events

Default:

Windows: C:\HPBSM\bin

Linux: /opt/HP/BSM/bin

Synopsis

opr-close-events [-f <date>] [-u <date>] [-s <severity>] [-force] [-utc]
                  [-n <ci_id> [<ci_id>, ...]] [-c <ci_id> [<ci_id>, ...]]
opr-close-events -all [-force] [-utc]
opr-close-events -olderThan <relative time> [-force] [-n <ci_id>
[<ci_id>, ...]] [-c <ci_id> [<ci_id>, ...]]
opr-close-events -id <evt_id> [<evt_id>, ...]] [-force]
opr-close-events -h
opr-close-events -title <title> [-s <severity>] [-force] [-c <ci_id>, ...] [-f <date>] [-u <date>][-utc] [-n <ci_id>, ...] [-r]

Note You can combine the options that are given between square brackets. Otherwise, use the rest of the options separately.

Options

Option Description

-all

Closes all events.

-c,--relatedCiId <relatedCiId>

Specify one or more CMDB CI IDs, each representing a CI of any type. All events that are related to the specified CIs are closed and all event browsers are refreshed.

You can find the CMDB ID from the General properties of the related CI. For example, the CMDB ID for the related CI myApache Tomcat Service will be of the following format: ef372b80d3ed6bbeecf1a7d1a960dcb7.

The -c option can be used in combination with the -n option to select all events that match both the specified node and the specified related CI. To close events that are related to both a node and a particular CI, combine the -c and -n options and specify the CMDB ID for the related CI and the CMDB ID for the node. Your command should take the following form:

opr-close-events -n 1e3aab8e7ecd24482a8118e24200f981 -c ef372b80d3ed6bbeecf1a7d1a960dcb7

-f,--from <date>

Closes events (including related events) received after the specified time. This option can be combined with severity and until time. The time must be specified in one of the following formats:

yyyy.mm.dd-hh:mm:ss
yyyy.mm.dd-hh:mm
yyyy.mm.dd-hh
yyyy.mm.dd

-force

Closes events without asking user for confirmation.

-h,--help

Displays a summary of the command options and exits.

-i,--id <id>

Closes events with the specified event ID(s).

Example: opr-close-events -i 0e25d750-cbd9-71e4-14c8-c0a8fe380000,0beeb342-cb90-71e4-156e-c0a8fe380000 -force

-n,--node <node>

Specify one or more CMDB CI IDs, each representing a CI of type Node. All events that are related to the specified Nodes are closed and all event browsers are refreshed.

You can find the CMDB ID from the General properties of the related CI. For example, the CMDB ID for the node mynode.example.com will be of the following format: 1e3aab8e7ecd24482a8118e24200f981.

The -n option can be used in combination with the -c option to select all events that match both the specified node and the specified related CI. To close events that are related to both a node and a particular CI, combine the -c and -n options and specify the CMDB ID for the related CI and the CMDB ID for the node. Your command should take the following form:

opr-close-events -n 1e3aab8e7ecd24482a8118e24200f981 -c ef372b80d3ed6bbeecf1a7d1a960dcb7

-r,--resetHIs

Resets health indicators after closing of events.

-s,--severity <severity>

Closes events of the specified severity. This option can be combined with from time and until time. The severity can be one of the following: NORMAL, WARNING, MINOR, MAJOR, CRITICAL.

-t,--olderThan <older_than>

Closes events which are older than the specified time.

Example: opr-close-events .... -olderThan 3D12H5M12S

In the example all events which have as time received a value older than the current time (time at executing the CLI) minus 3 days and 12 hours and 5 minutes and 12 seconds are closed. The time argument can also accept a subset of days, hours, minutes, and seconds, for example, the parameter "-olderThan 3D" is also valid.

-title <title>

Closes events with the specified event title. This option can be combined with severity, from time, until time, olderThan, relatedChild, node, force, resetHIs and utc.

Example: opr-close-events -title test

In the example all events whose titles equal "test" are closed.
To close events whose titles do not equal, but contain the specified text, wildcards can be used.

Example: opr-close-events -title *test*

In this example all events whose titles contain "test" are closed.

Note This option is case-sensitive.

-u,--until <date>

Closes events received before the specified time. This option can be combined with severity and from time. The time must be specified in one of the following formats:

yyyy.mm.dd-hh:mm:ss
yyyy.mm.dd-hh:mm
yyyy.mm.dd-hh
yyyy.mm.dd

-utc

Thread date/time parameter as UTC time.

Restrictions

The user running the opr-close-events command-line tool must be a local user (Windows) or the user under which the OMi processes are running (Linux). If the SQL Server instance uses Windows Authentication Mode, the user running opr-close-events must be granted access to the Events database.