Wireless

 View Only
last person joined: 25 days ago 

Ask questions and share experiences with Mist APs, Marvis, and all things wireless and Wi-Fi.
  • 1.  Details in Marvis Alerts (from API) regarding action and status

    Posted 01-05-2024 08:42

    The Marvis alerts retrieved from the Live Demo system REST API don't have the details that contain the action type and status. The alarm defs shows an example with this format:

    {
            "key": "non_compliant",
            "display": "Non-compliant",
            "group": "marvis",
            "marvis_suggestion_category": "ap",
            "severity": "critical",
            "example": {
                "severity": "critical",
                "timestamp": 1629755015,
                "last_seen": 1629755015,
                "status": "open",
                "license_requirement": "VNA",
                "id": "5168b980-640b-43d8-85b8-ecee9eb17647",
                "action_id": "5168b980-640b-43d8-85b8-ecee9eb17647",
                "org_id": "aabbccdd-0000-1111-aaaa-123456abcdef",
                "org_name": "EXAMPLE ORG",
                "site_id": "ccddeeff-0000-1111-aaaa-123456abcdef",
                "site_name": "EXAMPLE SITE",
                "details": {
                    "action": "firmware_upgrade",
                    "category": "ap",
                    "status": "open",
                    "symptom": "non_compliant"
                },
                "impacted_entities": [
                    {
                        "entity_type": "ap",
                        "entity_mac": "aa2b3c4d5e6f",
                        "entity_name": "EXAMPLE AP",
                        "connected_switch_mac": "1a2b3c4d5e6f",
                        "connected_switch_name": "EXAMPLE SWITCH",
                        "entity_version": "0.10.24200",
                        "port_id": "40",
                        "recommended_version": "0.6.19032"
                    },
                    {
                        "entity_type": "ap",
                        "entity_mac": "bb2b3c4d5e6f",
                        "entity_name": "EXAMPLE AP 2",
                        "connected_switch_mac": "112b3c4d5e6f",
                        "connected_switch_name": "EXAMPLE SWITCH 2",
                        "entity_version": "0.6.19032",
                        "port_id": "24",
                        "recommended_version": "0.10.24200"
                    }
                ],
                "suggestion": "firmware_upgrade",
                "category": "ap",
                "count": 1,
                "type": "non_compliant",
                "group": "marvis"
            },
            "fields": [
                "entity_macs",
                "port_ids",
                "connected_switch_macs"
            ]
        },

     However, the alert from API is: {
                "severity": "critical",
                "timestamp": 1704423121,
                "last_seen": 1704423121,
                "impacted_entities": [
                    {
                        "entity_version": "0.12.27139",
                        "entity_type": "ap",
                        "entity_mac": "5c5b353e4d71",
                        "entity_name": "MC_TestAP2",
                        "recommended_version": "0.14.29091"
                    }
                ],
                "org_id": "9777c1a0-6ef6-11e6-8bbf-02e208b2d34f",
                "count": 1,
                "site_id": "978c48e6-6ef6-11e6-8bbf-02e208b2d34f",
                "id": "27e49d26-d094-41d9-9bb2-657f2d38eb48",
                "type": "non_compliant",
                "group": "marvis",
                "entity_macs": [
                    "5c5b353e4d71"
                ]
            }

    Do we need to specify any configuration to enable the extra fields in the API response? 

    And, when a Marvis action is acted upon, like setting the status of the Marvis Action to 'Resolve', will the alert with the same id will be updated depicting the new action?



    ------------------------------
    Udaykiran Reddy Matta
    ------------------------------



  • 2.  RE: Details in Marvis Alerts (from API) regarding action and status

    Posted 24 days ago
    Edited by Juniper Community Admin 23 days ago

    [edit] message posted twice, see response below



  • 3.  RE: Details in Marvis Alerts (from API) regarding action and status

    Posted 24 days ago

    Hi,

    I suppose you are trying to get the list of alarms with the API call /api/v1/sites/{org_id}/alarms/search.

    The examples you are getting with the API call /api/v1/const/alarm_defs are mainly  to describe the webhook contents, rather than the API responses.

    Actually, the best way to consume Marvis Actions is to use the "alarms" webhooks. This will provide more details like the status, details and suggestion fields, and you'll get real time data without the need to poll the alarms list every X minutes (i.e. as soon as an action is opened or updated, you'll get a webhook with all the details).

    The alarm webhooks for Marvis Actions are also providing the action_id as you can see in the example. The same action_id will be use for all the webhook messages related to the same Marvis Action. This means you can use it to correlate the messages on your side.

    Regarding the alarm id, I would say we are keeping the same action and we are just updating it, but I'll have to double check this part.

    Best regards  



    ------------------------------
    Thomas Munzer
    ------------------------------