integer/array history.get(object parameters)
このメソッドは、与えられたパラメータに従って history データを取得することができます。
参照: known issues
このメソッドは、削除されたエンティティの history データがまだ housekeeper によって削除されていない場合、そのデータを
返すことがあります。
このメソッドは、どのタイプのユーザーでも利用可能です。このメソッドを呼び出す許可は、ユーザーロール設定で取り消すことができます。
詳しくは、User rolesを参照してください。
(object) 希望する出力を定義するパラメータ
このメソッドは、以下のパラメータをサポートしています。
| パラメータ | Type | 説明 |
|---|---|---|
| history | integer | History object types to return. Possible values: 0 - numeric float; 1 - character; 2 - log; 3 - numeric unsigned; 4 - text. Default: 3. |
| hostids | string/array | Return only history from the given hosts. |
| itemids | string/array | Return only history from the given items. |
| time_from | timestamp | Return only values that have been received after or at the given time. |
| time_till | timestamp | Return only values that have been received before or at the given time. |
| sortfield | string/array | Sort the result by the given properties. Possible values are: itemid and clock. |
| countOutput | boolean | These parameters being common for all get methods are described in detail in the reference commentary page. |
| editable | boolean | |
| excludeSearch | boolean | |
| filter | object | |
| limit | integer | |
| output | query | |
| search | object | |
| searchByAny | boolean | |
| searchWildcardsEnabled | boolean | |
| sortorder | string/array | |
| startSearch | boolean |
(integer/array) 次のいずれかを返します:
countOutputパラメーターが使用されている場合、取得したオブジェクトの数numeric(float) item から受け取った最新の値を10件返します。
Request:
{ "jsonrpc": "2.0", "method": "history.get", "params": { "output": "extend", "history": 0, "itemids": "23296", "sortfield": "clock", "sortorder": "DESC", "limit": 10 }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 }Response:
{ "jsonrpc": "2.0", "result": [ { "itemid": "23296", "clock": "1351090996", "value": "0.085", "ns": "563157632" }, { "itemid": "23296", "clock": "1351090936", "value": "0.16", "ns": "549216402" }, { "itemid": "23296", "clock": "1351090876", "value": "0.18", "ns": "537418114" }, { "itemid": "23296", "clock": "1351090816", "value": "0.21", "ns": "522659528" }, { "itemid": "23296", "clock": "1351090756", "value": "0.215", "ns": "507809457" }, { "itemid": "23296", "clock": "1351090696", "value": "0.255", "ns": "495509699" }, { "itemid": "23296", "clock": "1351090636", "value": "0.36", "ns": "477708209" }, { "itemid": "23296", "clock": "1351090576", "value": "0.375", "ns": "463251343" }, { "itemid": "23296", "clock": "1351090516", "value": "0.315", "ns": "447947017" }, { "itemid": "23296", "clock": "1351090456", "value": "0.275", "ns": "435307141" } ], "id": 1 }CHistory::get() in ui/include/classes/api/services/CHistory.php.