SOI - Add attributes to alerts from a service using Event Policies
search cancel

SOI - Add attributes to alerts from a service using Event Policies

book

Article ID: 217171

calendar_today

Updated On:

Products

CA Service Operations Insight (SOI)

Issue/Introduction

How can we enrich alarms coming from any CI under a specific service? 

Environment

Release : 4.2

Component : SOI ALERT MANAGEMENT

Resolution

The below example explains how to add the tag "NCC" to all alerts coming in from any of the CI that belong to a particular service (in this case TestService). 

To deploy an even policy to enrich alarms from the following steps can be followed. 

The below steps needs to be performed to create and deploy the policy file:
NOTE: You need to follow the same steps to reduce the policy creation effort.


1) Create a new EventPolicy with name:(Eg.) "NCCPolicy" of "JDBC" type by providing correct DB details and deploy on either a specific connector or on MTC connector.
NOTE:: If MTC connector is selected to deploy the event policy, no other connector needs to be selected because that policy gets applied on alerts from ALL the connectors

2) Open following folders:
CA\SOI\resources\EventManagement\Policies : open file NCCPolicy.policy
CA\SOI\resources\Core\Catalogpolicy\extensions : Open file/files with name like *nccpolicy.xml

3) Search for <EventClass> tag and copy complete <EventClass> tag in notepad

4) Replace complete <EventClass> tag with the following in any one file above first and update correct DB details from the copied content in notepad:

<EventClass name='NCCPolicy' extends='Alert'>
 <FormatPostN>
        <Field conditional='AlertedMdrElementID' output='NCCPolicy_ciid' format='{0}' input='AlertedMdrElementID' />
    </FormatPostN>
    <EnrichPostN>
        <Field output="jdbcNCCPolicy" outputtype="pairedlist" type="jdbc" 
        connectionstring="COPY_ConnectionString_FROM_NOTEPAD"
        jpath="COPY_CORRECT_PATH_OF_mssql-jdbc-8.4.1.jre8.jar_FROM_NOTEPAD
        jdbcdriver="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
        query="select BNodeCIID from CIRelationship where serviceciid in (select ciid from CIStaging where label='TestService') and BNodeCIID in (select ciid from cistaging where cinamespacemapid=?)"
        returntype="string" 
        input="NCCPolicy_ciid" 
        inputtype="string" 
        column="BNodeCIID" 
        />
    </EnrichPostN>
 <FormatPostE>
        <Field conditional='jdbcNCCPolicy_BNodeCIID_0' output='userAttribute10' format='NCC' input='jdbcNCCPolicy_BNodeCIID_0' />
 </FormatPostE>
</EventClass>

NOTE:: Update the following in <EventClass> tag as required:
 Update "TestService" with the service name on which you want to apply this policy
 Update "userAttribute10" with the required user attribute which is used in the alert queue condition to apply clear alarm policy

5) Copy the above updated <EventClass> tag in all open files in #2 step above.

6) Save all files and Restart Integration Service

NOTE:: Eventpolicy is of strict type and case sensitive. If you want to create event policy file with different name, make sure that you are updating it correctly in <EventClass> tag. Any small mistake will take lots of time to debug and correct it.

Additional Information

Related KB:

SOI - Alarms do not respect Escalation Policy if they are on maintenance (broadcom.com)