Skip to main content

# Examples for Managed Systems

Managed systems are core to everything in Avantra. For monitoring, these serve as the hook that checks are recorded against. For automation, these define targets that can have workflows executed on. Depending on the managed system type, there's different data that can be retrieved and changed.

## Retrieve all SAP systems with associated customer information​

Example query:

    query SapSystems {
        sapSystems {
            id
            mst
            checkCount
            customData
            description
            maintenance
            monitorOff
            monitorOffUntil
            monitorSwitchReason
            monitorSwitchDate
            name
            operational
            operationalSince
            operationalUntil
            status
            statusId
            type
            timestamp
            uuid
            unifiedSapSid
            realSapSid
            applicationType
            timezone
            basisRelease
            componentVersion
            spamPatchLevel
            encoding
            defaultClient
            databaseName
            databaseHost
            databasePort
            databaseRelease
            databaseType
            sapInstancesCount
            remoteMonitoringEntryPoint
            remote
            avantraTransportVersion
            monitorLevel
            notSeen
            customer {
                id
                name
                sapCustomerNumber
                description
                remarks
                phone
                mobile
                fax
                email
                timezone
                address
                postbox
                postalCode
                city
                country
                timestamp
                customerUrl
                customData
                guid
                childrenCount
                checkCount
                systemsCount
            }
        }
    }

Which will return something similar to (abridged):

    {
        "data": {
            "sapSystems": [
                {
                    "id": "1276",
                    "description": "123",
                    "maintenance": false,
                    "monitorOff": true,
                    "name": "ASM",
                    "operational": true,
                    "operationalSince": "2023-11-06",
                    "operationalUntil": "2023-11-09",
                    "status": "UNKNOWN",
                    "statusId": -1,
                    "type": "SAP_SYSTEM",
                    "timestamp": "2023-11-23T15:37:23.000+01:00",
                    "unifiedSapSid": "ASM",
                    "realSapSid": "ASM",
                    "applicationType": "16",
                    "timezone": "Africa/Addis_Ababa",
                    "basisRelease": "7.40",
                    "componentVersion": null,
                    "spamPatchLevel": "740/0083",
                    "encoding": "U2L",
                    "defaultClient": "000",
                    "databaseName": "DB_ASM",
                    "databaseHost": "gdevrl-asm",
                    "databasePort": 4901,
                    "databaseRelease": "16.0",
                    "databaseType": "SAP ASE",
                    "sapInstancesCount": 2,
                    "remoteMonitoringEntryPoint": null,
                    "remote": false,
                    "avantraTransportVersion": "23.2.0.0",
                    "monitorLevel": "DEPLOYED",
                    "notSeen": false,
                    "customer": {
                        "id": "-1",
                        "name": "Root",
                        "sapCustomerNumber": null,
                        "timestamp": "2017-02-23T12:34:57.000+01:00",
                        "customerUrl": null,
                        "customData": null,
                        "guid": null,
                        "childrenCount": 30,
                        "checkCount": 0,
                        "systemsCount": 7
                    }
                }
              ]
            }
        }

## Update a managed system (Server)​

#

This example mutation updates the description for a given server id, in this case server 60:

    mutation UpdateServer {
        updateServer(
            input: { id: 60, description: "This is an updated description for this server" }
        ) {
            result {
                success
                message
                code
            }
        }
    }

Which will return something similar to:

    {
        "data": {
            "updateServer": {
                "result": {
                    "success": true,
                    "message": null,
                    "code": null
                }
            }
        }
    }