Skip to main content

# Examples for monitoring

Monitoring for managed objects is a powerful feature in Avantra where our built-in checks, written by the Avantra team, and custom checks, configured or coded by our customers, can show the status of your landscape to direct your attention to problems that need to be solved to prevent business outages.

This API allows external applications to read more information about specific checks for further analysis or notification of the correct party.

## Query checks in Critical or Warning status​

This sample query returns all the checks in your landscape that are in the Critical or Warning statuses:

    query Checks {
        checks(
            where: {
                filterBy: {
                    name: "status",
                    operator: isIn,
                    values: ["CRITICAL","WARNING"]
                }
            }
        ){
            id
            monitoring
            name
            status
            statusId
            result
            lastRefresh
            lastStatusChange
            kind
            system {
                id
                name
            }
        }
    }

Which could return something like this:

    {
        "data": {
          "checks": [
            {
              "id": "1929925",
              "monitoring": false,
              "name": "AGENTALIVE",
              "status": "CRITICAL",
              "statusId": 2,
              "result": "Last message from Avantra Agent is at least 04:00:00 ([h]:mm:ss) old",
              "lastRefresh": "2023-09-07T18:46:50.000+02:00",
              "lastStatusChange": "2023-01-03T14:47:11.000+01:00",
              "kind": "RTM",
              "system": {
                "id": "797",
                "name": "server-name"
              }
            },
            {
              "id": "2323900",
              "monitoring": true,
              "name": "DialogResponseTimes",
              "status": "CRITICAL",
              "statusId": 2,
              "result": "FrontendResponseTime: 277 msec (10 msec CRITICAL threshold exceeded)",
              "lastRefresh": "2023-11-30T09:50:03.739+01:00",
              "lastStatusChange": "2023-11-28T13:47:10.000+01:00",
              "kind": "RTM",
              "system": {
                "id": "1624",
                "name": "system_SID_00"
              }
            }
          ]
        }
    }