2013-03-06 Sergio Martin <sergio.martin@artica.es>

* include/functions_servers.php
	operation/agentes/estado_generalagente.php: Order
	code and little fix

	* operation/events/events.build_table.php
	godmode/events/custom_events.php: Add Instructions to
	custom columns in event view to bug 3607062



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7801 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-03-06 17:53:17 +00:00
parent 80a1e20aae
commit dbb3e51b3d
5 changed files with 43 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2013-03-06 Sergio Martin <sergio.martin@artica.es>
* include/functions_servers.php
operation/agentes/estado_generalagente.php: Order
code and little fix
* operation/events/events.build_table.php
godmode/events/custom_events.php: Add Instructions to
custom columns in event view to bug 3607062
2013-03-06 Dario Rodriguez <dario@artica.es>
* operation/agentes/ver_agente.php: Adapted to new way to detect

View File

@ -112,6 +112,9 @@ if ($fields_selected[0]!='') {
case 'ack_utimestamp':
$result = __('ACK Timestamp');
break;
case 'instructions':
$result = __('Instructions');
break;
case 'server_name':
$result = __('Server name');
break;
@ -158,6 +161,7 @@ $fields_available['source'] = __('Source');
$fields_available['id_extra'] = __('Extra id');
$fields_available['owner_user'] = __('Owner');
$fields_available['ack_utimestamp'] = __('ACK Timestamp');
$fields_available['instructions'] = __('Instructions');
$fields_available['server_name'] = __('Server name');
//remove fields already selected

View File

@ -415,8 +415,8 @@ function servers_get_info ($id_server = -1) {
$server["module_lag"] = 0;
$server["lag"] = 0;
// Export server
if ($server["server_type"] == 8) {
// Inventory server
if ($server["server_type"] == SERVER_TYPE_INVENTORY) {
// Get modules exported by this server
$server["modules"] = db_get_sql ("SELECT COUNT(tagent_module_inventory.id_agent_module_inventory) FROM tagente, tagent_module_inventory WHERE tagente.disabled=0 AND tagent_module_inventory.id_agente = tagente.id_agente AND tagente.server_name = '" . $server["name"] . "'");
@ -445,7 +445,7 @@ function servers_get_info ($id_server = -1) {
AND (UNIX_TIMESTAMP() - utimestamp) > tagent_module_inventory.interval");
// Export server
}
else if ($server["server_type"] == 7) {
else if ($server["server_type"] == SERVER_TYPE_EXPORT) {
// Get modules exported by this server
$server["modules"] = db_get_sql ("SELECT COUNT(tagente_modulo.id_agente_modulo) FROM tagente, tagente_modulo, tserver_export WHERE tagente.disabled=0 AND tagente_modulo.id_agente = tagente.id_agente AND tagente_modulo.id_export = tserver_export.id AND tserver_export.id_export_server = " . $server["id_server"]);
@ -458,7 +458,7 @@ function servers_get_info ($id_server = -1) {
}
// Recon server
else if ($server["server_type"] == 3) {
else if ($server["server_type"] == SERVER_TYPE_RECON) {
$server["name"] = '<a href="index.php?sec=estado&amp;sec2=operation/servers/recon_view&amp;server_id='.$server["id_server"].'">'.$server["name"].'</a>';

View File

@ -275,7 +275,7 @@ $table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[0] = '<fieldset class="databox" style="width:98%;">
$data[0] = '<fieldset class="databox" style="width:98%; position: static;">
<legend style="text-align:left; color: #666;">' .
__('Events (24h)') .
'</legend>' .

View File

@ -47,7 +47,7 @@ if (in_array('id_evento', $show_fields)) {
}
if (in_array('evento', $show_fields)) {
$table->head[$i] = __('Event Name');
$table->align[$i] = 'center';
$table->align[$i] = 'left';
$i++;
}
if (in_array('id_agente', $show_fields)) {
@ -121,6 +121,11 @@ if (in_array('ack_utimestamp', $show_fields)) {
$table->align[$i] = 'center';
$i++;
}
if (in_array('instructions', $show_fields)) {
$table->head[$i] = __('Instructions');
$table->align[$i] = 'left';
$i++;
}
if ($i != 0 && $allow_action) {
$table->head[$i] = __('Action');
$table->align[$i] = 'center';
@ -416,6 +421,24 @@ foreach ($result as $event) {
$i++;
}
if (in_array('instructions',$show_fields)) {
switch($event['event_type']) {
case 'going_unknown':
$data[$i] = ui_print_truncate_text($event["unknown_instructions"]);
break;
case 'going_up_critical':
case 'going_down_critical':
$data[$i] = ui_print_truncate_text($event["critical_instructions"]);
break;
case 'going_down_warning':
$data[$i] = ui_print_truncate_text($event["warning_instructions"]);
break;
default:
$data[$i] = '';
}
$i++;
}
if ($i != 0 && $allow_action) {
//Actions
$data[$i] = '';