2013-03-26 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_tags.php, include/functions_reporting.php,
	include/constants.php, include/functions_ui.php,
	operation/agentes/estado_agente.php,
	operation/agentes/status_monitor.php, mobile/include/style/main.css:
	some cleans and remove unuseless code.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7890 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-03-26 17:15:49 +00:00
parent 5782bce170
commit 1729eee3d7
8 changed files with 135 additions and 89 deletions

View File

@ -1,3 +1,11 @@
2013-03-26 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_tags.php, include/functions_reporting.php,
include/constants.php, include/functions_ui.php,
operation/agentes/estado_agente.php,
operation/agentes/status_monitor.php, mobile/include/style/main.css:
some cleans and remove unuseless code.
2013-03-25 Hirofumi Kosaka <kosaka@rworks.jp>
* pandora_console_install: Fixed false recognition of RHEL6.4

View File

@ -139,6 +139,7 @@ define('AGENT_MODULE_STATUS_CRITICAL_BAD', 1);
define('AGENT_MODULE_STATUS_CRITICAL_ALERT', 100);
define('AGENT_MODULE_STATUS_NO_DATA', 4);
define('AGENT_MODULE_STATUS_NORMAL', 0);
define('AGENT_MODULE_STATUS_NOT_NORMAL', 6);
define('AGENT_MODULE_STATUS_WARNING', 2);
define('AGENT_MODULE_STATUS_UNKNOW', 3);
define('AGENT_MODULE_STATUS_NOT_INIT', 5);

View File

@ -627,7 +627,14 @@ function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_mediu
if ($cutname) {
$agent_name = ui_print_truncate_text($agent_name, $cutoff, true, true, true, '[&hellip;]', $style);
}
$output = '<a style="' . $style . '" href="'.$server_url.'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agent.$extra_params.'" title="'.$agent_name_full.'"><b><span style="'.$style.'">'.$agent_name.'</span></b></a>';
$url = $server_url . 'index.php?sec=estado&amp;'.
'sec2=operation/agentes/ver_agente&amp;' .
'id_agente=' . $id_agent.$extra_params;
$output = '<a style="' . $style . '"' .
' href="' . $url . '"' .
' title="'.$agent_name_full.'"><b><span style="'.$style.'">'.$agent_name.'</span></b></a>';
//TODO: Add a pretty javascript (using jQuery) popup-box with agent details

View File

@ -93,32 +93,49 @@ tr.group_view_data, .group_view_data {
/*INIT----------Events styles-----------------------------------------*/
.datos_green, .datos_greenf9, .datos_green a, .datos_greenf9 a {
background-color: #52A000;
color: #FFFFFF;
color: #FFFFFF !important;
text-shadow: none !important;
}
.datos_red, .datos_redf9, .datos_red a, .datos_redf9 a {
background-color: #FF3E41;
color: #FFFFFF !important;
text-shadow: none !important;
}
.datos_yellow, .datos_yellowf9 {
.datos_yellow, .datos_yellowf9, .datos_yellow a, .datos_yellowf9 a {
background-color: #F5E535;
color: #000000;
color: #000000 !important;
text-shadow: none !important;
}
a.datos_blue, .datos_bluef9, .datos_blue {
.datos_blue, .datos_bluef9, .datos_blue a, .datos_bluef9 a {
background-color: #77E2F2;
color: #000000;
color: #000000 !important;
text-shadow: none !important;
}
.datos_grey, .datos_greyf9 {
.datos_grey, .datos_greyf9, .datos_grey a, .datos_greyf9 a {
background-color: #E4E4E4;
color: #000000 !important;
text-shadow: none !important;
}
.datos_pink, .datos_pinkf9 {
.datos_pink, .datos_pinkf9, .datos_pink a, .datos_pinkf9 a {
background-color: #FF92E9;
color: #000000 !important;
text-shadow: none !important;
}
.datos_brown, .datos_brownf9 {
.datos_brown, .datos_brownf9, .datos_brown a, .datos_brownf9 a {
background-color: #C97A4A;
color: #000000 !important;
text-shadow: none !important;
}
tr.events {
border-bottom: 3px solid white !important;
font-size: 12px !important;
}
table#list_events th {
font-size: 12px !important;
font-weight: bolder !important;
}
/*END-----------Events styles-----------------------------------------*/

View File

@ -109,11 +109,6 @@ if (is_ajax ()) {
}
ob_end_clean();
$first = true;
while ($row = db_get_all_row_by_steps_sql($first, $result, "SELECT * FROM tgrupo")) {
$first = false;
}
// Take some parameters (GET)
$group_id = (int) get_parameter ("group_id", 0);
$search = trim(get_parameter ("search", ""));
@ -232,11 +227,13 @@ switch ($sortField) {
switch ($sort) {
case 'up':
$selectNameUp = $selected;
$order = array('field' => 'nombre COLLATE utf8_general_ci', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
$order = array('field' => 'nombre COLLATE utf8_general_ci',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
break;
case 'down':
$selectNameDown = $selected;
$order = array('field' => 'nombre COLLATE utf8_general_ci', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
$order = array('field' => 'nombre COLLATE utf8_general_ci',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
break;
}
break;
@ -244,11 +241,13 @@ switch ($sortField) {
switch ($sort) {
case 'up':
$selectOsUp = $selected;
$order = array('field' => 'id_os', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
$order = array('field' => 'id_os',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
break;
case 'down':
$selectOsDown = $selected;
$order = array('field' => 'id_os', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
$order = array('field' => 'id_os',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
break;
}
break;
@ -256,11 +255,13 @@ switch ($sortField) {
switch ($sort) {
case 'up':
$selectIntervalUp = $selected;
$order = array('field' => 'intervalo', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
$order = array('field' => 'intervalo',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
break;
case 'down':
$selectIntervalDown = $selected;
$order = array('field' => 'intervalo', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
$order = array('field' => 'intervalo',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
break;
}
break;
@ -268,11 +269,13 @@ switch ($sortField) {
switch ($sort) {
case 'up':
$selectGroupUp = $selected;
$order = array('field' => 'id_grupo', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
$order = array('field' => 'id_grupo',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
break;
case 'down':
$selectGroupDown = $selected;
$order = array('field' => 'id_grupo', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
$order = array('field' => 'id_grupo',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
break;
}
break;
@ -280,11 +283,13 @@ switch ($sortField) {
switch ($sort) {
case 'up':
$selectLastContactUp = $selected;
$order = array('field' => 'ultimo_contacto', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
$order = array('field' => 'ultimo_contacto',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'DESC');
break;
case 'down':
$selectLastContactDown = $selected;
$order = array('field' => 'ultimo_contacto', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
$order = array('field' => 'ultimo_contacto',
'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
break;
}
break;
@ -299,7 +304,9 @@ switch ($sortField) {
$selectGroupDown = '';
$selectLastContactUp = '';
$selectLastContactDown = '';
$order = array('field' => 'nombre COLLATE utf8_general_ci', 'field2' => 'nombre COLLATE utf8_general_ci', 'order' => 'ASC');
$order = array('field' => 'nombre COLLATE utf8_general_ci',
'field2' => 'nombre COLLATE utf8_general_ci',
'order' => 'ASC');
break;
}

View File

@ -121,23 +121,23 @@ if ($ag_freestring != "") {
}
// Status selector
if ($status == 0) { //Normal
if ($status == AGENT_MODULE_STATUS_NORMAL) { //Normal
$sql_conditions .= " AND tagente_estado.estado = 0
AND (utimestamp > 0 OR (tagente_modulo.id_tipo_modulo IN(21,22,23,100))) ";
}
elseif ($status == 2) { //Critical
elseif ($status == AGENT_MODULE_STATUS_CRITICAL_BAD) { //Critical
$sql_conditions .= " AND tagente_estado.estado = 1 AND utimestamp > 0";
}
elseif ($status == 1) { //Warning
elseif ($status == AGENT_MODULE_STATUS_WARNING) { //Warning
$sql_conditions .= " AND tagente_estado.estado = 2 AND utimestamp > 0";
}
elseif ($status == 4) { //Not normal
elseif ($status == AGENT_MODULE_STATUS_NOT_NORMAL) { //Not normal
$sql_conditions .= " AND tagente_estado.estado <> 0";
}
elseif ($status == 3) { //Unknown
elseif ($status == AGENT_MODULE_STATUS_UNKNOW) { //Unknown
$sql_conditions .= " AND tagente_estado.estado = 3 AND tagente_estado.utimestamp <> 0";
}
elseif ($status == 5) { //Not init
elseif ($status == AGENT_MODULE_STATUS_NOT_INIT) { //Not init
$sql_conditions .= " AND tagente_estado.utimestamp = 0
AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,100)";
}
@ -336,12 +336,12 @@ echo '<td>' . __('Monitor status') . "</td>";
echo "<td>";
$fields = array ();
$fields[0] = __('Normal');
$fields[1] = __('Warning');
$fields[2] = __('Critical');
$fields[3] = __('Unknown');
$fields[4] = __('Not normal'); //default
$fields[5] = __('Not init');
$fields[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
$fields[AGENT_MODULE_STATUS_WARNING] = __('Warning');
$fields[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
$fields[AGENT_MODULE_STATUS_UNKNOW] = __('Unknown');
$fields[AGENT_MODULE_STATUS_NOT_NORMAL] = __('Not normal'); //default
$fields[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
html_print_select ($fields, "status", $status, '', __('All'), -1,
false, false, true, '', false, 'width: 125px;');
@ -590,8 +590,10 @@ switch ($config["dbtype"]) {
tagente_modulo.critical_instructions,
tagente_modulo.warning_instructions,
tagente_modulo.unknown_instructions,
tagente_estado.utimestamp AS utimestamp".$sql_from . $sql_conditions_all." ORDER BY " . $order['field'] . " " . $order['order']
. " LIMIT ".$offset.",".$limit_sql;
tagente_estado.utimestamp AS utimestamp" .
$sql_from . $sql_conditions_all . "
ORDER BY " . $order['field'] . " " . $order['order'] . "
LIMIT ".$offset.",".$limit_sql;
break;
case "postgresql":
$sql = "SELECT
@ -684,7 +686,9 @@ if (! defined ('METACONSOLE')) {
}
else {
// For each server defined and not disabled:
$servers = db_get_all_rows_sql ("SELECT * FROM tmetaconsole_setup WHERE disabled = 0");
$servers = db_get_all_rows_sql ("SELECT *
FROM tmetaconsole_setup
WHERE disabled = 0");
if ($servers === false)
$servers = array();
@ -1095,6 +1099,7 @@ ui_require_javascript_file('pandora_modules');
if (period == -1) {
period = $('#period').val();
}
$.ajax({
type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
@ -1116,8 +1121,8 @@ ui_require_javascript_file('pandora_modules');
height: 500
})
.show ();
refresh_pagination_callback (module_id, id_agent, server_name);
refresh_pagination_callback (module_id, id_agent, server_name);
}
});
}
@ -1133,6 +1138,7 @@ ui_require_javascript_file('pandora_modules');
var period = $('#period').val();
show_module_detail_dialog(module_id, id_agent, server_name, offset, period);
return false;
});
}