object history.push(объект/массив itemHistoryData)
Этот метод позволяет отправлять данные истории элементов на сервер Zabbix.
Этот метод доступен пользователям любого типа. Разрешения на вызов метода можно отозвать в настройках ролей пользователя. Дополнительную информацию см. в разделе Роли пользователей.
(object/array)
Item history data to send.
The method supports the following parameters.
Parameter | Type | Description |
---|---|---|
itemid | ID | ID of the related item. Parameter behavior: - required if host and key are not set |
host | string | Technical name of the host. Parameter behavior: - required if itemid is not set |
key | string | Item key. Parameter behavior: - required if itemid is not set |
value | mixed | Item value. Parameter behavior: - required |
clock | timestamp | Time when the value was received. |
ns | integer | Nanoseconds when the value was received. |
(object)
Returns the result of the data sending operation.
Send item history data to Zabbix server for items "10600", "10601", and "999999".
{
"jsonrpc": "2.0",
"method": "history.push",
"params": [
{
"itemid": 10600,
"value": 0.5,
"clock": 1690891294,
"ns": 45440940
},
{
"itemid": 10600,
"value": 0.6,
"clock": 1690891295,
"ns": 312431
},
{
"itemid": 10601,
"value": "[Tue Aug 01 15:01:35 2023] [error] [client 1.2.3.4] File does not exist: /var/www/html/robots.txt"
},
{
"itemid": 999999,
"value": 123
}
],
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"response": "success",
"data": [
{
"itemid": "10600"
},
{
"itemid": "10600"
},
{
"itemid": "10601",
"error": "Item is disabled."
},
{
"error": "No permissions to referred object or it does not exist."
}
]
},
"id": 1
}
CHistory::push() in ui/include/classes/api/services/CHistory.php.