How to generate an alarm to the 0x220011 event code, but just for a few devices
search cancel

How to generate an alarm to the 0x220011 event code, but just for a few devices

book

Article ID: 242112

calendar_today

Updated On:

Products

Spectrum Network Observability

Issue/Introduction

Customer wants the alarm generated for the 0x220011 event code, but just for a few devices (4 devices).

Environment

Release : 21.2

Component : Spectrum Alarm

Resolution

Here are the steps:

1) Edit the $SPECROOT/custom/Events/EventDisp file and add the following entries and save the file:

0x220011 E 20 P "If( \
   Regexp( \
      ReadAttribute( { C CURRENT_MODEL }, { H 0x12adb } ), \
      { S \"BGP_transition\" } \
     ), \
   CreateEventWithVariables( \
       { C CURRENT_MODEL }, \
       { H 0xfff00000 }, \
       GetEventVariableList() \
     ), \
   CreateEventWithVariables( \
      { C CURRENT_MODEL }, \
      { H 0xfff00001 }, \
      GetEventVariableList() \
     ) \
 )"

0xfff00000 E 20 A 2,0x220011

0xfff00001 E 20

 

Note: 

  • 0x12adb - CollectionsModelNameString attribute
  • BGP_transition - Global Collection name in string or RegEx format
  • 0xfff00000 - new event code ID to create if the IF is true (replace with an event code id from your environment)
  • 0xfff00001 - new event code ID to create if the IF is false (replace with an event code id from your environment)

When the device belongs to the BGP_transition Global Collection then the 0xfff00000 event code is generated and an alarm is generated. If the device does not belong to the BGP_transition Global Collection then the 0xfff00001 event code is generated and no alarm is generated.

The 0xfff00000 and 0xfff00001 are just an example of custom event codes. You have to supply your own available event codes.

2) Click on the "Update Event Configuration" button on the VNM model, under the SpectroSERVER Control subview to reload the changes made in the $SPECROOT/custom/Events/EventDisp file.

3) Launch the Event Configuration Editor and type the 220011 event code in the filter field (at the bottom). Then select the 0x00220011 event code, and in the Contents pane copy the Event Message (in yellow) to the Clipboard.

4) Type the fff000 event code in the filter field (at the bottom). Then select the 0xfff00001 event code, and in the Contents pane, paste the Event Message saved in the Clipboard. Do the same to the 0xfff00000 event code.

5) For the 0xfff00000 event code, in the Details pane, in Alarms TAB, type the Alarm Title you want in the Type field (in yellow)

6) Click on File, and then click on Save All to save the changes you made in Event Configuration Editor.

7) Create the BGP_transition Global Collection and add the devices on which you want the alarm generated for the 0x220011 event code.

8) For test purposes you can manually generate the 0x220011 event code to evaluate the Event Procedure you added into the EventDisp file in CLI.

create event type=0x220011 text=BGPTransition  mh=<device model_handle>