Hey! These docs are for version 6.3, which is no longer officially supported. Click here for the latest version, 6.7!

Rest API Config endpoint for host check commands

Object type: hostcheckcommand

Request URL: /rest/config/hostcheckcommand

Example GET:

{
   "object" : {
      "priority" : "1",
      "plugin" : {
         "ref" : "/rest/config/plugin/check_icmp",
         "name" : "check_icmp"
      },
      "hosts" : [
         {
            "ref" : "/rest/config/host/14",
            "name" : "doesnt_exist_1"
         },
         {
            "ref" : "/rest/config/host/15",
            "name" : "doesnt_exist_2"
         },
         {
            "ref" : "/rest/config/host/16",
            "name" : "singlehostgroup"
         }
      ],
      "name" : "ping",
      "args" : "-H $HOSTADDRESS$ -t 3 -w 500.0,80% -c 1000.0,100%",
      "id" : "15",
      "uncommitted" : "0"
   }
}

Note: You cannot PUT the list of hosts. The reference to plugin is currently unavailable.