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

opr-archive-events Command-Line Tool

In OMi, events are automatically archived by a background process in a configurable interval. Event auto archiving can be configured using the infrastructure setting Event Auto Archiving Settings.

To access:

Administration > Setup and Maintenance > Infrastructure Settings

Alternatively, click Infrastructure Settings.

Select Applications and use the list to set the administration context to Operations Management. Scroll to Operations Management - Event Auto Archiving Settings.

To manually delete closed events from the database and add them to an archive file, you can use the database maintenance command-line tool opr-archive-events.

Note Importing closed events is not supported.

Location

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

<OMi_HOME>/bin/opr-archive-events

Default:

Windows: C:\HPBSM\bin

Linux: /opt/HP/BSM/bin

Synopsis

opr-archive-events
       opr-archive-events -u <date> -o <ouputPathAndFileName>[-a][-s][-force][-utc][-i <severities>] [-n <nodeId>] [-c <category>]
        opr-archive-events -olderThan <relative time> -o <outputPathAndFileName> [-a][-s][-force][-utc][-i <severities>][-n <nodeId>][-c <category>]
        opr-archive-events -u <date> -d [-s][-force][-utc][-i <severities>][-n <nodeID>][-c <category>]
        opr-archive-events -id <eventID> [<event_id,...>]] -o <outputPathAndFileName> [-force]
        opr-archive-events -h

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

Options

Option Description
-a,--archiveOnly <archive file>

Only archives events without deleting them from the database.

-c,--category <category>

Archives or deletes events belonging to the specified category.

-d,--deleteOnly

Deletes only the events from the database without archiving.

-force

Archives events without asking user for confirmation.

-h,--help

Displays a summary of the command options and exits.

-i,--severities <severities>

Archives or deletes only events having the specified severities (for example, major, critical).

-id <id>

Archives event(s) with the specified ID(s). To archive multiple events, use a comma to separate the IDs.

Must be used in conjunction with the -o option.

Cannot be used in conjunction with the -d option.

-n,--nodeId <nodeId>

Archives the events related to the specified node.

-o,--output <archive_file>

Path and name of XML file used to store archived events.

-s,--sweepOrphans

Deletes all orphaned objects not related to events. This option is ignored if '-a' is specified.

-t,--olderThan <older_than>

Archives events which are older than the specified time.

Example: opr-archive-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 archived. The time argument can also accept a subset of days, hours, minutes, and seconds, for example, the parameter "-olderThan 3D" is also valid.

-u,--until <date>

Archives the events that where received before the specified 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-archive-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-archive-events must be granted access to the Events database.

Tip In the XML output file of the archiving tool, use the modifiedBy attribute to identify the event property that was changed by a user, identified by their OMi username.