Moogsoft Docs

getTopPrcDetails

A Graze API GET request that returns the top most likely causal alerts, based on their Probable Root Cause value, for a specified Situation.

You can select the maximum number of causal alerts to return using a limit value. If not specified, the endpoint only returns the alert with the highest root cause probability.

The entries returned are ordered with the highest root cause probability first, for the specified Situation, irrespective of whether they have been labeled causal or are unlabeled. Alerts marked as symptoms are excluded from the return.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint getTopPrcDetails takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

sitn_id

Integer

Yes

ID of the Situation you want to retrieve the Probable Root Cause details for.

limit

Integer

No

Maximum number of causal or unlabeled alerts to return. Default is 1, if not specified, returning one alert with the highest root cause probability.

Response

Endpoint getTopPrcDetails returns the following response:

Successful requests return an array of JSON objects containing the following:

Name

Type

Description

rc_probability

Number

Root cause probability of the alert.

description

String

Description of the alert.

rc_label

Integer

Label defining whether the alert is causal or unlabeled. Alerts marked as symptoms are excluded from the return.

  • 1 = causal

  • 0 = unlabeled

  • -1 = symptom

alert_id

Integer

Alert ID.

API behavior in active and historic databases

The behavior of this endpoint depends on whether the relevant Situation is open, closed and still in the active database, or closed and archived to the historic database. This endpoint updates the Situation as follows:

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of endpoint getTopPrcDetails:

Request example

Example cURL request to return the top three causal alerts with the highest root cause probability in Situation 145:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getTopPrcDetails" --data-urlencode 'sitn_id=145' --data-urlencode 'limit=3'

Response example

Example response returning the top three causal or unlabeled alerts for Situation ID 145:

{
    "alerts": [
        {
            "rc_probability":0.9933107459030244,
            "description":"Web Server HTTPD is DOWN",
            "rc_label":1,
            "alert_id":53
        },
        {
            "rc_probability":0.9933092393241993,
            "description":"Web Server HTTPD is DOWN",
            "rc_label":1,
            "alert_id":8
        },
        {
            "rc_probability":0.22480057080448923,
            "description":"Web Server HTTPD is DOWN",
            "rc_label":0,
            "alert_id":39
        }
    ]
}