Update zabbix.api.php
This commit is contained in:
parent
162fedd2ef
commit
847edab82e
|
@ -15,7 +15,7 @@ if(!check_function_exists("zabbix_get_base_url")) {
|
||||||
|
|
||||||
if(!check_function_exists("zabbix_get_id")) {
|
if(!check_function_exists("zabbix_get_id")) {
|
||||||
function 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",
|
"Content-Type" => "application/json-rpc",
|
||||||
),
|
),
|
||||||
"data" => array(
|
"data" => array(
|
||||||
"jsonprc" => "2.0",
|
"jsonrpc" => "2.0",
|
||||||
"method" => "host.get",
|
"method" => "host.get",
|
||||||
"params" => array(
|
"params" => array(
|
||||||
"output" => array("hostid", "host"),
|
"output" => array("hostid", "host"),
|
||||||
|
@ -88,12 +88,6 @@ if(!check_function_exists("zabbix_get_items")) {
|
||||||
function zabbix_get_items($hostids="") {
|
function zabbix_get_items($hostids="") {
|
||||||
$response = false;
|
$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
|
// get zabbix authentication
|
||||||
$zabbix_api_url = get_scope("zabbix_api_url");
|
$zabbix_api_url = get_scope("zabbix_api_url");
|
||||||
$zabbix_auth = get_scope("zabbix_auth");
|
$zabbix_auth = get_scope("zabbix_auth");
|
||||||
|
@ -105,7 +99,7 @@ if(!check_function_exists("zabbix_get_items")) {
|
||||||
"Content-Type" => "application/json-rpc",
|
"Content-Type" => "application/json-rpc",
|
||||||
),
|
),
|
||||||
"data" => array(
|
"data" => array(
|
||||||
"jsonprc" => "2.0",
|
"jsonrpc" => "2.0",
|
||||||
"method" => "host.get",
|
"method" => "host.get",
|
||||||
"params" => array(
|
"params" => array(
|
||||||
"selectInventory" => true,
|
"selectInventory" => true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user