Update zabbix.api.php

This commit is contained in:
Namhyeon Go 2019-04-09 19:41:21 +09:00 committed by GitHub
parent 162fedd2ef
commit 847edab82e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ if(!check_function_exists("zabbix_get_base_url")) {
if(!check_function_exists("zabbix_get_id")) {
function zabbix_get_id() {
return rand(10000, 99999) * rand(10000, 99999));
return rand(10000, 99999) * rand(10000, 99999);
}
}
@ -68,7 +68,7 @@ if(!check_function_exists("zabbix_retrieve_hosts")) {
"Content-Type" => "application/json-rpc",
),
"data" => array(
"jsonprc" => "2.0",
"jsonrpc" => "2.0",
"method" => "host.get",
"params" => array(
"output" => array("hostid", "host"),
@ -88,12 +88,6 @@ if(!check_function_exists("zabbix_get_items")) {
function zabbix_get_items($hostids="") {
$response = false;
// check type
if(!(is_array($host_ids) && is_string($host_ids)) {
set_error("hostids must be array or string");
show_errors();
}
// get zabbix authentication
$zabbix_api_url = get_scope("zabbix_api_url");
$zabbix_auth = get_scope("zabbix_auth");
@ -105,7 +99,7 @@ if(!check_function_exists("zabbix_get_items")) {
"Content-Type" => "application/json-rpc",
),
"data" => array(
"jsonprc" => "2.0",
"jsonrpc" => "2.0",
"method" => "host.get",
"params" => array(
"selectInventory" => true,