Name

nnmtrimincidents.sh — delete and (optionally) archive incidents

SYNOPSIS

nnmtrimincidents.sh [ [ [-age age -incr incr] | -date date | -trimOldest numberToTrim ] [-nature nature] [-lifecycle lifecycleState] [-severity severity] [-origin origin] [-name name] [-family family] [-sysobjectid sysobjectid] [-path path] [-archiveOnly] [-trimOnly] [-trimAndArchive] [-batch batchSize] [-u username] [-p password] [-quiet] ]

DESCRIPTION

nnmtrimincidents.sh is used to delete incidents from the incident table. The deleted incidents are (optionally) saved in a compressed archive file:

data_dir\tmp\incidentArchive.ISO 8601 Date.Time Ms.txt.gz

The default behavior is to delete incidents without archiving.

ARCHIVE-FORMAT

Incidents will be archived using a csv format. The column names are ordered as follows: TimeStamp(LastOccurance),Name,SourceNodeName,SourceObjectName,SysObjectID(ALWAYS_EMPTY),FormattedMessage,LifeCycleState,Severity,Priority,AssignedTo,JournalNotes,Category,Family,Nature,Origin,IncidentNotes,DuplicateCount,FirstOccuranceTime,OriginOccuranceTime,PayLoad,ElementOID

TimeStamp        - Last time this incident occurred, as a human readable time string.
Name             - Incident Name
SourceNodeName   - Source Node Short Name
SourceObjectName - Sorce Object Name
SysObjectID      - Always empty this field has been kept for backwards compatibility
FormattedMessage - Formatted string describing the incident
LifeCycleState   - Incident lifecycle state
Severity         - Incident severity
Priority         - Incident priority localized label
AssignedTo       - Account/Person holding this incident
JournalNotes     - Incident journal notes
Category         - Incident category localized label
Family           - Incident family localized label
Nature           - Incident nature
Origin           - Incident origin
IncidentNotes    - Incident notes
DuplicateCount   - # of times the incident has occured in the system
FirstOccuranceTime  - In the case of duped incidents this is the first one
OriginOccuranceTime - Timestamp for when the trap/syslog arrived into the system (if any)
PayLoad: All CIAS, "Name[Type]=Value"  seperated by | (In the case of multiple CIA)
       Name      - Name of CIA (50 chars max)
       Type      - Value type of the CIA
       Value     - Value of the CIA (2000 chars max)
ElementOID       - OID for the incident if it exists

Parameters

-ageage

Specifies the age of incidents to trim. You should use this option in conjunction with the incr option. If specified, the value for age must be greater than 0.

-incrincrement

Specifies the increment for age option. Supported increments include days, weeks, and months.

-trimOldestnumberToTrim

Specifies a number of incidents to delete from the database. The oldest numberToTrim incidents will be selected from all incidents in the database based on the options specified.

-datedate

Specifies the date from which older incidents are trimmed. The date is specified in ISO 8601 standard format: yyyy-mm-ddThh:mm:ss[+ or -]hh:mm.

-archiveOnly

Creates an archive file. Does not trim incidents. This option requires you to specify the age or date option.

-trimOnly

Trims incidents without archiving the deleted incidents. This is the default behavior.

-trimAndArchive

Trims incidents with archiving the deleted incidents.

-batchbatchSize

Specifies the batch size when trimming incidents. If specified, the value for batch must be greater than 0 and less than or equal to 1000.

-pathpath

Specifies the archive file name with a complete path. This path overrides the default archive file:

data_dir\tmp\incidentArchive.txt.gz

-jndiHosthostname

Server jndi host. Default is localhost.

-jndiPortport

Server jndi port. Default is 1099.

-lifecyclelifecycle

Specifies the lifecycle state of incidents matching the age|date to trim.

Example lifecycle states include:

Registered

InProgress

Completed

Closed

-severityseverity

Specifies the severity of incidents matching the age|date to trim.

Example severity states include:

Critical

Major

Minor

Warning

Normal

-namename

Specifies the name of incidents matching the age|date to trim.

-familyfamily

Optionally specify the family of incidents matching age|date to trim.

-sysobjectidsysobjectid

Optionally specify the device system object id of incidents matching age|date to trim.

-naturenature

Specifies the nature of incidents matching the age|date to trim.

Examples of nature include:

RootCause

SecondaryRootCause

Symptom

ServiceImpact

StreamCorrelation

None

Info

Dedup_Stream_Correlation

Rate_Stream_Correlation

-originorigin

Specifies the origin of incidents matching the age|date to trim.

Example origin states include:

ManagementSoftware

ManuallyCreated

RemotelyGenerated

SnmpTrap

Syslog

Other

-u <username>

Supply the NNMi administrator username to run the script.

-p <password>

Supply the NNMi administrator password to run the script.

-quietquiet

Specifies non-prompt mode.>

EXAMPLES

Trim incidents older than 6 days:

nnmtrimincidents.sh -age 6 -incr days

Trim incidents older than 6 weeks with a nature of Symptom:

nnmtrimincidents.sh -age 6 -incr weeks -nature Symptom

Trim incidents older than 6 months with a lifecycle state of Closed:

nnmtrimincidents.sh -age 6 -incr months -lifecycle Closed

Trim incidents older than 6 months with a severity of Normal:

nnmtrimincidents.sh -age 6 -incr months -severity Normal

Trim incidents older than the specified date:

nnmtrimincidents.sh -date 2007-07-16T19:20:30

Trim incidents older than the specified date with a nature of Symptom:

nnmtrimincidents.sh -date 2007-07-16T19:20:30+01:00 -nature Symptom

Trim incidents older than the specified date with a lifecycle state of Closed:

nnmtrimincidents.sh -date 2007-07-16T19:20:30-01:00 -lifecycle Closed

Trim incidents older than 6 days using the specified filename for the archive:

nnmtrimincidents.sh -age 6 -incr days -path "C:\BkupDir\saveIncidents.gz"

Trim incidents older than 6 days (without archiving):

nnmtrimincidents.sh -age 6 -incr days

Trim the oldest 10,000 SNMP traps with Symptom nature:

nnmtrimincidents.sh -trimOldest 10000 -nature Symptom -origin SnmpTrap

Trim incidents older than 6 days (without archiving):

nnmtrimincidents.sh -trimOnly -age 6 -incr days

Archive incidents older than 6 days (without trimming):

nnmtrimincidents.sh -archiveOnly -age 6 -incr days

Trim and archive incidents older than 6 days:

nnmtrimincidents.sh -trimAndArchive -age 6 -incr days

AUTHOR

nnmtrimincidents.sh was developed by Hewlett Packard Enterprise.

SEE ALSO

None

Return to Reference Pages Index