$load_average = $st['load_average']; $current_sessions = $st['sessions']['total']; //CPU $cpu_data = $st['cpu']; $cpu_load = number_format($cpu_data['load_average'], 2); $cpu_proc = $cpu_data['cpu0']['core']; $num_cores = count($cpu_data) - 1; //Real memory $rmt = Avc_utilities::bytesToSize($st['memory']['ram']['total']); $rmu = Avc_utilities::bytesToSize($st['memory']['ram']['used']); $rmf = Avc_utilities::bytesToSize($st['memory']['ram']['free']); $rmp = number_format($st['memory']['ram']['percent_used'], 2); //Virtual memory $vmt = Avc_utilities::bytesToSize($st['memory']['swap']['total']); $vmu = Avc_utilities::bytesToSize($st['memory']['swap']['used']); $vmf = Avc_utilities::bytesToSize($st['memory']['swap']['free']); $vmp = number_format($st['memory']['swap']['percent_used'], 2); //Disk Usage $mounted_disks = $st['disk']; ?> <table id='t_status' cellspacing='0' cellpadding='0'> <thead> <tr> <th class='th_status' colspan='2'><?php echo _('Main Information'); ?> </th> <th class='th_status' colspan='3'><?php echo _('System Information');
<?php $i_role_names = array('disabled' => _('Not in Use'), 'admin' => _('Management'), 'monitoring' => _('Network Monitoring'), 'log_management' => _('Log Collection & Scanning')); //Reorder interfaces $i_lo = array('lo' => $st['interfaces']['lo']); unset($st['interfaces']['lo']); $st['interfaces'] = array_merge($i_lo, $st['interfaces']); foreach ($st['interfaces'] as $i_name => $i_data) { if ('up' === $i_data['status']) { $text_color = 'green'; $if_image = 'port_animado.gif'; } else { $text_color = 'red'; $if_image = 'no_animado.gif'; } $i_data['rx_bytes'] = Avc_utilities::bytesToSize($i_data['rx_bytes'], 2); $i_data['tx_bytes'] = Avc_utilities::bytesToSize($i_data['tx_bytes'], 2); $i_data['role'] = $i_name == 'lo' ? ' - ' : $i_role_names[$i_data['role']]; ?> <tr> <td rowspan='2' class='_label td_iface_name'><?php echo $i_name; ?> </td> <td rowspan='2' id='<?php echo $i_name . '_status'; ?> ' class='td_iface_status'> <div id='container_iface_st'> <img src="<?php echo AVC_PIXMAPS_DIR . '/' . $if_image;
} /************************************************************* ****************** Alienvault Status Data ******************* **************************************************************/ $profiles = array(); //Sensor profile if (is_array($st['sensor']) && !empty($st['sensor'])) { $plugins_enabled = $st['sensor']['plugins_enabled']; $sniffing_interfaces = empty($st['sensor']['sniffing_interfaces']) ? "<img src='" . AVC_PIXMAPS_DIR . "/cross.png' alt='" . _('No') . "'/>" : str_replace(',', ', ', $st['sensor']['sniffing_interfaces']); $network_monitored = $st['sensor']['network_monitored']; $netflow = $st['sensor']['sensor_netflow'] == 'yes' ? 'tick.png' : 'cross.png'; $profiles['Sensor'] = array(array('label' => _('Plugins enabled'), 'data' => $plugins_enabled), array('label' => _('Sniffing Interfaces'), 'data' => $sniffing_interfaces), array('label' => _('Netflow'), 'data' => "<img src='" . AVC_PIXMAPS_DIR . '/' . $netflow . "' alt='{$netflow}'/>"), array('label' => _('Network monitored'), 'data' => str_replace(',', ', ', $network_monitored))); } //Database profile if (is_array($st['database']) && !empty($st['database'])) { $profiles['Database'] = array(array('label' => 'Alienvault', 'data' => Avc_utilities::bytesToSize($st['database']['alienvault']['size'])), array('label' => 'Alienvault SIEM', 'data' => Avc_utilities::bytesToSize($st['database']['alienvault_siem']['size'])), array('label' => 'Inventory', 'data' => Avc_utilities::bytesToSize($st['database']['ocsweb']['size']))); } //Server profile if (is_array($st['server']) && !empty($st['server'])) { $entity_total = $st['server']['directives']['entities']['total']; $entity_enabled = $st['server']['directives']['entities']['enabled']; $total_directives = $st['server']['directives']['total']; $categories = $entity_total . "<span class='cursive'> (" . $entity_enabled . "<span class='green'> " . _('enabled') . "</span>)</span>"; $ip_reputation = 'yes' === $st['server']['ip_reputation'] ? 'tick.png' : 'cross.png'; $img_reputation = "<img src='" . AVC_PIXMAPS_DIR . '/' . $ip_reputation . "' alt='{$ip_reputation}'/>"; $local_system = Util::get_default_uuid(); if ($system_id == $local_system) { // Show with EPS graph $profiles['Server'] = array(array('label' => _('Total Directives'), 'data' => $total_directives), array('label' => _('Categories'), 'data' => $categories), array('label' => _('IP Reputation'), 'data' => $img_reputation), array('label' => _('EPS'), 'data' => "<a class='grbox' id='lnk_vt' title='" . _('EPS Trend') . "' href='/ossim/control_panel/eps_trend.php?range=day'>" . _('View Trend') . "</a>")); } else { $profiles['Server'] = array(array('label' => _('Total Directives'), 'data' => $total_directives), array('label' => _('Categories'), 'data' => $categories), array('label' => _('IP Reputation'), 'data' => $img_reputation));