object history.push(object/array 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)
データ送信操作の結果を返します。
Zabbixサーバーへ、アイテム"10600"、"10601"、"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
}
レスポンス :
{
"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.