Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titlegetSituationServices

getSituationServices

A GET request that returns a list of external service names for a specified Situation.

Request Arguments

Name

Type

Description 

auth_token

String

A valid auth_token returned from the authenticate request.

sitn_id

Number

The Situation ID.

Return Parameters

Type

Description

HTTP code

HTTP status or error code indicating request success or failure.
For codes, see HTTP Status and Error Codes.

Successful requests return a JSON object containing the following:

Name

Type

Description 

services

List

A list of the Situation's service names.

Example

cURL command:

Code Block
curl -G -u graze:graze -k -v "https://localhost/graze/v1/getSituationServices"     --data-urlencode 'sitn_id=1'

Successful request return, with a primary service name defined:

Code Block
{"services":["Cloud Management Platform","Geographic Information Systems","Knowledge Management","Online Transaction Processing","Storage Subsystem","Web Content Management","0-bit Emulation","40GbE","8-bit Unicode Transcoding Platform"]}
Expand
titlegetSituationTopology

getSituationTopology

A GET request that returns a JSON object in NetJSON format that represents nodes affected by the Situation.

Request Arguments

Name

Type

Required

Description 

sitn_id

Number

Yes

Situation ID.

context

Number

No

Number, between 0 and 4, of contextual hops from the nodes directly affected within the Situation to other nodes to be included in the returned object. See Vertex Entropy for more information on contextual hops.

0 = only nodes directly affected by the Situation. Default.

4 = nodes that are up to four hops away from the nodes directly affected by the Situation.

propertiesList of stringsNo

List of the node properties to be returned. Valid properties are:

  • severity: Severity of the node.
  • prc: Whether this node is the probable root cause of the alert.
  • service: Service affected by the node.
  • context: Number of contextual hops between this node and a node directly affected by the Situation. A context of 0 means that the node is directly affected.
  • description: Description of the node.
  • vertex_entropy: Vertex Entropy of the node.
field_nameStringNo

Attribute of the alert that defines the node. The default is the alert 'source' but you can specify any valid alert field, including custom_info attributes. For example, field_name=custom_info.eventDetails.line.

Response

Type

 Description

HTTP code

HTTP status or error code indicating request success or failure. See HTTP Status and Error Codes for details. 

Successful requests return a JSON object containing the following:

Name

Type

Description 

linksIntegerList of links associated with the Situation.
links.source

String

Source node of the link.

links.targetStringTarget node of the link.
nodes

Array

Array of nodes associated with the Situation and their properties. The nodes included depends on the setting of the request property context.

nodes.id

StringNode ID
nodes.propertiesArray

Object containing the properties requested.

See http://netjson.org/ for more information on the topology data format.

Example

The following topology diagram shows the nodes affected by Situation ID 14, with a context of 1. In this example, each node represents a host in a network and the Situation represents a network outage. It shows six nodes directly affected by the Situation, their color depending on their severity, and one node which is one hop away, shown in gray.

Image Added

The following cURL request demonstrates a request to return nodes affected by the Situation and nodes that are one hop away. The returned object is to contain the properties of severity, Vertex Entropy, Probable Root Cause (PRC), service, and description.

Code Block
languagetext
curl -G -u graze:graze -k -v "https://localhost/graze/v1/getSituationTopology" --data-urlencode "sitn_id=14" "context=1" "properties"=["severity","vertex_entropy","prc","service","description"]

The successful response returns the following topology information for this Situation. The response always returns the node names in lower case. Note that there is no PRC value for the node that is not directly affected by the Situation. In this example, consider investigating node "host2835" as the cause of the Situation because it has a high severity and a high PRC.

Code Block
languagetext
{
    "links": [
        {
            "source": "host2728",
            "target": "host2736"
        },
        {
            "source": "host2728",
            "target": "host1156"
        },
        {
            "source": "host2835",
            "target": "host2728"
        },
        {
            "source": "host2801",
            "target": "host2827"
        },
        {
            "source": "host2800",
            "target": "host2801"
        },
        {
            "source": "host2801",
            "target": "host2835"
        },
        {
            "source": "host2835",
            "target": "host2736"
        }
    ],
    "nodes": [
        {
            "id": "host2835",
            "properties": {
                "severity": 5,
                "prc": 0.9862626716344282,
                "service": "",
                "context": 0,
                "description": "",
                "vertex_entropy": 0.1794592472207979
            }
        },
        {
            "id": "host2736",
            "properties": {
                "severity": 4,
                "prc": 0.42722191049803876,
                "service": "",
                "context": 0,
                "description": "",
                "vertex_entropy": 0.08976540495989357
            }
        },
        {
            "id": "host2728",
            "properties": {
                "severity": 3,
                "prc": 0.007672752075071621,
                "service": "",
                "context": 0,
                "description": "",
                "vertex_entropy": 0.1794592472207979
            }
        },
        {
            "id": "host2827",
            "properties": {
                "severity": 5,
                "prc": 0.4262762946261391,
                "service": "",
                "context": 0,
                "description": "",
                "vertex_entropy": 0.05343516483103129
            }
        },
        {
            "id": "host2801",
            "properties": {
                "severity": 5,
                "prc": 0.42722511225514104,
                "service": "",
                "context": 0,
                "description": "",
                "vertex_entropy": 0.23927899629439717
            }
        },
        {
            "id": "host2800",
            "properties": {
                "severity": 5,
                "prc": 0.4269879766269776,
                "service": "",
                "context": 0,
                "description": "",
                "vertex_entropy": 0.05343516483103129
            }
        },
        {
            "id": "host1156",
            "properties": {
                "severity": null,
                "prc": null,
                "service": "",
                "context": 1,
                "description": "",
                "vertex_entropy": 0.05343516483103129
            }
        }
    ]
}
Expand
titlegetSituationVisualization

getSituationVisualization

A GET request that returns information on the origin and cause of a specified Situation.

Request Arguments

Name

Type

Required

Description 

auth_token

String

Yes

A valid  auth_token  returned from the authenticate  request.
sitn_id

Number

Yes

Situation ID.

Response

Type

 Description

HTTP code

HTTP status or error code indicating request success or failure.
For codes, see HTTP Status and Error Codes.

Successful requests return a JSON object containing the following:

Name

Type

Description 

sig_idIntegerSituation ID.
origin

String

Process that caused the Situation to be created, for example, cookbook or manual_merge.

cause

Object

Cause of the Situation. This varies depending on how the Situation was created.

Examples

A cURL request to return the information on the origin and cause of Situation ID 358:

Code Block
languagetext
curl -G -u graze:graze -k -v "https://localhost/graze/v1/getSituationVisualization" --data-urlencode "sitn_id=358"

A successful response for a Situation created by a Cookbook Recipe returns the following information:

Code Block
languagetext
{
    "origin": "cookbook",
    "cause": {
        "cookbook_name": "Default Cookbook",
        "recipe_id": 4,
        "cookbook_id": 7,
        "recipe_name": "Recipe 1",
        "reference_event_id": 6
    },
    "sig_id": 1
}

A successful response for a manually created Situation returns the following information:

Code Block
languagetext
{
    "origin": "Manual Creation",
    "cause": {"uid": 3},
    "sig_id": 6
}

A successful response when two Situations have been merged returns the following information:

Code Block
languagetext
{
    "origin": "Manual Merge",
    "cause": {
        "uid": 3,
        "merged_sigs": [
            8,
            7
        ]
    },
    "sig_id": 9
}

If there is no Situation visualization data, the response returns the following information:

Code Block
languagetext
{
    "additional": {
        "debugMessage": "com.moogsoft.servletutils.CGeneralServerException: com.moogsoft.services.CGeneralServiceException: No visualize data found for Situation ID [2323]"
    },
    "message": "Internal server error",
    "statusCode": 1000
}

...