Generate alarm when the device model is destroyed but not for child models
search cancel

Generate alarm when the device model is destroyed but not for child models

book

Article ID: 389733

calendar_today

Updated On:

Products

Network Observability Spectrum

Issue/Introduction

Generate alarm when the device model is destroyed but not for child models like ports, applications, etc.

Environment

Spectrum: Any release

Resolution

You can create an Event Procedure to generate a new event on an existing model, like VNM, when a device model is destroyed. Note: You cannot generate an event on a model that was destroyed.

This Event Procedure will evaluate whether the 0x10202 event occurred on the device model (parent mode), and if positive, it will generate a new event on the VNM model. If the 0x10202 occurred on a child model it will not generate a new event. It will generate a dynamic alarm title with model_name and network_address values stored in the 0x12b4c alarm attribute ID.

Here is an example:

a) Edit (or create) the $SPECROOT/custom/Events/EventDisp file on the SpectroSERVER host and add the following (as Spectrum Install Owner account):

0xfff00003 E 0 A 2,0xfff00003,U

0x10202 E 20 P "If(And(Equals(ReadAttribute({C CURRENT_MODEL},{H 0x129fa}),ReadAttribute({C CURRENT_MODEL},{H 0x12a56})),Regexp(ReadAttribute({C CURRENT_MODEL},{H 0x12d7f}),{S \"^(?!\s*$).+\"})), CreateEventWithVariables(GetElement(GetModelsByAttrValue({U 65536},{S \"VNM\"}),{U 1}),{H 0xfff00003},SetEventVariable( GetEventVariableList(),{H 0x12b4c},Append({S \"Device model has been destroyed: \"},Append(ReadAttribute({C CURRENT_MODEL},{H 0x1006e}),Append({S \" - IP: \"}, ReadAttribute({C CURRENT_MODEL},{H 0x12d7f})))))),Nil())"

NOTE: 0xfff00003 is a custom event code that was available in my test environment. Use a custom event code that is available in your environment.

U parameter is to generate a unique alarm for each event.

b) On the OneClick Console, click on the "Update Event Configuration" button under the SpectroSERVER Control subview of the VNM model to load the changes into the SpectroSERVER memory:

c) In the Event Configuration Editor, set the Event Message for your custom event code (for this example, it is 0xfff00003):

Event Message: {S 0x12b4c}

And save the change.

d) This is the Event Procedure for 0x10202 event:

NOTE: You cannot edit the Event Procedure via Event Configuration Editor. You must use a regular Text Editor on your SpectroSERVER host.

e) Once a device model is destroyed the following alarm is generated on the VNM model: