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")) {
function zabbix_retrieve_hosts() {
if(!check_function_exists("zabbix_get_hosts")) {
function zabbix_get_hosts() {
$hosts = 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")) {
function zabbix_get_items($hostids=null) {
$items = false;
@ -108,7 +114,7 @@ if(!check_function_exists("zabbix_get_items")) {
"method" => "host.get",
"params" => array(
"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",
"hostids" => $hostids,
"expandDescription" => 1,