Sidebar

zh:manual:api:reference:item:delete

item.delete

Description 说明

object item.delete(array itemIds)

This method allows to delete items. 此方法允许删除监控项。

Web items cannot be deleted via the Zabbix API.WEB监控项不能通过Zabbix API删除。

Parameters 参数

(array) IDs of the items to delete. (array) 要删除的监控下的IDs。

Return values 返回值

(object) Returns an object containing the IDs of the deleted items under the itemids property. (object)itemids属性下返回一个包含已被删除的监控项的IDs的对象。

Examples 示例

Deleting multiple items 删除多个监控项

Delete two items.
Dependent items and item prototypes are removed automatically if master item is deleted. 删除2个监控项。\\如果主监控项被删除,依赖监控项和监控项原型也会被自动删除。

Request:

{
    "jsonrpc": "2.0",
    "method": "item.delete",
    "params": [
        "22982",
        "22986"
    ],
    "auth": "3a57200802b24cda67c4e4010b50c065",
    "id": 1
}

Response:

{
    "jsonrpc": "2.0",
    "result": {
        "itemids": [
            "22982",
            "22986"
        ]
    },
    "id": 1
}

Source

CItem::delete() in frontends/php/include/classes/api/services/CItem.php.