SD-WAN

 View Only
last person joined: 13 days ago 

Ask questions and share experiences with SD-WAN and Session Smart Router (formerly 128T).
  • 1.  Alarms and monitoring

    Posted 06-15-2020 08:34
    Hi All,

    We have recently received a request from one of our customers to make the Alarms visible for polling to an external platform. 

    I would like to know what the relevant API calls are for getting the current alarms out of the conductor, as well as how the alarms are formatted so that we can work on how the data should be presented.

    Are there any documents specifically aimed at this sort of thing? We were thinking about using the API function to get the information out of the conductor onto another dashboard, and then having a filter for relevant alarms. Is it easier to do this through events or alarms on the conductor? 

    Also - how do other customers do this sort of thing? 

    Regards,

    ------------------------------
    Morne Vermeulen
    Core Engineer
    +27 (0) 10 141 8512
    ------------------------------


  • 2.  RE: Alarms and monitoring

     
    Posted 06-18-2020 05:24

    Hi Morne,

    You can interact with the conductor's API in the same way as our own web ui does.

    In short there three steps for each conductor you want to integrate:

    1. Login to the API in order to get a token
    2. Query GraphQL to get a list of (non shelved) alarms
    3. Filter the data as needed - the result data is in json format

    The actual implementation of the calls depends on the programming language (Python, Javascript, Ruby, ...) of your customer's platform, however the calls should be pretty similar. In the snippets below I used "curl":

    First - login:

    $ curl -X POST 'https://<conductor-fqdn>/api/v1/login' \
    -H 'accept: application/JSON' \
    -H 'Content-Type: application/json' \
    -d '{ "username": "api-user", "password": "secret"}'

    The API key starts with eyJhbGciOiJSUzI1NiIs...

    Second - GraphQL:

    $ result=$(curl -s -X POST 'https://<conductor-fqdn>/api/v1/graphql' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIs...' \
    -d '{ "query": "{ allAlarms(shelvedStatus: NOTSHELVED) { nodes {id node router time severity source category message shelvedStatus shelvedReason value process } } }"}')
    

    Third - filtering (I just dump the data...)

    There are two ways to filter - already at the query (just list the fields you are after) or post query by filtering the json result.

    $ echo "$result" | python -m json.tool
    {
        "data": {
            "allAlarms": {
                "nodes": [
                    {
                        "category": "SYSTEM",
                        "id": "d4db8193-3fa3-45c0-b55e-d70a50995b37",
                        "message": "No connectivity to sample-node.sample-router",
                        "node": "sample-conductor",
                        "process": "stateMonitor",
                        "router": "sample-conductor",
                        "severity": "MAJOR",
                        "shelvedReason": "",
                        "shelvedStatus": "NOTSHELVED",
                        "source": "",
                        "time": "2020-06-18 00:00:00Z",
                        "value": null
                    }
                ]
            }
        }
    }

    Please keep in mind that this is a synchronous interface, so your customer's platform has to poll this API regularly (e.g. every 5 minutes).



    ------------------------------
    Mathias Jeschke
    Sales Engineer
    Burlington MA
    +1.781.203.8400
    ------------------------------



  • 3.  RE: Alarms and monitoring

    Posted 08-03-2020 04:01
    Hi Mathias, 

    Thanks for the information, however we seem to have hit an issue. 

    On the platform we're polling from, the devs are looking for an ADD/CLEAR alarm for them to properly process the information and display the relevant stuff on a dashboard.

    Is there a way for us to do this via the alarm queries, or should be rather query the event history of these devices? I ideally don't want to go down the path of Syslog- that is to say if it's possible to avoid it. 

    Regards,

    ------------------------------
    Morne Vermeulen
    Core Engineer
    +27 (0) 10 141 8512
    ------------------------------



  • 4.  RE: Alarms and monitoring

     
    Posted 08-03-2020 04:23

    Hi Morne,

    There is also a stream-like interface to alarms which generates events when you subscribe to it:

    curl "https://<conductor-fqdn>/api/v1/events?token=$API_KEY"

    $API_KEY is your session key as illustrated above.

    -Mathias



    ------------------------------
    Mathias Jeschke
    Sales Engineer
    Burlington MA
    +1.781.203.8400
    ------------------------------