ossim_valid($sensor_id, OSS_HEX, 'illegal:' . _('Sensor ID')); if (ossim_error()) { echo "<div style='color:gray; margin:15px; text-align:center;'>" . _('Trend chart not available') . "</div>"; exit; } $tz = Util::get_timezone(); $timetz = gmdate("U") + 3600 * $tz; // time to generate dates with timezone correction $agent = $_SESSION['_agent_info'][md5($agent_id)]; $db = new ossim_db(); $conn = $db->connect(); //Agents trends if ($agent['ip'] == '127.0.0.1') { // Get default system uuid $system_id = Util::get_system_uuid(); $system_info = Av_center::get_system_info_by_id($conn, $system_id); if ($system_info['status'] == 'success') { $sensor_ip = $system_info['data']['admin_ip']; } $ip_cidr = empty($sensor_ip) ? $agent['ip'] : $sensor_ip; } else { $agent_idm_data = Ossec_agent::get_idm_data($sensor_id, $agent['ip']); $agent_idm_ip = $agent_idm_data['ip']; if (empty($agent_idm_ip)) { try { $agent_idm_ip = Ossec_agent::get_last_ip($sensor_id, $agent); } catch (Exception $e) { } } $ip_cidr = Asset_host_ips::valid_ip($agent_idm_ip) ? $agent_idm_ip : $agent['ip']; }
} 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 { $sensor_name = Av_sensor::get_name_by_id($conn, $sensor_id); } $sensor_ip = $res['data']['current_ip']; if (Ossec_utilities::get_default_sensor_id() == $sensor_id && empty($res['data']['ha_ip'])) { $sensor_ip = $res['data']['admin_ip']; } $sensor_ip_txt = $sensor_ip . ' [' . $sensor_name . ']'; } //Getting Agent information $_aux_agent = Asset_host::get_related_hids_agents($conn, $asset_id, $sensor_id);
?> var av_components = [ <?php echo $av_components; ?> ]; Main.autocomplete_avc(av_components); $('#go').click(function() { Main.search(); }); <?php if ($external_access == TRUE && count($avc_list['data']) == 1) { $ip_data = Av_center::get_system_info_by_ip($conn, $ip); if ($ip_data['status'] == 'error') { if (is_array($avc_list['data']) && !empty($avc_list['data'])) { $system_ids = array_keys($avc_list['data']); $ip_data = Av_center::get_system_info_by_id($conn, $system_ids[0]); } } if ($ip_data['status'] == 'success') { ?> Main.display_avc_info(false); var data = { system_id: '<?php echo $ip_data['data']['system_id']; ?> ', profiles: '<?php echo $ip_data['data']['profile']; ?> ',