DX NetOps

Expand all | Collapse all

CA Spectrum Dynamic global collection creation by alert type

  • 1.  CA Spectrum Dynamic global collection creation by alert type

    Posted 02-27-2017 01:19 AM

    I having a requirement in CA Spectrum where I need to filter alerts in global collection.

     

    I want to create a dynamic global collection with alert type, but I am able to create dynamic global collection with attributes related to devices only.

     

    Let me brief my requirement below.

     

    I am having 'X' device which is having 'a' and 'b' alerts. Now I want to create two global collection in which 'X' device is added and I want to see 'a' alert in first global collection and 'b' alert in second global collection.

     

    Please help me in configuring this if anyone has came across this sort of configuration.

     

    Regards

    Vishnu Prasad



  • 2.  Re: CA Spectrum Dynamic global collection creation by alert type

    Posted 02-27-2017 05:20 AM

    Hi Vishnu,

     

    Is there any reason why you need to do this via Global Collection? I would use filters, but I assume you have some processing you want to do on these alarms?

     

    My solution would be to do this via REST. Not sure how to create a dynamic global collection for alarms, as I'm not sure this is what they were designed for.

     

    With the rest API I would look for all alarms for the device 'x', and then use the causeID's to filter out which ones I wanted. It wouldn't create global collections, but allow you to find the alarm ID's for these alarms and delete or updated them.

     

    Since you cannot filter out alarms by their alarm title (well not all of them) you have to use the Cause ID. E.g. If you want all 'DEVICE IN MAINTENENCE MODE' alarms, you use cause code 0x10222, and 'DEVICE HAS STOPPED RESPONDING TO POLLS' relates to the cause ID of 0x10009. I've noticed you cannot for example have a query saying 'show all devices with alarms containing 'CHASSIS' in them'. (This seems to work for custom alarms you create using PCause files but not built-in alarm titles!).

     

    e.g if you know the device has alarms:

     

    <rs:alarm-request throttlesize="1000"
    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">

    <rs:attribute-filter>
    <search-criteria
    xmlns="http://www.ca.com/spectrum/restful/schema/filter">

    <filtered-models>
    <equals>
    <attribute id="0x1006e">
    <value>router1</value>
    </attribute>
    </equals>
    </filtered-models>
    </search-criteria>
    </rs:attribute-filter>
    <rs:requested-attribute id="0x11f9c"/>
    <rs:requested-attribute id="0x12b4c"/>
    <rs:requested-attribute id="0x11f50"/>
    </rs:alarm-request>

     

    That will show all alarm IDs, titles and cause Codes.

     

    Filter the alarms you want and then your final query for maintenance alarms would be:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <rs:alarm-request throttlesize="1000"
    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">

    <rs:attribute-filter>
    <search-criteria
    xmlns="http://www.ca.com/spectrum/restful/schema/filter">

    <filtered-models>
    <and>
    <equals>
    <attribute id="0x1006e">
    <value>router1</value>
    </attribute>
    </equals>
    <equals>
    <attribute id="0x11f50">
    <value>0x10222</value>
    </attribute>
    </equals>
    </and>
    </filtered-models>
    </search-criteria>
    </rs:attribute-filter>
    <rs:requested-attribute id="0x12b4c"/>
    <rs:requested-attribute id="0x11f50"/>
    <rs:requested-attribute id="0x12d7f"/>
    <rs:requested-attribute id="0x1006e"/>
    </rs:alarm-request>

     

     

    If you want to filter on multiple cause ID's just replace the bits between '<filtered-models>':

     

    <filtered-models>
    <and>
    <equals>
    <attribute id="0x1006e">
    <value>router1</value>
    </attribute>
    </equals>
    <or>
    <equals>
    <attribute id="0x11f50">
    <value>0x10009</value>
    </attribute>
    </equals>
    <equals>
    <attribute id="0x11f50">
    <value>0x10f71</value>
    </attribute>
    </equals>
    </or>
    </and>
    </filtered-models>

     

    e.g. for 'DEVICE HAS STOPPED RESPONDING TO POLLS' (0x10009) and 'BLADE STATUS UNKNOWN' (0x10f71) and a device named 'router1'.

     

    Once you have this info (alarm ID's) you could write further REST calls to delete alarms, or to modify some of the attributes for that alarm (or a host of other things you might want to do to the alarms or the devices themselves!).

     

    Hope this helps. Not sure a global collection is possible, but would be interesting to see if others might know. You could potentially use the VNM Shell (vnmsh) if you use it more but not sure if it would be as easy as using the REST API.

     

    The trick with alarm manipulation/reporting is to use the Cause ID's.

     

    I hope this helps.


    Regards,


    Frank