How can I use Java Webservices to get alarms from a Spectrum Global Collection through an Alarm Filter?

book

Article ID: 103654

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

There may be a need to get alarms from a Spectrum Global Collection by using Java Webservices (REST API).  This knowledge article explains how this can be done in CA Spectrum.

How can I use Java Webservices to get alarms from a Spectrum Global Collection through an Alarm Filter?

Environment

Any version of Spectrum

Resolution

The first problem is that there is no direct way to make an alarm filter from a Global Collection, currently in Spectrum this not possible and there is an open Enhancement Request for this.
 
https://communities.ca.com/ideas/235715123
 
However I have found a workaround that works to get around this limitation.  In order to create an Alarm Filter from a Global Collection, there is an indirect way that you can do this.

   1. Find an attribute that is not currently being used, I have chosen the Notes (0x11564) attribute. If this attribute is already being used then you can chose another like any of the user_Asset* attributes that allow for a text string. Next is to go to your Global Collection that you want to pull alarms from and go to the List view and highlight all of the objects.  Then right click and launch Attribute Editor from Utilities menu.


   2.  From Attribute Editor, expand Asset Information and select the attribute that you have chosen from step 1.


   3.  Uncheck "No Change" and give the attribute a name such as the name of your Global Collection to make things simple and click   apply. This value will be written to all devices that you have selected that are in that Global Collection.


   4. To create the alarm filter for the Global Collection we need to go to Preferences, Alarms Tab and then Alarm Filter.


   5. Create the alarm filter with whatever criteria you are interested in but be sure to add the following Attribute <Notes> Equals to <Global Collection Name>

 
   6. Save the alarm filter as the Global Collection Name and then use whatever REST Client you use to get the alarms.
 
Please refer to knowledge article  77691 "How can I use Java Webservices to pull alarms from OneClick using an Alarm Filter"
 
On my Spectrum 10.2.3 Lab Server I use the following command and I receive 19 alarms from my Global Collection.

http://<OneClick Server>:<port>/spectrum/restful/alarms/filter

XML Body

<?xml version="1.0" encoding="UTF-8"?>
<rs:alarm-request throttlesize="500"
xmlns:rs="http://www.ca.com/spectrum/restful/schema/request"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request
../../../xsd/Request.xsd ">
<!-- This xml can be posted to the Alarms URL to obtain
attributes on the specified alarms
-->
<!-- Attributes of Interest -->
<!-- -->
<rs:requested-attribute id="0x1006e" />
<rs:requested-attribute id="0x129fa" />
<rs:requested-attribute id="0x11ee8" />
<rs:requested-attribute id="0x12d7f" />
<rs:requested-attribute id="0x10000"/> <!--Model Type Name-->
<rs:requested-attribute id="0x10001"/> <!--Model Type of Alarmed Model-->
<rs:requested-attribute id="0x10009"/> <!--Security String-->
<rs:requested-attribute id="0x1000a"/> <!--Condition-->
<rs:requested-attribute id="0x1006e"/> <!--Model Name-->
<rs:requested-attribute id="0x11ee8"/> <!--Model Class-->

<rs:alarm-filter name="<alarm filter name>"/>

</rs:alarm-request>
 
 
When I compare the results from this to the alarms in OneClick for that Global Collection I get the same 19 alarms.