2014-04-16 Miguel de Dios <miguel.dedios@artica.es>

* include/javascript/d3.v3.4.5.js: added the last javascript
	D3 library.
	
	* include/javascript/pandora_modules.js,
	include/functions_visual_map.php, include/functions_networkmap.php,
	include/functions_os.php, include/db/mysql.php,
	include/functions_netflow.php, include/constants.php,
	include/functions_reporting.php: standarized the color, now the
	code uses the colors constant.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9773 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-04-16 14:42:28 +00:00
parent 4f9b6c2818
commit cd56ef2542
10 changed files with 9335 additions and 41 deletions

View File

@ -1,3 +1,15 @@
2014-04-16 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/d3.v3.4.5.js: added the last javascript
D3 library.
* include/javascript/pandora_modules.js,
include/functions_visual_map.php, include/functions_networkmap.php,
include/functions_os.php, include/db/mysql.php,
include/functions_netflow.php, include/constants.php,
include/functions_reporting.php: standarized the color, now the
code uses the colors constant.
2014-04-16 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_networkmap.php: cleaned source code and killed

View File

@ -281,7 +281,7 @@ define ('MODULE_PREDICTION_SYNTHETIC', 3);
define ('MODULE_PREDICTION_NETFLOW', 4);
/* SNMP CONSTANTS */
define ('SNMP_DIR_MIBS', "attachment/mibs");
define('SNMP_DIR_MIBS', "attachment/mibs");
define('SNMP_TRAP_TYPE_NONE', -1);
define('SNMP_TRAP_TYPE_COLD_START', 0);
define('SNMP_TRAP_TYPE_WARM_START', 1);

View File

@ -35,7 +35,7 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null,
return false;
}
mysql_select_db($db, $connect_id);
mysql_select_db($db, $connect_id);
return $connect_id;
}

View File

@ -353,7 +353,7 @@ function netflow_summary_table ($data) {
$table->style[0] = 'font-weight: bold; padding: 6px';
$table->style[1] = 'padding: 6px';
$data = array();
$data[] = __('Total flows');
$data[] = format_numeric ($data['totalflows']);
@ -557,7 +557,7 @@ function netflow_get_data ($start_date, $end_date, $interval_length, $filter, $a
if (($aggregate != 'none') && (empty($values['data']))) {
return array();
}
return $values;
}

View File

@ -809,19 +809,19 @@ function networkmap_create_group_node ($group, $simple = 0, $font_size = 10, $me
// Set node status
switch ($status) {
case 0:
$status_color = '#8DFF1D'; // Normal monitor
$status_color = COL_NORMAL; // Normal monitor
break;
case 1:
$status_color = '#FF1D1D'; // Critical monitor
$status_color = COL_CRITICAL; // Critical monitor
break;
case 2:
$status_color = '#FFE308'; // Warning monitor
$status_color = COL_WARNING; // Warning monitor
break;
case 4:
$status_color = '#FFA300'; // Alert fired
$status_color = COL_ALERTFIRED; // Alert fired
break;
default:
$status_color = '#BBBBBB'; // Unknown monitor
$status_color = COL_UNKNOWN; // Unknown monitor
break;
}
@ -911,20 +911,20 @@ function networkmap_create_agent_node ($agent, $simple = 0, $font_size = 10, $cu
// Set node status
switch ($status) {
case AGENT_STATUS_NORMAL:
$status_color = '#8DFF1D';
$status_color = COL_NORMAL;
break;
case AGENT_STATUS_CRITICAL:
$status_color = '#FF1D1D';
$status_color = COL_CRITICAL;
break;
case AGENT_STATUS_WARNING:
$status_color = '#FFE308';
$status_color = COL_WARNING;
break;
case AGENT_STATUS_ALERT_FIRED:
$status_color = '#FFA300';
$status_color = COL_ALERTFIRED;
break;
default:
//Unknown monitor
$status_color = '#BBBBBB';
$status_color = COL_UNKNOWN;
break;
}
@ -1013,19 +1013,19 @@ function networkmap_create_module_group_node ($module_group, $simple = 0, $font_
// Set node status
switch ($module_group['status']) {
case 0:
$status_color = '#8DFF1D'; // Normal monitor
$status_color = COL_NORMAL; // Normal monitor
break;
case 1:
$status_color = '#FF1D1D'; // Critical monitor
$status_color = COL_CRITICAL; // Critical monitor
break;
case 2:
$status_color = '#FFE308'; // Warning monitor
$status_color = COL_WARNING; // Warning monitor
break;
case 4:
$status_color = '#FFA300'; // Alert fired
$status_color = COL_ALERTFIRED; // Alert fired
break;
default:
$status_color = '#BBBBBB'; // Unknown monitor
$status_color = COL_UNKNOWN; // Unknown monitor
break;
}
@ -1090,19 +1090,19 @@ function networkmap_create_module_node ($module, $simple = 0, $font_size = 10, $
// Set node status
switch ($status) {
case AGENT_MODULE_STATUS_NORMAL:
$status_color = '#8DFF1D'; // Normal monitor
$status_color = COL_NORMAL; // Normal monitor
break;
case AGENT_MODULE_STATUS_CRITICAL_BAD:
$status_color = '#FF1D1D'; // Critical monitor
$status_color = COL_CRITICAL; // Critical monitor
break;
case AGENT_MODULE_STATUS_WARNING:
$status_color = '#FFE308'; // Warning monitor
$status_color = COL_WARNING; // Warning monitor
break;
case AGENT_STATUS_ALERT_FIRED:
$status_color = '#FFA300'; // Alert fired
$status_color = COL_ALERTFIRED; // Alert fired
break;
default:
$status_color = '#BBBBBB'; // Unknown monitor
$status_color = COL_UNKNOWN; // Unknown monitor
break;
}

View File

@ -20,32 +20,49 @@ function os_agents_critical ($id_os) {
//TODO REVIEW ORACLE AND POSTGRES
return db_get_sql ("SELECT COUNT(*) FROM tagente WHERE tagente.disabled=0 AND critical_count>0 AND id_os=$id_os");
return db_get_sql("
SELECT COUNT(*)
FROM tagente
WHERE tagente.disabled=0 AND
critical_count>0 AND id_os=$id_os");
}
// Get ok agents by using the status code in modules.
function os_agents_ok($id_os) {
return db_get_sql ("SELECT COUNT(*) FROM tagente WHERE tagente.disabled=0 AND normal_count=total_count AND id_os=$id_os");
return db_get_sql ("
SELECT COUNT(*)
FROM tagente
WHERE tagente.disabled=0 AND
normal_count=total_count AND id_os=$id_os");
}
// Get warning agents by using the status code in modules.
function os_agents_warning ($id_os) {
return db_get_sql ("SELECT COUNT(*) FROM tagente WHERE tagente.disabled=0 AND critical_count=0 AND warning_count>0 AND id_os=$id_os");
return db_get_sql ("
SELECT COUNT(*)
FROM tagente
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count>0 AND id_os=$id_os");
}
// Get unknown agents by using the status code in modules.
function os_agents_unknown ($id_os) {
return db_get_sql ("SELECT COUNT(*) FROM tagente WHERE tagente.disabled=0 AND critical_count=0 AND warning_count=0 AND unknown_count>0 AND id_os=$id_os");
return db_get_sql ("
SELECT COUNT(*)
FROM tagente
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count=0 AND
unknown_count>0 AND id_os=$id_os");
}
// Get the name of a group given its id.
function os_get_name ($id_os) {
function os_get_name($id_os) {
return db_get_value ('name', 'tconfig_os', 'id_os', (int) $id_os);
}

View File

@ -3018,7 +3018,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
else {
$agent_name = agents_get_name($content['id_agent']);
}
$item_title = $content['name'];
switch ($content["type"]) {
@ -6371,7 +6371,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
if ($description == '') {
$description = $filter['id_name'];
}
if (empty($item_title)) {
$item_title = $description;
}

View File

@ -101,7 +101,7 @@ function visual_map_print_item($layoutData) {
if ($layoutData['image'] != null) {
$img = visual_map_get_image_status_element($layoutData);
if (substr($img,0,1) == '4') {
$borderStyle ='border: 2px solid #ffa300;';
$borderStyle ='border: 2px solid ' . COL_ALERTFIRED . ';';
$img = substr_replace($img, '', 0,1);
}
}
@ -126,7 +126,7 @@ function visual_map_print_item($layoutData) {
if ($layoutData['image'] != null) {
$img = visual_map_get_image_status_element($layoutData);
if (substr($img,0,1) == '4') {
$borderStyle ='border: 2px solid #ffa300;';
$borderStyle ='border: 2px solid ' . COL_ALERTFIRED . ';';
$img = substr_replace($img, '', 0,1);
}
}
@ -1324,7 +1324,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
$borderStyle = '';
if (substr($img,0,1) == '4') {
$img_style['border'] = '2px solid #ffa300;';
$img_style['border'] = '2px solid ' . COL_ALERTFIRED .';';
$img = substr_replace($img, '', 0,1);
}

File diff suppressed because it is too large Load Diff

View File

@ -474,7 +474,7 @@ function new_macro(prefix) {
$('#delete_macro_button').show();
var next_row = parseInt($('#next_row').html());
$('#next_row').html(next_row + 3);
var nrow1 = next_row - 3;
var nrow2 = next_row - 2;
@ -482,7 +482,7 @@ function new_macro(prefix) {
var nrow4 = next_row;
var nrow5 = next_row + 1;
var nrow6 = next_row + 2;
var next_number = parseInt($('#next_macro').html());
$('#next_macro').html(next_number + 1);
var current_number = next_number - 1;
@ -573,7 +573,7 @@ function new_macro(prefix) {
return prefix + (nrow6) + '-3';
break;
}
}
}
}
function add_macro_field(macro, row_model_id) {
@ -583,7 +583,7 @@ function add_macro_field(macro, row_model_id) {
var macro_macro = macro['macro'];
var macro_value = $('<div />').html(macro['value']).text();
var macro_hide = macro['hide'];
macro_value.type = 'password';
var row_id = row_model_id + macro_macro;