This is a translation of the original English documentation page. Help us make it better.

history.push

Beschrijving

object history.push(object/array itemHistoryData)

Deze methode maakt het mogelijk om itemgeschiedenisgegevens naar de Zabbix-server te sturen.

Deze methode is beschikbaar voor gebruikers van elk type. Rechten om de methode aan te roepen, kunnen worden ingetrokken in de gebruikersrolinstellingen. Zie Gebruikersrollen voor meer informatie.

Parameters

(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.

Retourwaarden

(object) Retourneert het resultaat van de gegevensverzendbewerking.

Voorbeelden

Send item history data

Send item history data to Zabbix server for items "10600", "10601", and "999999".

Request:

{
           "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
       }

Zie ook

Bron

CHistory::push() in ui/include/classes/api/services/CHistory.php.