2014-03-20 Miguel de Dios <miguel.dedios@artica.es>
* images/group_green.disabled.png, images/group_green.png, extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql, extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql, extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql, godmode/reporting/visual_console_builder.editor.js, godmode/agentes/configurar_agente.php, include/styles/pandora.css, include/functions_networkmap.php, include/functions_agents.php, include/functions_visual_map_editor.php, include/functions_modules.php, include/functions_groups.php, include/constants.php, include/functions_visual_map.php, include/ajax/visual_console_builder.ajax.php, pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql: added the feature to show the item for groups in visualmap. Incident: #671 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9621 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
f902bde134
commit
cdb9ccb84b
|
@ -1,3 +1,21 @@
|
|||
2014-03-20 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* images/group_green.disabled.png, images/group_green.png,
|
||||
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql,
|
||||
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
|
||||
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
|
||||
godmode/reporting/visual_console_builder.editor.js,
|
||||
godmode/agentes/configurar_agente.php, include/styles/pandora.css,
|
||||
include/functions_networkmap.php, include/functions_agents.php,
|
||||
include/functions_visual_map_editor.php,
|
||||
include/functions_modules.php, include/functions_groups.php,
|
||||
include/constants.php, include/functions_visual_map.php,
|
||||
include/ajax/visual_console_builder.ajax.php, pandoradb.sql,
|
||||
pandoradb.postgreSQL.sql, pandoradb.oracle.sql: added the feature to
|
||||
show the item for groups in visualmap.
|
||||
|
||||
Incident: #671
|
||||
|
||||
2014-03-20 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/snmpconsole/snmp_alert.php,
|
||||
|
|
|
@ -43,9 +43,9 @@ ALTER TABLE tgraph_source MODIFY COLUMN `weight` float(8,3) NOT NULL DEFAULT 0;
|
|||
ALTER TABLE `pandora`.`tagente_modulo` MODIFY COLUMN `post_process` DOUBLE DEFAULT NULL;
|
||||
|
||||
/* 2014/03/18 */
|
||||
-- ----------------------------------------------------------------------
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmodule_relationship`
|
||||
-- ----------------------------------------------------------------------
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tmodule_relationship` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`module_a` int(10) unsigned NOT NULL,
|
||||
|
@ -79,3 +79,8 @@ ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f19_` text;
|
|||
ALTER TABLE `talert_snmp` ADD COLUMN `_snmp_f20_` text;
|
||||
|
||||
ALTER TABLE `tnetwork_map` ADD COLUMN `l2_network` tinyint(1) unsigned NOT NULL default '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tlayout_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `tlayout_data` ADD COLUMN `id_group` INTEGER UNSIGNED NOT NULL default 0;
|
||||
|
|
|
@ -68,4 +68,9 @@ ALTER TABLE talert_snmp ADD (_snmp_f18_ CLOB default '');
|
|||
ALTER TABLE talert_snmp ADD (_snmp_f19_ CLOB default '');
|
||||
ALTER TABLE talert_snmp ADD (_snmp_f20_ CLOB default '');
|
||||
|
||||
ALTER TABLE tnetwork_map ADD (l2_network NUMBER(1, 0) default 0 NOT NULL);
|
||||
ALTER TABLE tnetwork_map ADD (l2_network NUMBER(1, 0) default 0 NOT NULL);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tlayout_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `tlayout_data` ADD COLUMN id_group NUMBER(10, 0) default 0 NOT NULL;
|
||||
|
|
|
@ -66,3 +66,8 @@ ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f19_" text DEFAULT '';
|
|||
ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f20_" text DEFAULT '';
|
||||
|
||||
ALTER TABLE "tnetwork_map" ADD COLUMN "l2_network" SMALLINT NOT NULL default 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tlayout_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE "tlayout_data" ADD COLUMN "id_group" INTEGER NOT NULL default 0;
|
|
@ -382,7 +382,7 @@ if ($id_agente) {
|
|||
'tab=remote_configuration&' .
|
||||
'id_agente=' . $id_agente . '&' .
|
||||
'disk_conf=' . $agent_md5 . '">'
|
||||
. html_print_image ("images/book_edit.png", true,
|
||||
. html_print_image ("images/remote_configuration.png", true,
|
||||
array("title" =>__('Remote configuration')))
|
||||
. '</a>';
|
||||
if ($tab == 'remote_configuration')
|
||||
|
|
|
@ -103,6 +103,7 @@ function update_button_palette_callback() {
|
|||
|
||||
idElement = 0;
|
||||
break;
|
||||
case 'group_item':
|
||||
case 'static_graph':
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
|
||||
|
@ -219,6 +220,7 @@ function readFields() {
|
|||
values['type_percentile'] = $("input[name=type_percentile]:checked").val();
|
||||
values['value_show'] = $("input[name=value_show]:checked").val();
|
||||
values['enable_link'] = $("input[name=enable_link]").is(':checked') ? 1 : 0;
|
||||
values['id_group'] = $("select[name=group]").val();
|
||||
|
||||
if (metaconsole != 0) {
|
||||
values['metaconsole'] = 1;
|
||||
|
@ -245,6 +247,7 @@ function create_button_palette_callback() {
|
|||
//VALIDATE DATA
|
||||
var validate = true;
|
||||
switch (creationItem) {
|
||||
case 'group_item':
|
||||
case 'static_graph':
|
||||
if ((values['label'] == '') && (values['image'] == '')) {
|
||||
alert($("#message_alert_no_label_no_image").html());
|
||||
|
@ -332,6 +335,7 @@ function toggle_item_palette() {
|
|||
activeToolboxButton('label', true);
|
||||
activeToolboxButton('icon', true);
|
||||
activeToolboxButton('percentile_item', true);
|
||||
activeToolboxButton('group_item', true);
|
||||
|
||||
if (typeof(enterprise_activeToolboxButton) == 'function') {
|
||||
enterprise_activeToolboxButton(true);
|
||||
|
@ -355,6 +359,7 @@ function toggle_item_palette() {
|
|||
activeToolboxButton('label', false);
|
||||
activeToolboxButton('icon', false);
|
||||
activeToolboxButton('percentile_item', false);
|
||||
activeToolboxButton('group_item', false);
|
||||
|
||||
activeToolboxButton('edit_item', false);
|
||||
activeToolboxButton('delete_item', false);
|
||||
|
@ -539,6 +544,10 @@ function loadFieldsFromDB(item) {
|
|||
}
|
||||
}
|
||||
|
||||
if (key == 'id_group') {
|
||||
$("select[name=group]").val(val);
|
||||
}
|
||||
|
||||
if (metaconsole != 0) {
|
||||
if (key == 'id_agent') {
|
||||
$("#hidden-agent").val(val);
|
||||
|
@ -638,6 +647,9 @@ function hiddenFields(item) {
|
|||
$("#module_row").css('display', 'none');
|
||||
$("#module_row." + item).css('display', '');
|
||||
|
||||
$("#group_row").css('display', 'none');
|
||||
$("#group_row." + item).css('display', '');
|
||||
|
||||
$("#process_value_row").css('display', 'none');
|
||||
$("#process_value_row." + item).css('display', '');
|
||||
|
||||
|
@ -1036,6 +1048,7 @@ function createItem(type, values, id_data) {
|
|||
}
|
||||
|
||||
switch (type) {
|
||||
case 'group_item':
|
||||
case 'static_graph':
|
||||
if ((values['width'] == 0) && (values['height'] == 0)) {
|
||||
sizeStyle = '';
|
||||
|
@ -1048,7 +1061,8 @@ function createItem(type, values, id_data) {
|
|||
|
||||
var element_status= null;
|
||||
var parameter = Array();
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "page",
|
||||
value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "get_element_status", value: "1"});
|
||||
parameter.push ({name: "id_element", value: id_data});
|
||||
|
||||
|
@ -1088,8 +1102,17 @@ function createItem(type, values, id_data) {
|
|||
}
|
||||
});
|
||||
|
||||
switch (type) {
|
||||
case 'group_item':
|
||||
class_type = "group_item";
|
||||
break;
|
||||
case 'static_graph':
|
||||
class_type = "static_graph";
|
||||
break;
|
||||
}
|
||||
|
||||
item = $('<div id="' + id_data
|
||||
+ '" class="item static_graph" '
|
||||
+ '" class="item ' + class_type + '" '
|
||||
+ 'style="color: ' + values['label_color']
|
||||
+ '; text-align: center; position: absolute; display: inline-block; '
|
||||
+ sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
|
@ -1264,6 +1287,7 @@ function updateDB_visual(type, idElement , values, event, top, left) {
|
|||
}
|
||||
|
||||
switch (type) {
|
||||
case 'group_item':
|
||||
case 'static_graph':
|
||||
if ((event != 'resizestop') && (event != 'show_grid')
|
||||
&& (event != 'dragstop')) {
|
||||
|
@ -1591,6 +1615,14 @@ function eventsItems(drag) {
|
|||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('group_item')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'group_item';
|
||||
idItem = $(divParent).attr('id');
|
||||
activeToolboxButton('edit_item', true);
|
||||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('percentile_item')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'percentile_item';
|
||||
|
@ -1661,6 +1693,9 @@ function eventsItems(drag) {
|
|||
if ($(event.target).hasClass('static_graph')) {
|
||||
selectedItem = 'static_graph';
|
||||
}
|
||||
if ($(event.target).hasClass('group_item')) {
|
||||
selectedItem = 'group_item';
|
||||
}
|
||||
if ($(event.target).hasClass('percentile_item')) {
|
||||
selectedItem = 'percentile_item';
|
||||
}
|
||||
|
@ -1821,7 +1856,11 @@ function click_button_toolbox(id) {
|
|||
toolbuttonActive = creationItem = 'icon';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
|
||||
case 'group_item':
|
||||
toolbuttonActive = creationItem = 'group_item';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
|
||||
case 'edit_item':
|
||||
toggle_item_palette();
|
||||
break;
|
||||
|
@ -1848,6 +1887,7 @@ function click_button_toolbox(id) {
|
|||
activeToolboxButton('label', false);
|
||||
activeToolboxButton('icon', false);
|
||||
activeToolboxButton('service', false);
|
||||
activeToolboxButton('group_item', false);
|
||||
|
||||
activeToolboxButton('edit_item', false);
|
||||
activeToolboxButton('delete_item', false);
|
||||
|
@ -1875,6 +1915,7 @@ function click_button_toolbox(id) {
|
|||
activeToolboxButton('simple_value', true);
|
||||
activeToolboxButton('label', true);
|
||||
activeToolboxButton('icon', true);
|
||||
activeToolboxButton('group_item', true);
|
||||
}
|
||||
break;
|
||||
case 'save_visualmap':
|
||||
|
@ -1917,6 +1958,7 @@ function showPreview(image) {
|
|||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
switch (toolbuttonActive) {
|
||||
case 'group_item':
|
||||
case 'static_graph':
|
||||
showPreviewStaticGraph(image);
|
||||
break;
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 328 B |
Binary file not shown.
After Width: | Height: | Size: 324 B |
|
@ -67,6 +67,7 @@ $server_name = get_parameter('server_name', null);
|
|||
$server_id = (int)get_parameter('server_id', 0);
|
||||
$id_agent = get_parameter('id_agent', null);
|
||||
$id_metaconsole = get_parameter('id_metaconsole', null);
|
||||
$id_group = (int)get_parameter('id_group', 0);
|
||||
|
||||
$get_element_status = get_parameter('get_element_status', 0);
|
||||
$get_image_path_status = get_parameter('get_image_path_status', 0);
|
||||
|
@ -166,9 +167,6 @@ switch ($action) {
|
|||
FROM tagente_estado
|
||||
WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
|
||||
|
||||
//html_debug_print($value_show);
|
||||
//html_debug_print($layoutData);
|
||||
|
||||
if (($layoutData['type'] == PERCENTILE_BAR) ||
|
||||
($layoutData['type'] == PERCENTILE_BUBBLE)) {
|
||||
if ($value_show == 'value') {
|
||||
|
@ -368,6 +366,9 @@ switch ($action) {
|
|||
$values['label_color'] = $label_color;
|
||||
}
|
||||
switch($type) {
|
||||
case 'group_item':
|
||||
$values['id_group'] = $id_group;
|
||||
break;
|
||||
case 'module_graph':
|
||||
if ($height_module_graph !== null) {
|
||||
$values['height'] = $height_module_graph;
|
||||
|
@ -445,6 +446,7 @@ switch ($action) {
|
|||
case 'percentile_bar':
|
||||
case 'percentile_item':
|
||||
case 'static_graph':
|
||||
case 'group_item':
|
||||
case 'module_graph':
|
||||
case 'simple_value':
|
||||
case 'label':
|
||||
|
@ -606,6 +608,13 @@ switch ($action) {
|
|||
$values['width'] = $width;
|
||||
$values['height'] = $height;
|
||||
break;
|
||||
case 'group_item':
|
||||
$values['type'] = GROUP_ITEM;
|
||||
$values['image'] = $image;
|
||||
$values['width'] = $width;
|
||||
$values['height'] = $height;
|
||||
$values['id_group'] = $id_group;
|
||||
breaK;
|
||||
case 'simple_value':
|
||||
//This allows min, max and avg process in a simple value
|
||||
$values['type'] = visual_map_get_simple_value_type($process_simple_value);
|
||||
|
@ -681,7 +690,8 @@ switch ($action) {
|
|||
|
||||
/* visual map element status check */
|
||||
if ($get_element_status) {
|
||||
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
|
||||
$layoutData = db_get_row_filter('tlayout_data',
|
||||
array('id' => $id_element));
|
||||
|
||||
$res = visual_map_get_status_element($layoutData);
|
||||
|
||||
|
|
|
@ -157,13 +157,14 @@ 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_NORMAL_ALERT', 300);
|
||||
define('AGENT_MODULE_STATUS_NOT_NORMAL', 6);
|
||||
define('AGENT_MODULE_STATUS_WARNING', 2);
|
||||
define('AGENT_MODULE_STATUS_WARNING_ALERT', 200);
|
||||
define('AGENT_MODULE_STATUS_UNKNOWN', 3);
|
||||
define('AGENT_MODULE_STATUS_NOT_INIT', 5);
|
||||
|
||||
/* Agent module status */
|
||||
/* Agent status */
|
||||
define('AGENT_STATUS_ALL', -1);
|
||||
define('AGENT_STATUS_CRITICAL', 1);
|
||||
define('AGENT_STATUS_NORMAL', 0);
|
||||
|
@ -174,7 +175,6 @@ define('AGENT_STATUS_ALERT_FIRED', 4);
|
|||
define('AGENT_STATUS_WARNING', 2);
|
||||
|
||||
|
||||
|
||||
/* Visual maps contants */
|
||||
//The items kind
|
||||
define('STATIC_GRAPH', 0);
|
||||
|
@ -188,6 +188,7 @@ define('SIMPLE_VALUE_MIN', 7);
|
|||
define('SIMPLE_VALUE_AVG', 8);
|
||||
define('PERCENTILE_BUBBLE', 9);
|
||||
define('SERVICE', 10); //Enterprise Item.
|
||||
define('GROUP_ITEM', 11);
|
||||
//Some styles
|
||||
define('MIN_WIDTH',300);
|
||||
define('MIN_HEIGHT',120);
|
||||
|
|
|
@ -1498,7 +1498,7 @@ function agents_get_status($id_agent = 0, $noACLs = false) {
|
|||
$all_modules = db_get_all_rows_filter('tagente_modulo',
|
||||
$filter_modules, 'id_agente_modulo');
|
||||
|
||||
$result_modules = array();
|
||||
$result_modules = array();
|
||||
// Skip non init modules
|
||||
foreach ($all_modules as $module) {
|
||||
if (modules_get_agentmodule_is_init($module['id_agente_modulo'])){
|
||||
|
@ -1560,6 +1560,10 @@ function agents_get_status($id_agent = 0, $noACLs = false) {
|
|||
elseif (is_int(array_search(AGENT_MODULE_STATUS_CRITICAL_BAD, $modules_status))) {
|
||||
return AGENT_MODULE_STATUS_CRITICAL_BAD;
|
||||
}
|
||||
// Checking if any module has critical status
|
||||
elseif (is_int(array_search(AGENT_MODULE_STATUS_NORMAL_ALERT, $modules_status))) {
|
||||
return AGENT_STATUS_ALERT_FIRED;
|
||||
}
|
||||
// Checking if any module has warning status
|
||||
elseif (is_int(array_search(AGENT_MODULE_STATUS_WARNING,$modules_status))) {
|
||||
return AGENT_MODULE_STATUS_WARNING;
|
||||
|
|
|
@ -541,32 +541,21 @@ function groups_get_status ($id_group = 0) {
|
|||
}
|
||||
|
||||
// Status is 0 for normal, 1 for critical, 2 for warning and 3/-1 for unknown. 4 for fired alerts
|
||||
|
||||
// Checking if any agent has fired alert (4)
|
||||
if (is_int(array_search(4,$agents_status))) {
|
||||
return 4;
|
||||
if (is_int(array_search(AGENT_STATUS_ALERT_FIRED, $agents_status))) {
|
||||
return AGENT_STATUS_ALERT_FIRED;
|
||||
}
|
||||
// Checking if any agent has critical status (1)
|
||||
elseif (is_int(array_search(1,$agents_status))) {
|
||||
return 1;
|
||||
elseif (is_int(array_search(AGENT_STATUS_CRITICAL, $agents_status))) {
|
||||
return AGENT_STATUS_CRITICAL;
|
||||
}
|
||||
// Checking if any agent has warning status (2)
|
||||
elseif (is_int(array_search(2,$agents_status))) {
|
||||
return 2;
|
||||
elseif (is_int(array_search(AGENT_STATUS_WARNING, $agents_status))) {
|
||||
return AGENT_STATUS_WARNING;
|
||||
}
|
||||
// Checking if any agent has unknown status (-1)
|
||||
elseif (is_int(array_search(-1,$agents_status))) {
|
||||
return -1;
|
||||
}
|
||||
// Checking if any agents module has unknown status (3)
|
||||
elseif (is_int(array_search(3,$agents_status))) {
|
||||
return 3;
|
||||
elseif (is_int(array_search(AGENT_STATUS_UNKNOWN, $agents_status))) {
|
||||
return AGENT_STATUS_UNKNOWN;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return AGENT_STATUS_NORMAL;
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -931,7 +920,7 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) {
|
|||
//of this groups and its children. It was done to print empty fathers of children groups.
|
||||
//We need to recalculate the total agents for this group here to get only the total agents
|
||||
//for this group. Of course the group All (0) is a special case.
|
||||
|
||||
|
||||
if ($id_group != 0) {
|
||||
$data["total_agents"] = db_get_sql ("SELECT COUNT(id_agente)
|
||||
FROM tagente
|
||||
|
|
|
@ -1331,8 +1331,9 @@ function modules_get_agentmodule_status($id_agentmodule = 0, $without_alerts = f
|
|||
$server = db_get_row('tmetaconsole_setup', 'id', $id_server);
|
||||
|
||||
if (metaconsole_connect($server) == NOERR) {
|
||||
$status_row = db_get_row ("tagente_estado", "id_agente_modulo", $id_agentmodule);
|
||||
|
||||
$status_row = db_get_row ("tagente_estado",
|
||||
"id_agente_modulo", $id_agentmodule);
|
||||
|
||||
if (!$without_alerts) {
|
||||
$times_fired = db_get_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule);
|
||||
if ($times_fired > 0) {
|
||||
|
@ -1350,12 +1351,19 @@ function modules_get_agentmodule_status($id_agentmodule = 0, $without_alerts = f
|
|||
metaconsole_restore_db();
|
||||
}
|
||||
else {
|
||||
$status_row = db_get_row ("tagente_estado", "id_agente_modulo", $id_agentmodule);
|
||||
$status_row = db_get_row ("tagente_estado",
|
||||
"id_agente_modulo", $id_agentmodule);
|
||||
|
||||
if (!$without_alerts) {
|
||||
$times_fired = db_get_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule);
|
||||
$times_fired = db_get_value ('SUM(times_fired)',
|
||||
'talert_template_modules', 'id_agent_module', $id_agentmodule);
|
||||
|
||||
if ($times_fired > 0) {
|
||||
|
||||
switch($status_row['estado']) {
|
||||
case AGENT_STATUS_NORMAL:
|
||||
return AGENT_MODULE_STATUS_NORMAL_ALERT;
|
||||
break;
|
||||
case AGENT_STATUS_WARNING:
|
||||
return AGENT_MODULE_STATUS_WARNING_ALERT; // Alert fired in warning
|
||||
break;
|
||||
|
|
|
@ -275,7 +275,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
|
|||
if ($agents === false)
|
||||
//return false;
|
||||
$agents = array();
|
||||
|
||||
|
||||
// Open Graph
|
||||
$graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom, $ranksep, $font_size);
|
||||
|
||||
|
|
|
@ -122,6 +122,31 @@ function visual_map_print_item($layoutData) {
|
|||
echo "</div>";
|
||||
break;
|
||||
|
||||
case GROUP_ITEM:
|
||||
if ($layoutData['image'] != null) {
|
||||
$img = visual_map_get_image_status_element($layoutData);
|
||||
if (substr($img,0,1) == '4') {
|
||||
$borderStyle ='border: 2px solid #ffa300;';
|
||||
$img = substr_replace($img, '', 0,1);
|
||||
}
|
||||
}
|
||||
|
||||
if (($width != 0) && ($height != 0)) {
|
||||
$sizeStyle = 'width: ' . $width . 'px; height: ' . $height . 'px;';
|
||||
$imageSize = 'width="' . $width . '" height="' . $height . '"';
|
||||
}
|
||||
echo '<div id="' . $id . '" class="item group_item" style="z-index: 1; text-align: center; color: ' . $color . '; position: absolute; display: inline-block; ' . $sizeStyle . ' top: ' . $top . 'px; left: ' . $left . 'px;">';
|
||||
if ($layoutData['image'] != null) {
|
||||
if (($width != 0) && ($height != 0))
|
||||
echo html_print_image($img, true, array("class" => "image", "id" => "image_" . $id, "width" => "$width", "height" => "$height", "style" => $borderStyle));
|
||||
else
|
||||
echo html_print_image($img, true, array("class" => "image", "id" => "image_" . $id, "style" => $borderStyle));
|
||||
echo '<br />';
|
||||
}
|
||||
echo io_safe_output($text);
|
||||
echo "</div>";
|
||||
break;
|
||||
|
||||
case PERCENTILE_BAR:
|
||||
case PERCENTILE_BUBBLE:
|
||||
//Metaconsole db connection
|
||||
|
@ -868,6 +893,29 @@ function visual_map_get_status_element($layoutData) {
|
|||
}
|
||||
break;
|
||||
|
||||
case GROUP_ITEM:
|
||||
$group_status = groups_get_status($layoutData['id_group']);
|
||||
|
||||
switch ($group_status) {
|
||||
case AGENT_STATUS_ALERT_FIRED:
|
||||
return VISUAL_MAP_STATUS_CRITICAL_ALERT;
|
||||
break;
|
||||
case AGENT_STATUS_CRITICAL:
|
||||
return VISUAL_MAP_STATUS_CRITICAL_BAD;
|
||||
break;
|
||||
case AGENT_STATUS_WARNING:
|
||||
return VISUAL_MAP_STATUS_WARNING;
|
||||
break;
|
||||
case AGENT_STATUS_UNKNOWN:
|
||||
return VISUAL_MAP_STATUS_UNKNOWN;
|
||||
break;
|
||||
case AGENT_STATUS_NORMAL:
|
||||
default:
|
||||
return VISUAL_MAP_STATUS_NORMAL;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
//If it's a graph, a progress bar or a data tag, ALWAYS report status OK
|
||||
//(=0) to avoid confussions here.
|
||||
|
@ -884,7 +932,7 @@ function visual_map_get_status_element($layoutData) {
|
|||
case AGENT_MODULE_STATUS_WARNING_ALERT:
|
||||
$status = VISUAL_MAP_STATUS_WARNING_ALERT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
@ -1066,6 +1114,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
|
|||
}
|
||||
|
||||
switch ($layout_data['type']) {
|
||||
case GROUP_ITEM:
|
||||
case STATIC_GRAPH:
|
||||
if ($status == VISUAL_MAP_STATUS_CRITICAL_BAD)
|
||||
$z_index = 3;
|
||||
|
|
|
@ -75,47 +75,56 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||
<?php
|
||||
$form_items = array();
|
||||
|
||||
/*
|
||||
$form_items['label_row'] = array();
|
||||
$form_items['label_row']['items'] = array();
|
||||
$form_items['label_row']['html'] = '<td align="left" style="">' . __('Label') .'</td>
|
||||
<td align="left" style="">'. html_print_input_text ('label', '', '', 20, 200, true) .'</td>';
|
||||
*/
|
||||
|
||||
$form_items['label_row'] = array();
|
||||
$form_items['label_row']['items'] = array('label', 'static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'datos', 'icon');
|
||||
$form_items['label_row']['items'] = array('label',
|
||||
'static_graph',
|
||||
'percentile_bar',
|
||||
'percentile_item',
|
||||
'module_graph',
|
||||
'simple_value',
|
||||
'datos',
|
||||
'icon',
|
||||
'group_item');
|
||||
$form_items['label_row']['html'] = '<td align="left" valign="top" style="">' . __('Label') .'</td>
|
||||
<td align="left" style="">'. html_print_input_text ('label', '', '', 20, 200, true) .'</td>';
|
||||
|
||||
|
||||
$form_items['image_row'] = array();
|
||||
$form_items['image_row']['items'] = array('static_graph', 'icon', 'datos');
|
||||
$form_items['image_row']['items'] = array('static_graph',
|
||||
'icon',
|
||||
'datos',
|
||||
'group_item');
|
||||
$form_items['image_row']['html'] = '<td align="left">' . __('Image') . '</td>
|
||||
<td align="left">'. html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', '', true) .'</td>';
|
||||
|
||||
|
||||
$form_items['enable_link_row'] = array();
|
||||
$form_items['enable_link_row']['items'] = array('static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'datos', 'icon');
|
||||
$form_items['enable_link_row']['items'] = array(
|
||||
'static_graph',
|
||||
'percentile_bar',
|
||||
'percentile_item',
|
||||
'module_graph',
|
||||
'simple_value',
|
||||
'datos',
|
||||
'icon',
|
||||
'group_item');
|
||||
$form_items['enable_link_row']['html'] = '<td align="left" style="">' . __('Enable link') .'</td>
|
||||
<td align="left" style="">'. html_print_checkbox('enable_link', '', 'enable_link', true) .'</td>';
|
||||
|
||||
|
||||
$form_items['preview_row'] = array();
|
||||
$form_items['preview_row']['items'] = array('static_graph', 'datos icon');
|
||||
$form_items['preview_row']['items'] = array('static_graph',
|
||||
'datos icon',
|
||||
'group_item');
|
||||
$form_items['preview_row']['html'] = '<td align="left" colspan="2" style="text-align: right;"><div id="preview" style="text-align: right;"></div></td>';
|
||||
|
||||
|
||||
$form_items['agent_row'] = array();
|
||||
$form_items['agent_row']['items'] = array('static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'datos');
|
||||
$form_items['agent_row']['html'] = '<td align="left">' . __('Agent') . '</td>';
|
||||
|
||||
|
||||
|
||||
$params = array();
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
|
@ -143,13 +152,28 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||
'</td>';
|
||||
|
||||
|
||||
|
||||
$form_items['module_row'] = array();
|
||||
$form_items['module_row']['items'] = array('static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'datos');
|
||||
$form_items['module_row']['html'] = '<td align="left">' . __('Module') . '</td>
|
||||
<td align="left">'. html_print_select (array(), 'module', '', '', __('Any'), 0, true) . '</td>';
|
||||
<td align="left">' . html_print_select (array(), 'module', '', '', __('Any'), 0, true) . '</td>';
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "PM"))
|
||||
$return_all_group = false;
|
||||
else
|
||||
$return_all_group = true;
|
||||
$form_items['group_row'] = array();
|
||||
$form_items['group_row']['items'] = array('group_item');
|
||||
$form_items['group_row']['html'] = '<td align="left">' .
|
||||
__('Group') .
|
||||
'</td>
|
||||
<td align="left">' .
|
||||
html_print_select_groups(false, "AR",
|
||||
$return_all_group, 'group', '', '', '', 0,
|
||||
true) .
|
||||
'</td>';
|
||||
|
||||
|
||||
$form_items['process_value_row'] = array();
|
||||
|
@ -359,6 +383,7 @@ function visual_map_editor_print_toolbox() {
|
|||
visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true);
|
||||
visual_map_print_button_editor('label', __('Label'), 'left', false, 'label_min', true);
|
||||
visual_map_print_button_editor('icon', __('Icon'), 'left', false, 'icon_min', true);
|
||||
visual_map_print_button_editor('group_item', __('Group'), 'left', false, 'group_item_min', true);
|
||||
|
||||
enterprise_hook("enterprise_visual_map_editor_print_toolbox");
|
||||
|
||||
|
|
|
@ -1001,6 +1001,13 @@ input.service_min[disabled] {
|
|||
background: #fefefe url(../../images/box.disabled.png) no-repeat center !important;
|
||||
}
|
||||
|
||||
input.group_item_min {
|
||||
background: #fefefe url(../../images/group_green.png) no-repeat center !important;
|
||||
}
|
||||
input.group_item_min[disabled] {
|
||||
background: #fefefe url(../../images/group_green.disabled.png) no-repeat center !important;
|
||||
}
|
||||
|
||||
div#cont {
|
||||
position: fixed;
|
||||
max-height: 320px;
|
||||
|
|
|
@ -1211,7 +1211,8 @@ CREATE TABLE tlayout_data (
|
|||
label_color varchar(20) DEFAULT '',
|
||||
no_link_color NUMBER(5, 0) default 0 NOT NULL,
|
||||
enable_link NUMBER(5, 0) default 1 NOT NULL,
|
||||
id_metaconsole NUMBER(10, 0) default 0 NOT NULL
|
||||
id_metaconsole NUMBER(10, 0) default 0 NOT NULL,
|
||||
id_group NUMBER(10, 0) default 0 NOT NULL
|
||||
);
|
||||
CREATE SEQUENCE tlayout_data_s INCREMENT BY 1 START WITH 1;
|
||||
CREATE OR REPLACE TRIGGER tlayout_data_inc BEFORE INSERT ON tlayout_data REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tlayout_data_s.nextval INTO :NEW.ID FROM dual; END tlayout_data_inc;;
|
||||
|
|
|
@ -1062,7 +1062,8 @@ CREATE TABLE "tlayout_data" (
|
|||
"label_color" varchar(20) DEFAULT '',
|
||||
"no_link_color" SMALLINT NOT NULL default 0,
|
||||
"enable_link" SMALLINT NOT NULL default 1,
|
||||
"id_metaconsole" INTEGER NOT NULL default 0
|
||||
"id_metaconsole" INTEGER NOT NULL default 0,
|
||||
"id_group" INTEGER NOT NULL default 0
|
||||
);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
|
|
@ -1151,6 +1151,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_data` (
|
|||
`no_link_color` tinyint(1) UNSIGNED NOT NULL default 0,
|
||||
`enable_link` tinyint(1) UNSIGNED NOT NULL default 1,
|
||||
`id_metaconsole` int(10) NOT NULL default 0,
|
||||
`id_group` INTEGER UNSIGNED NOT NULL default 0,
|
||||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
Loading…
Reference in New Issue