Seitenhierarchie
Zum Ende der Metadaten springen
Zum Anfang der Metadaten

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

Methode: POST

Response: JSON


Command_type

1Service check Command

2Host check Command

3Notification Command

4Eventhandler Command

JSON for creating commands via REST API
{
    "Command" : {
    	"name" : "API Example Command with arguments",
        "command_line" : "$USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5",
        "command_type" : 1
    },
    "Commandargument" : {
    	"0":{
        	"name" : "$ARG1$",
            "human_name" : "Warning"
        },
    	"1":{
        	"name" : "$ARG2$",
            "human_name" : "Critical"
        }
	}
}
Response on successful API call
{
  "id": "$COMMAND_ID",
  "command_arguments": [
    {
      "Commandargument": {
        "name": "$ARG1$",
        "human_name": "Warning",
        "command_id": "$COMMAND_ID",
        "modified": "2017-03-30 09:29:26",
        "created": "2017-03-30 09:29:26",
        "id": "$COMMANDARGUMENT_ID"
      }
    },
    {
      "Commandargument": {
        "name": "$ARG2$",
        "human_name": "Critical",
        "command_id": "$COMMAND_ID",
        "modified": "2017-03-30 09:29:26",
        "created": "2017-03-30 09:29:26",
        "id": "$COMMANDARGUMENT_ID"
      }
    }
  ]
}
  • Keine Stichwörter