Update zabbix.api.php
This commit is contained in:
parent
58e53462e0
commit
8bb946ace2
|
@ -7,6 +7,18 @@
|
||||||
* @documentation https://www.zabbix.com/documentation/3.0/manual/api
|
* @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")) {
|
if(!check_function_exists("zabbix_get_base_url")) {
|
||||||
function zabbix_get_api_url($host, $protocol="http") {
|
function zabbix_get_api_url($host, $protocol="http") {
|
||||||
return sprintf("%s://%s/zabbix/api_jsonrpc.php", $protocol, $host);
|
return sprintf("%s://%s/zabbix/api_jsonrpc.php", $protocol, $host);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user