Seitenhierarchie
Zum Ende der Metadaten springen
Zum Anfang der Metadaten

(Warnung) To create a Check_MK service, two URL calls must take place. First, the service API must be addressed:

URL: https://123.123.123.123/services/add.json

Methode: POST

Response: JSON


JSON for creating services via REST API
{
    "Service" : {
        "name" : "$DESCRIPTION",
        "servicetemplate_id":$SERVICETEMPLATE_ID,
        "host_id":$HOST_ID,
        "own_contacts" : null,
        "own_contactgroups" : null,
        "service_type" : 8
    }
}



Response on successful API call
{
  "id": "$SERVICE_ID"
}

(Warnung) Now the MK module is called

URL: https://123.123.123.123/mk_module/mkservicedata/add.json

Methode: POST

Response: JSON


VariableValue

service_idID of the newly created service

host_idThe ID of the host

is_process1 if check type = service or ps. Otherwise 0

check_nameCheck type of the check to be created

check_itemItem of the check to be created

JSON for creating CheckMK services via REST API
{
	"service_id" : $SERVICE_ID,
    "host_id":$HOST_ID,
    "is_process" : 1,
    "check_name" : "$CHECKTYPE",
    "check_item" : "$ITEM"
}



Response on successful API call
{
  "id": "$CHECK_MK_SERVICE_ID"
}
  • Keine Stichwörter