Update zabbix.api.php

This commit is contained in:
Namhyeon Go 2020-01-27 20:26:38 +09:00 committed by GitHub
parent 2a05f2dca9
commit e06d9ada34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,8 +64,8 @@ if(!check_function_exists("zabbix_authenticate")) {
} }
} }
if(!check_function_exists("zabbix_retrieve_hosts")) { if(!check_function_exists("zabbix_get_hosts")) {
function zabbix_retrieve_hosts() { function zabbix_get_hosts() {
$hosts = false; $hosts = false;
$response = false; $response = false;
@ -92,6 +92,12 @@ if(!check_function_exists("zabbix_retrieve_hosts")) {
} }
} }
if(!check_function_exists("zabbix_retrieve_hosts")) {
function zabbix_retrieve_hosts() {
return zabbix_get_hosts();
}
}
if(!check_function_exists("zabbix_get_items")) { if(!check_function_exists("zabbix_get_items")) {
function zabbix_get_items($hostids=null) { function zabbix_get_items($hostids=null) {
$items = false; $items = false;
@ -108,7 +114,7 @@ if(!check_function_exists("zabbix_get_items")) {
"method" => "host.get", "method" => "host.get",
"params" => array( "params" => array(
"selectInventory" => true, "selectInventory" => true,
"selectItems" => array("name", "key_", "lastvalue", "units", "itemid", "lastclock", "value_type", "itemid"), "selectItems" => array("name", "key_", "status", "lastvalue", "units", "itemid", "lastclock", "value_type", "itemid"),
"output" => "extend", "output" => "extend",
"hostids" => $hostids, "hostids" => $hostids,
"expandDescription" => 1, "expandDescription" => 1,