本文整理汇总了PHP中Asset_host::get_ips方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset_host::get_ips方法的具体用法?PHP Asset_host::get_ips怎么用?PHP Asset_host::get_ips使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset_host
的用法示例。
在下文中一共展示了Asset_host::get_ips方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Properties
if (ossim_error()) {
echo ossim_error(_('Error! Host not found'));
exit;
}
/****************************************************
******************** Host data *********************
****************************************************/
//Properties
$p_obj = new Properties($conn);
$properties = $p_obj->get_properties();
$host = new Asset_host($conn, $id);
$host->load_from_db($conn);
//CTX
$ctx = $host->get_ctx();
//Host Ips
$host_ips = $host->get_ips();
$ips = $host_ips->get_ips();
$ips = array_keys($ips);
$is_nagios_enabled = $host->is_nagios_enabled($conn);
$is_ext_ctx = FALSE;
$ext_ctxs = Session::get_external_ctxs($conn);
if (!empty($ext_ctxs[$ctx])) {
$is_ext_ctx = TRUE;
}
/****************************************************
******************* Other data *********************
****************************************************/
//Ports
$ports = array();
$port_list = Port::get_list($conn);
foreach ($port_list as $port) {
示例2: sprintf
//Server related to CTX
$server_obj = Server::get_server_by_ctx($conn, $ctx);
if ($server_obj) {
$s_name = $server_obj->get_name();
$s_ip = $server_obj->get_ip();
$server = $s_name . ' (' . $s_ip . ')';
$e_msg = sprintf(_("Unable to deploy agent to assets on a child server. Please login to %s to deploy the HIDS agents"), $server);
}
Av_exception::throw_error(Av_exception::USER_ERROR, $e_msg);
}
} catch (Exception $e) {
$validation_errors['asset_id'] = $e->getMessage();
}
if (empty($validation_errors)) {
//Getting asset information
$_ips = $asset->get_ips();
$ips = $_ips->get_ips();
//Checking HIDS Sensor
$cnd_1 = Ossec_utilities::is_sensor_allowed($conn, $sensor_id) == FALSE;
$asset_sensors = Asset_host_sensors::get_sensors_by_id($conn, $asset_id);
$cnd_2 = empty($asset_sensors[$sensor_id]);
if ($cnd_1 || $cnd_2) {
$validation_errors['sensor_id'] = sprintf(_("Sensor %s not allowed. Please check with your account admin for more information"), Av_sensor::get_name_by_id($conn, $sensor_id));
} else {
$system_ids = Av_center::get_system_id_by_component($conn, $sensor_id);
$res = Av_center::get_system_info_by_id($conn, $system_ids['non-canonical']);
if ($res['status'] == 'success') {
//We use this function to calculate sensor name because in HA environments there are two systems for one Sensor ID
if (empty($res['data']['ha_ip'])) {
$sensor_name = $res['data']['name'];
} else {
示例3: array
?>
</head>
<body>
<?php
if ($data['status'] != 'error') {
try {
$db = new ossim_db();
$conn = $db->connect();
$is_in_db = Asset_host::is_in_db($conn, $id);
$host = new Asset_host($conn, $id);
if ($is_in_db == TRUE) {
$can_i_modify_ips = Asset_host::can_i_modify_ips($conn, $id);
$can_i_create_assets = TRUE;
$host->load_from_db($conn, $id);
$ips_obj = $host->get_ips();
$old_ips = $ips_obj->get_ips();
} else {
$can_i_modify_ips = TRUE;
$can_i_create_assets = Session::can_i_create_assets();
$old_ips = array();
}
if ($can_i_create_assets == TRUE) {
$host->set_ctx($ctx);
$host->set_name($name);
if ($can_i_modify_ips == TRUE) {
if (is_array($aux_ips) && !empty($aux_ips)) {
foreach ($aux_ips as $ip) {
$mac = !empty($old_ips[$ip]['mac']) ? $old_ips[$ip]['mac'] : NULL;
$ips[$ip] = array('ip' => $ip, 'mac' => $mac);
}