DX NetOps

 View Only
  • 1.  Best Practise to export all Spectrum alarms using Web Services subscription

    Posted Feb 25, 2016 06:05 AM

    I looked up different threads here, but none of it covers my questions entirely.

    I'd like to get a regular export of all new created, existing updated and cleared alarms of Spectrum for nearly all alarm and model attributes. From the Web Services API documentation I understood this can done by using push or pull subscriptions.

     

    Is there any recommandation/existing implementation how to best do this?

     

    Push or Pull?

    How to handle the expiration of subscriptions?

    How to interpret the output of an subscription? From a first try using several alarm attributes in POST for a new subscription, the output of the GET pull includes the modifications/notifications, but is not referencing the attribute itself - just the value? See example below:

     

    {"ns1.notification-list":{"ns1.modified-instance":[{"ns1.alarm":{"@id":"56c7a6a4-59ee-1000-04cc-008010563ca5"},"ns1.attribute-change-value":{"ns1.new-value":"[[B@1b094d8"}},{"ns1.alarm":{"@id":"56c7a6a4-59ee-1000-04cc-008010563ca5"},"ns1.attribute-change-value":{"ns1.new-value":0}}],"ns1.removed-instance":{"@deleted":"true","ns1.alarm":{"@id":"56c7a6a4-59ee-1000-04cc-008010563ca5"}}}}

    Robert



  • 2.  Re: Best Practise to export all Spectrum alarms using Web Services subscription

    Broadcom Employee
    Posted Mar 14, 2016 08:36 AM

    Hi ,

    What is the Spectrum version ?

    Could you please post the XML used in POST call for subscription ,  this will help in reproducing the scenario .

     

     

    Regards

    Jayakrishna.K



  • 3.  Re: Best Practise to export all Spectrum alarms using Web Services subscription

    Posted Mar 14, 2016 09:26 AM

    This is the XML used to create the pull subscription, POST to http://SpectroServerIP:8080/spectrum/restful/subscription

    Header used

    Authorization: Basic ***

    Accept: application/json

    Content-Type: application/xml; charset=utf-8

     

    <?xml version="1.0" encoding="UTF-8"?>
    <rs:subscription-request
      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 ../../../Rest.a/src/xsd/Request.xsd">
      <!-- The client will poll for notifications, return up to 200
           models per poll and the client will poll approximately once
           every 30 seconds.  After 3 missed polls the server will
           assume the poller is no longer running and stop collecting
           data for this subscription
       -->
      <rs:pull-delivery-mode>
        <rs:max-notifications>200</rs:max-notifications>
        <rs:pull-interval>30000</rs:pull-interval>
      </rs:pull-delivery-mode>
      <rs:alarm-request>  
        <rs:requested-attribute id="0x10000" /> <!-- Model Type Name - Text String -->
        <rs:requested-attribute id="0x10001" /> <!-- Model Type of Alarmed Model - Model Type Handle -->
        <rs:requested-attribute id="0x10009" /> <!-- Security String - Text String -->
        <rs:requested-attribute id="0x1000a" /> <!-- Condition - Integer -->
        <rs:requested-attribute id="0x1006e" /> <!-- Model Name - Text String -->
        <rs:requested-attribute id="0x11ee8" /> <!-- Model Class - Integer -->
        <rs:requested-attribute id="0x11f4d" /> <!-- Acknowledged - Boolean -->
        <rs:requested-attribute id="0x11f4e" /> <!-- Creation Date - Date -->
        <rs:requested-attribute id="0x11f4f" /> <!-- Alarm Status - Text String -->
        <rs:requested-attribute id="0x11f50" /> <!-- Cause Code - Integer -->
        <rs:requested-attribute id="0x11f52" /> <!-- Event ID List - Octet String -->
        <rs:requested-attribute id="0x11f53" /> <!-- Model Handle of Alarmed Model - Model Handle -->
        <rs:requested-attribute id="0x11f54" /> <!-- Primary Alarm - Boolean -->
        <rs:requested-attribute id="0x11f56" /> <!-- Severity - Integer -->
        <rs:requested-attribute id="0x11f57" /> <!-- Troubleshooter - Text String -->
        <rs:requested-attribute id="0x11f9b" /> <!-- User Clearable - Boolean -->
        <rs:requested-attribute id="0x11f9c" /> <!-- Alarm ID - Octet String -->
        <rs:requested-attribute id="0x11fc4" /> <!-- Alarm Source - Enumeration (0=Current, 1=Residual) -->
        <rs:requested-attribute id="0x11fc5" /> <!-- Occurrences - Gauge -->
        <rs:requested-attribute id="0x11fc6" /> <!-- Troubleshooter Model Handle - Model Handle -->
        <rs:requested-attribute id="0x12022" /> <!-- Trouble Ticket ID - Text String -->
        <rs:requested-attribute id="0x1296e" /> <!-- Originating Event - Octet String -->
        <rs:requested-attribute id="0x12a04" /> <!-- Symptom List - Octet String -->
        <rs:requested-attribute id="0x12a05" /> <!-- Cause List - Octet String -->
        <rs:requested-attribute id="0x12a06" /> <!-- Symptom Count - Integer -->
        <rs:requested-attribute id="0x12a07" /> <!-- Cause Count - Integer -->
        <rs:requested-attribute id="0x12a56" /> <!-- Significant Model ID - Integer -->
        <rs:requested-attribute id="0x12a63" /> <!-- Web Context URL - Text String -->
        <rs:requested-attribute id="0x12a6f" /> <!-- Event Symptom List - Octet String -->
        <rs:requested-attribute id="0x12a70" /> <!-- Event Symptom Count - Integer -->
        <rs:requested-attribute id="0x12a82" /> <!-- IP to Domain Map - Octet String -->
        <rs:requested-attribute id="0x12b4c" /> <!-- Alarm Title - Text String -->
        <rs:requested-attribute id="0x12c05" /> <!-- Secure Domain Display - Text String -->
        <rs:requested-attribute id="0x12d7f" /> <!-- Network Address - Internet Address -->
        <rs:requested-attribute id="0x12d83" /> <!-- Secure Domain Address - Internet Address -->
        <rs:requested-attribute id="0x1321a" /> <!-- Last Occurrence Date - Date -->
    </rs:alarm-request>
    </rs:subscription-request>
    

     

    and this to GET the pull subscription by its ID

    http://SpectroServerIP:8080/spectrum/restful/subscription/<subscription ID>

    Authorization: Basic ***

    Accept: application/json



  • 4.  Re: Best Practise to export all Spectrum alarms using Web Services subscription

    Broadcom Employee
    Posted Mar 14, 2016 12:32 PM

    Could you please confirm the Spectrum version .

     

    I tried the request in 10.1 , the attribute ids are sent :

     

    {"ns1.notification-list":{"ns1.added-instance":{"@preexisting":"false","ns1.alarm":{"@id":"56e6e630-737c-1001-0242-008010f10000","ns1.attribute":[{"@id":"0x10001","$":"2162700"},{"@id":"0x10000","$":"Rtr_Cisco"},{"@id":"0x12d83","$":""},{"@id":"0x12a82","$":"IdToDomainMap: number of mappings: 0 "},{"@id":"0x11fc5","$":"1"},{"@id":"0x12a05","$":""},{"@id":"0x12c05","$":"Directly Managed"},{"@id":"0x11fc4","$":"0"},{"@id":"0x12a04","$":""},{"@id":"0x12a07","$":"0"},{"@id":"0x11fc6","$":"0x0"},{"@id":"0x12a06","$":"0"},{"@id":"0x10009","$":""},{"@id":"0x1000a","$":"3"},{"@id":"0x11f4d","$":"false"},{"@id":"0x12b4c","$":"DEVICE HAS STOPPED RESPONDING TO POLLS"},{"@id":"0x11f4f","$":""},{"@id":"0x11f4e","$":"1457972784"},{"@id":"0x11f50","$":"65545"},{"@id":"0x11f53","$":"0x20015f"},{"@id":"0x11f52","$":"[[B@16c60243"},{"@id":"0x11f54","$":"true"},{"@id":"0x11f57","$":""},{"@id":"0x11f56","$":"3"},{"@id":"0x12a56","$":"0x20015f"},{"@id":"0x11f9b","$":"false"},{"@id":"0x1321a","$":"1457972784"},{"@id":"0x11f9c","$":"56e6e630-737c-1001-0242-008010f10000"},{"@id":"0x12a63","$":""},{"@id":"0x12022","$":""},{"@id":"0x11ee8","$":"4"},{"@id":"0x12a6f","$":""},{"@id":"0x1006e","$":"abc.x.com"},{"@id":"0x1296e","$":"Device abc.x.com of type Rtr_Cisco has stopped responding to polls and\/or external requests.  An alarm will be generated."},{"@id":"0x12a70","$":"0"},{"@id":"0x12d7f","$":"38.42.96.26"}]}}}}



  • 5.  Re: Best Practise to export all Spectrum alarms using Web Services subscription

    Posted Mar 15, 2016 03:36 AM

    cat .install_history

    9.4.0.0.223 05/28/2015 08:41,tomct_cus|,SUCCESS

    9.4.2.1.62 05/28/2015 10:13,tomct_cus|,SUCCESS



  • 6.  Re: Best Practise to export all Spectrum alarms using Web Services subscription

    Broadcom Employee
    Posted Mar 15, 2016 06:02 AM

    I don't have the 9.4.x Spectrum to check , is it possible to check in Spectrum 10.1 ?