本文整理汇总了PHP中Av_sensor::get_nagios_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Av_sensor::get_nagios_url方法的具体用法?PHP Av_sensor::get_nagios_url怎么用?PHP Av_sensor::get_nagios_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Av_sensor
的用法示例。
在下文中一共展示了Av_sensor::get_nagios_url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
}
//If we have permissions to see any sensor...
if (!empty($sensors_nagios)) {
if ($ng_selected == -1) {
$ng_selected = 0;
}
$_ip = $sensors_nagios[$ng_selected]['ip'];
//Remote ossim sensors and remote nagios...
if ($_ip != '' && $_ip != 'localhost' && $_ip != Util::get_default_admin_ip() && $_ip != $_SERVER['SERVER_NAME']) {
$_sensor = new Av_sensor($sensors_nagios[$ng_selected]['id']);
$_sensor->load_from_db($conn);
$nagios_options = $_sensor->get_nagios_credentials($conn);
$_s_user = $nagios_options['user'];
$_s_pass = $nagios_options['password'];
try {
$nagios_url = $_sensor->get_nagios_url($_s_user, $_s_pass);
$nagios = $nagios_url['url'];
$nagios_opts = $nagios_url['s_context'];
if (preg_match('/^http:\\/\\//', $nagios) && $_s_user != '' && $_s_pass != '') {
$nagios = str_replace('http://', "http://{$_s_user}:{$_s_pass}@", $nagios);
} elseif (preg_match('/^https:\\/\\//', $nagios) && $nagios_opts['http']['header'] != '') {
$flag_login = TRUE;
$_login = base64_encode(Util::encrypt($_s_user . "####" . md5($_s_pass), $conf->get_conf('remote_key')));
$_SESSION['_remote_nagios_credential'] = array($_ip, $_login);
}
} catch (Exception $e) {
$flag_opts = FALSE;
// Exception message ignored, it will show messages.php?msg=2
}
} else {
$nagios = $path;