Using an Event Procedure to place a device in maintenance mode in CA Spectrum

Document ID : KB000031373
Last Modified Date : 14/02/2018
Show Technical Document Details

Spectrum Event Procedures:

For more details on event procedures, please see the Spectrum documentation for your installed version.

Here is the link to the 10.0 Wiki, a lot of this applies to earlier releases as well.


For this example, we will be using the 'WriteAttribute' procedure code.

This allows you to either set an attribute in Spectrum to True or False (yes/no) or utilize an event variable to set the attribute value to that (must be a writeable attribute).



WriteAttribute( \
    { C CURRENT_MODEL }, \
    { H 0xffff0001 }, \
    GetEventVariable( { U 5 } ) \
Write a value retrieved from event variable 1 to attribute 0xffff0001 of the current model.
The GetEventVariable function, retrieves the value from the variable of the event.
With the WriteAttribute function, writes the value to the model.

Maintenance Mode:

It is important to note that once a device is in maintenance mode it will no longer process traps or alarms.

So using a trap, which this example is using, will place it in maintenance but a procedure cannot be used to remove it from maintenance.

Place this code in your $SPECROOT/Custom/Events/eventdisp file:


0xffff0011 E 20 A 4,0xffff0011 P "WriteAttribute( { C CURRENT_MODEL }, { H 0x1295d }, { B False } )"


Attribute 0x1295d is the isManaged attribute.  Setting it to False effectively sets it to "no".

This can be helpful if a device is going down for a reboot and sends a trap to notify Spectrum of that case, or if a device supports 'maintenance' type of traps.