Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

close
keyboard_arrow_left
list Table of Contents
file_download PDF
keyboard_arrow_right

Contrail Alert Streaming

date_range 07-Jun-23

Contrail alerts are provided on a per-user visible entity (UVE) basis. Contrail analytics raise or clear alerts using Python-coded rules that examine the contents of the UVE and the configuration of the object. Some rules are built in. Others can be added using Python stevedore plugins.

This topic describes Contrail alerts capabilities.

Alert API Format

The Contrail alert analytics API provides the following:

  • Read access to the alerts as part of the UVE GET APIs.

  • Alert acknowledgement using POST requests.

  • UVE and alert streaming using server-sent events (SSEs).

For example:

GET http://<analytics-ip>:8081/analytics/alarms

content_copy zoom_out_map
{
    analytics-node: [
        {
            name: "nodec40",
            value: {
                UVEAlarms: {
                    alarms: [
                        {
                            any_of: [
                                {
                                    all_of: [
                                        {
                                            json_operand1_value: ""PROCESS_STATE_STOPPED"",
                                            rule: {
                                                oper: "!=",
                                                operand1: {
                                                    keys: [
                                                        "NodeStatus",
                                                        "process_info",
                                                        "process_state"
                                                    ]
                                                },
                                                operand2: {
                                                    json_value: ""PROCESS_STATE_RUNNING""
                                                }
                                            },
                                            json_vars: {
                                                NodeStatus.process_info.process_name: "contrail-topology"
                                            }
                                        }
                                    ]
                                }
                            ],
                            severity: 3,
                            ack: false,
                            timestamp: 1457395052889182,
                            token: "eyJ0aW1lc3RhbXAiOiAxNDU3Mzk1MDUyODg5MTgyLCAiaHR0cF9wb3J0I
................................... jogNTk5NSwgImhvc3RfaXAiOiAiMTAuMjA0LjIxNy4yNCJ9",
                            type: "ProcessStatus"
                        }
                    ]
                }
            }
        }
    ]
}

In the example:

  • An any_of attribute contains alarm rules defined in the format [ [rule1 AND rule2 AND ... AND ruleN] ... OR [rule11 AND rule22 AND ... AND ruleNN] ]

  • Alerts are raised on a per-UVE basis and can be retrieved by a GET on a UVE.

  • An ack indicates if the alert has been acknowledged or not.

  • A token is used by clients when requesting acknowledgements.

Analytics APIs for Alerts

The following examples show the API to use to display alerts and alarms and to acknowledge alarms.

  • To retrieve a list of alerts raised against the control node named aXXsYY.

    content_copy zoom_out_map
    GET http://<analytics-ip>:<rest-api-port>/analytics/uves/control-node/aXXsYY&cfilt=UVEAlarms

    This is available for all UVE table types.

  • To retrieve a list of all alarms in the system.

    content_copy zoom_out_map
    GET http://<analytics-ip>:<rest-api-port>/analytics/alarms
  • To acknowledge an alarm.

    content_copy zoom_out_map
    POST http://<analytics-ip>:<rest-api-port>/analytics/alarms/acknowledge
    Body: {“table”: <object-type>,“name”: <key>, “type”: <alarm type>, “token”: <token>}
    

    Acknowledged and unacknowledged alarms can be queried specifically using the following URL query parameters along with the GET operations listed previously.

    content_copy zoom_out_map
    ackFilt=True
    ackFilt=False
    

Analytics APIs for SSE Streaming

The following examples show the API to use to retrieve all or portions of SE streams.

  • To retrieve an SSE-based stream of UVE updates for the control node alarms.

    content_copy zoom_out_map
    GET http://<analytics-ip>:<rest-api-port>/analytics/uve-stream?tablefilt=control-node

    This is available for all UVE table types. If the tablefilt URL query parameter is not provided, all UVEs are retrieved.

  • To retrieve only the alerts portion of the SSE-based stream of UVE updates instead of the entire content.

    content_copy zoom_out_map
    GET http://<analytics-ip>:<rest-api-port>/analytics/alarm-stream?tablefilt=control-node
    

    This is available for all UVE table types. If the tablefilt URL query parameter is not provided, all UVEs are retrieved.

Built-in Node Alerts

The following built-in node alerts can be retrieved using the APIs listed in Analytics APIs for Alerts.

content_copy zoom_out_map
control‐node: {
PartialSysinfoControl: "Basic System Information is absent for this node in BgpRouterState.build_info",
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info",
XmppConnectivity: "Not enough XMPP peers are up in BgpRouterState.num_up_bgp_peer",
BgpConnectivity: "Not enough BGP peers are up in BgpRouterState.num_up_bgp_peer",
AddressMismatch: “Mismatch between configured IP Address and operational IP Address",
ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status"
},

vrouter: {
PartialSysinfoCompute: "Basic System Information is absent for this node in VrouterAgent.build_info",
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info",
ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status",
VrouterInterface: "VrouterAgent has interfaces in error state in VrouterAgent.error_intf_list”,
VrouterConfigAbsent: “Vrouter is not present in Configuration”,
},

config‐node: {
PartialSysinfoConfig: "Basic System Information is absent for this node in ModuleCpuState.build_info",
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info",
ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status"
},

analytics‐node: {
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info"
PartialSysinfoAnalytics: "Basic System Information is absent for this node in CollectorState.build_info",
ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status"
},

database‐node: {
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info",
ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status"
},
external-footer-nav
Ask AI
close

How can I help you today?

LLMs can make mistakes. Verify important information.
chat_add_on New topic
send progress_activity
This conversation will be monitored and recorded. Any information you provide will be subject to our Privacy Notice and may be used for quality assurance purposes. Do not include any personal or sensitive information. Ask AI can make mistakes. Verify generated output for accuracy.
Protected by hCaptcha arrow_drop_down arrow_drop_up
Juniper Networks, Inc. | Privacy Notice | Terms of Use