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

@ -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

@ -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