Update zabbix.api.php

This commit is contained in:
Namhyeon Go 2019-04-15 15:15:01 +09:00 committed by GitHub
parent 58e53462e0
commit 8bb946ace2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,18 @@
* @documentation https://www.zabbix.com/documentation/3.0/manual/api
*/
if(!check_function_exists("get_zabbix_config")) {
function get_zabbix_config() {
$config = get_config();
return array(
"host" => get_value_in_array("zabbix_host", $config, "127.0.0.1"),
"username" => get_value_in_array("zabbix_username", $config, "Admin"),
"password" => get_value_in_array("zabbix_password", $config, "zabbix"),
);
}
}
if(!check_function_exists("zabbix_get_base_url")) {
function zabbix_get_api_url($host, $protocol="http") {
return sprintf("%s://%s/zabbix/api_jsonrpc.php", $protocol, $host);