Zabbix Documentation 1.8

Sidebar

deleteHostMacro()

Available since version: 1.8
This function allows you to delete information about one or several hostmacros. All hostmacro-related information will be removed including items, graphs, macros, application, historical data, etc.

Parameters

Array of Hostmacro IDs

Returns

Parameter Description
result Operation successful. Result will contain array of deleted Hostmacro IDs.
error In case of any errors

Example

Delete hostmacros by macrohost macro ID

{
       "jsonrpc":"2.0",
       "method":"usermacro.deleteHostMacro",
       "params":["107824", "107825"],
       "auth":"3a57200802b24cda67c4e4010b50c065",
       "id":2
       }

Hostmacros deleted successfully:

{
       "jsonrpc":"2.0",
       "result":{
          "hostmacroids": ["107824", "107825"]
       },
       "id":2
       }

Hostmacro does not exist:

{
       "jsonrpc":"2.0",
       "error":{
             "code":-32500,
             "message":"Application error.",
             "data":"[ CHostmacro::delete ] Hostmacro does not exist"
       },
       "id":2
       }