Update zabbix.api.php

This commit is contained in:
Namhyeon Go 2020-02-05 10:25:24 +09:00 committed by GitHub
parent e10cad84c4
commit 8238963319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
/** /**
* @file zabbix.api.php * @file zabbix.api.php
* @created_on 2019-04-08 * @created_on 2019-04-08
* @updated_on 2020-02-04 * @updated_on 2020-02-05
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <gnh1201@gmail.com>
* @brief Zabbix JSON-RPC API (3.0) interface module * @brief Zabbix JSON-RPC API (3.0) interface module
* @documentation https://www.zabbix.com/documentation/current/ (4.4) * @documentation https://www.zabbix.com/documentation/current/ (4.4)
@ -248,7 +248,7 @@ if(!check_function_exists("zabbix_get_alerts")) {
} }
if(!check_function_exists("zabbix_get_records")) { if(!check_function_exists("zabbix_get_records")) {
function zabbix_get_records($itemids, $now_dt="", $adjust="-24h") { function zabbix_get_records($itemids, $now_dt="", $adjust="-24h", $value_type=3) {
$records = false; $records = false;
$response = false; $response = false;
@ -266,10 +266,11 @@ if(!check_function_exists("zabbix_get_records")) {
$time_till = get_current_timestamp(array("now" => $now_dt)); $time_till = get_current_timestamp(array("now" => $now_dt));
// get history // get history
// 0-numeric float; 1-character; 2-log; 3-numeric unsigned; 4-text
if(loadHelper("webpagetool")) { if(loadHelper("webpagetool")) {
$params = array( $params = array(
"output" => "extend", "output" => "extend",
"history" => array(0, 1, 2, 3, 4), // 0-numeric float; 1-character; 2-log; 3-numeric unsigned; 4-text "history" => $value_type,
"itemids" => $itemids, "itemids" => $itemids,
"sortfield" => "clock", "sortfield" => "clock",
"sortorder" => "DESC", "sortorder" => "DESC",