diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1b86c420cf..41b9994c0b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,18 @@ +2014-03-14 Vanessa Gil + + * pandoradb.data.oracle.sql + pandoradb.data.postgreSQL.sql + pandoradb.sql + pandoradb_data.sql + extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql + extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql + extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql + godmode/reporting/graph_builder.graph_editor.php + godmode/setup/setup_visuals.php + include/functions_config.php + include/functions_graph.php: Changed weight and colors in + combine graphs. + 2014-03-13 Sergio Martin * include/functions_visual_map.php diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql index 2babc469f7..e1ffebd3aa 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql @@ -16,3 +16,23 @@ ALTER TABLE `talert_actions` ADD COLUMN `field7_recovery` text NOT NULL; ALTER TABLE `talert_actions` ADD COLUMN `field8_recovery` text NOT NULL; ALTER TABLE `talert_actions` ADD COLUMN `field9_recovery` text NOT NULL; ALTER TABLE `talert_actions` ADD COLUMN `field10_recovery` text NOT NULL; + +-- --------------------------------------------------------------------- +-- Table `tconfig` +-- --------------------------------------------------------------------- +INSERT INTO `tconfig` (`token`, `value`) VALUES +('graph_color4', '#FF66CC'), +('graph_color5', '#CC0000'), +('graph_color6', '#0033FF'), +('graph_color7', '#99FF99'), +('graph_color8', '#330066'), +('graph_color9', '#66FFFF'), +('graph_color10', '#6666FF'); + +UPDATE tconfig SET `value`='#FFFF00' WHERE `token`='graph_color2'; +UPDATE tconfig SET `value`='#FF6600' WHERE `token`='graph_color3'; + +-- --------------------------------------------------------------------- +-- Table `tconfig` +-- --------------------------------------------------------------------- +ALTER TABLE tgraph_source MODIFY COLUMN `weight` float(8,3) NOT NULL DEFAULT 0; diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql index 50872c51ee..e46ffee381 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql @@ -16,3 +16,17 @@ ALTER TABLE talert_actions ADD (field7_recovery CLOB default '' NULL); ALTER TABLE talert_actions ADD (field8_recovery CLOB default '' NULL); ALTER TABLE talert_actions ADD (field9_recovery CLOB default '' NULL); ALTER TABLE talert_actions ADD (field10_recovery CLOB default '' NULL); + +-- --------------------------------------------------------------------- +-- Table `tconfig` +-- --------------------------------------------------------------------- +INSERT INTO tconfig (token, value) VALUES ('graph_color4', '#FF66CC'); +INSERT INTO tconfig (token, value) VALUES ('graph_color5', '#CC0000'); +INSERT INTO tconfig (token, value) VALUES ('graph_color6', '#0033FF'); +INSERT INTO tconfig (token, value) VALUES ('graph_color7', '#99FF99'); +INSERT INTO tconfig (token, value) VALUES ('graph_color8', '#330066'); +INSERT INTO tconfig (token, value) VALUES ('graph_color9', '#66FFFF'); +INSERT INTO tconfig (token, value) VALUES ('graph_color10', '#6666FF'); + +UPDATE tconfig SET value='#FFFF00' WHERE token='graph_color2'; +UPDATE tconfig SET value='#FF6600' WHERE token='graph_color3'; diff --git a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql index ba3e9bf6a5..9aa2d77a05 100644 --- a/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql @@ -16,3 +16,18 @@ ALTER TABLE "talert_actions" ADD COLUMN "field7_recovery" text NULL default ''; ALTER TABLE "talert_actions" ADD COLUMN "field8_recovery" text NULL default ''; ALTER TABLE "talert_actions" ADD COLUMN "field9_recovery" text NULL default ''; ALTER TABLE "talert_actions" ADD COLUMN "field10_recovery" text NULL default ''; + +-- --------------------------------------------------------------------- +-- Table "tconfig" +-- --------------------------------------------------------------------- +INSERT INTO "tconfig" ("token", "value") VALUES +('graph_color4', '#FF66CC'), +('graph_color5', '#CC0000'), +('graph_color6', '#0033FF'), +('graph_color7', '#99FF99'), +('graph_color8', '#330066'), +('graph_color9', '#66FFFF'), +('graph_color10', '#6666FF'); + +UPDATE "tconfig" SET "value"='#FFFF00' WHERE "token"='graph_color2'; +UPDATE "tconfig" SET "value"='#FF6600' WHERE "token"='graph_color3'; diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index 8965ee70bb..0968e6b163 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -98,11 +98,12 @@ if(count($module_array) > 0){ echo modules_get_agentmodule_name ($module_array[$a]).""; echo ""; echo ""; - $new_weight = $weight_array[$a]-0.125; - echo ""; - echo ""; - $new_weight = $weight_array[$a]+0.125; - echo ""; + + echo ""; + html_print_input_text ('weight', $weight_array[$a], '', 20, 10, false, false); + html_print_submit_button ('Ok', 'btn', false, '', false); + echo ""; + echo "
".html_print_image('images/down.png', true, array ('title' => __('Decrease Weight')))."$weight_array[$a]".html_print_image('images/up.png', true, array ('title' => __('Increase Weight')))."
"; echo ""; echo ""; diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 818c4ec0e9..8dce340579 100644 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -82,6 +82,41 @@ $table->data[$row][1] = html_print_input_text ('graph_color3', $config["graph_co $row++; +$table->data[$row][0] = __('Graph color #4'); +$table->data[$row][1] = html_print_input_text ('graph_color4', $config["graph_color4"], '', 8, 8, true); + +$row++; + +$table->data[$row][0] = __('Graph color #5'); +$table->data[$row][1] = html_print_input_text ('graph_color5', $config["graph_color5"], '', 8, 8, true); + +$row++; + +$table->data[$row][0] = __('Graph color #6'); +$table->data[$row][1] = html_print_input_text ('graph_color6', $config["graph_color6"], '', 8, 8, true); + +$row++; + +$table->data[$row][0] = __('Graph color #7'); +$table->data[$row][1] = html_print_input_text ('graph_color7', $config["graph_color7"], '', 8, 8, true); + +$row++; + +$table->data[$row][0] = __('Graph color #8'); +$table->data[$row][1] = html_print_input_text ('graph_color8', $config["graph_color8"], '', 8, 8, true); + +$row++; + +$table->data[$row][0] = __('Graph color #9'); +$table->data[$row][1] = html_print_input_text ('graph_color9', $config["graph_color9"], '', 8, 8, true); + +$row++; + +$table->data[$row][0] = __('Graph color #10'); +$table->data[$row][1] = html_print_input_text ('graph_color10', $config["graph_color10"], '', 8, 8, true); + +$row++; + $table->data[$row][0] = __('Graphic resolution (1-low, 5-high)'); $table->data[$row][1] = html_print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true); @@ -284,6 +319,13 @@ $(document).ready (function () { $("#form_setup #text-graph_color1").attachColorPicker(); $("#form_setup #text-graph_color2").attachColorPicker(); $("#form_setup #text-graph_color3").attachColorPicker(); + $("#form_setup #text-graph_color4").attachColorPicker(); + $("#form_setup #text-graph_color5").attachColorPicker(); + $("#form_setup #text-graph_color6").attachColorPicker(); + $("#form_setup #text-graph_color7").attachColorPicker(); + $("#form_setup #text-graph_color8").attachColorPicker(); + $("#form_setup #text-graph_color9").attachColorPicker(); + $("#form_setup #text-graph_color10").attachColorPicker(); $("#button-interval_del_btn").click( function() { var interval_selected = $('#intervals option:selected').val(); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 1f733e7a6e..cfc70b8e9f 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -367,6 +367,20 @@ function config_update_config () { $error_update[] = __('Graph color (avg)'); if (!config_update_value ('graph_color3', (string) get_parameter ('graph_color3'))) $error_update[] = __('Graph color (max)'); + if (!config_update_value ('graph_color4', (string) get_parameter ('graph_color4'))) + $error_update[] = __('Graph color #4'); + if (!config_update_value ('graph_color5', (string) get_parameter ('graph_color5'))) + $error_update[] = __('Graph color #5'); + if (!config_update_value ('graph_color6', (string) get_parameter ('graph_color6'))) + $error_update[] = __('Graph color #6'); + if (!config_update_value ('graph_color7', (string) get_parameter ('graph_color7'))) + $error_update[] = __('Graph color #7'); + if (!config_update_value ('graph_color8', (string) get_parameter ('graph_color8'))) + $error_update[] = __('Graph color #8'); + if (!config_update_value ('graph_color9', (string) get_parameter ('graph_color9'))) + $error_update[] = __('Graph color #9'); + if (!config_update_value ('graph_color10', (string) get_parameter ('graph_color10'))) + $error_update[] = __('Graph color #10'); if (!config_update_value ('graph_res', (int) get_parameter ('graph_res'))) $error_update[] = __('Graphic resolution (1-low, 5-high)'); $style = (string) get_parameter ('style'); diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 175841e38e..9b9f905a71 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1237,14 +1237,13 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ $color[0] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50); $color[1] = array('border' => '#000000', 'color' => $config['graph_color2'], 'alpha' => 50); $color[2] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50); - $color[3] = array('border' => '#000000', 'color' => COL_GRAPH1, 'alpha' => 50); - $color[4] = array('border' => '#000000', 'color' => COL_GRAPH2, 'alpha' => 50); - $color[5] = array('border' => '#000000', 'color' => COL_GRAPH3, 'alpha' => 50); - $color[6] = array('border' => '#000000', 'color' => COL_GRAPH4, 'alpha' => 50); - $color[7] = array('border' => '#000000', 'color' => COL_GRAPH5, 'alpha' => 50); - $color[8] = array('border' => '#000000', 'color' => COL_GRAPH6, 'alpha' => 50); - $color[9] = array('border' => '#000000', 'color' => COL_GRAPH7, 'alpha' => 50); - $color[10] = array('border' => '#000000', 'color' => COL_GRAPH8, 'alpha' => 50); + $color[3] = array('border' => '#000000', 'color' => $config['graph_color4'], 'alpha' => 50); + $color[4] = array('border' => '#000000', 'color' => $config['graph_color5'], 'alpha' => 50); + $color[5] = array('border' => '#000000', 'color' => $config['graph_color6'], 'alpha' => 50); + $color[6] = array('border' => '#000000', 'color' => $config['graph_color7'], 'alpha' => 50); + $color[7] = array('border' => '#000000', 'color' => $config['graph_color8'], 'alpha' => 50); + $color[8] = array('border' => '#000000', 'color' => $config['graph_color9'], 'alpha' => 50); + $color[9] = array('border' => '#000000', 'color' => $config['graph_color10'], 'alpha' => 50); $color[11] = array('border' => '#000000', 'color' => COL_GRAPH9, 'alpha' => 50); $color[12] = array('border' => '#000000', 'color' => COL_GRAPH10, 'alpha' => 50); $color[13] = array('border' => '#000000', 'color' => COL_GRAPH11, 'alpha' => 50); diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 718b1ff29f..458dececd8 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -60,8 +60,15 @@ INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1'); INSERT INTO tconfig (token, value) VALUES ('style','pandora'); INSERT INTO tconfig (token, value) VALUES ('remote_config', '/var/spool/pandora/data_in'); INSERT INTO tconfig (token, value) VALUES ('graph_color1', '#38B800'); -INSERT INTO tconfig (token, value) VALUES ('graph_color2', '#42D100'); -INSERT INTO tconfig (token, value) VALUES ('graph_color3', '#89FF09'); +INSERT INTO tconfig (token, value) VALUES ('graph_color2', '#FFFF00'); +INSERT INTO tconfig (token, value) VALUES ('graph_color3', '#FF6600'); +INSERT INTO tconfig (token, value) VALUES ('graph_color4', '#FF66CC'); +INSERT INTO tconfig (token, value) VALUES ('graph_color5', '#CC0000'); +INSERT INTO tconfig (token, value) VALUES ('graph_color6', '#0033FF'); +INSERT INTO tconfig (token, value) VALUES ('graph_color7', '#99FF99'); +INSERT INTO tconfig (token, value) VALUES ('graph_color8', '#330066'); +INSERT INTO tconfig (token, value) VALUES ('graph_color9', '#66FFFF'); +INSERT INTO tconfig (token, value) VALUES ('graph_color10', '#6666FF'); INSERT INTO tconfig (token, value) VALUES ('sla_period', '604800'); INSERT INTO tconfig (token, value) VALUES ('trap2agent', '0'); INSERT INTO tconfig (token, value) VALUES ('date_format', 'F j, Y, g:i a'); diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index 47072084ff..0e3053f90f 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -56,8 +56,15 @@ INSERT INTO "tconfig" ("token", "value") VALUES ('style','pandora'), ('remote_config', '/var/spool/pandora/data_in'), ('graph_color1', '#38B800'), -('graph_color2', '#42D100'), -('graph_color3', '#89FF09'), +('graph_color2', '#FFFF00'), +('graph_color3', '#FF6600'), +('graph_color4', '#FF66CC'), +('graph_color5', '#CC0000'), +('graph_color6', '#0033FF'), +('graph_color7', '#99FF99'), +('graph_color8', '#330066'), +('graph_color9', '#66FFFF'), +('graph_color10', '#6666FF'), ('sla_period', '604800'), ('trap2agent', '0'), ('date_format', 'F j, Y, g:i a'), diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index e3846f6033..0ae27639ae 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -978,7 +978,7 @@ CREATE TABLE IF NOT EXISTS `tgraph_source` ( `id_gs` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `id_graph` int(11) NOT NULL default 0, `id_agent_module` int(11) NOT NULL default 0, - `weight` float(5,3) NOT NULL DEFAULT 0, + `weight` float(8,3) NOT NULL DEFAULT 0, PRIMARY KEY(`id_gs`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 127d409c5b..a2d104cda0 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -43,8 +43,15 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('style','pandora'), ('remote_config', '/var/spool/pandora/data_in'), ('graph_color1', '#38B800'), -('graph_color2', '#42D100'), -('graph_color3', '#89FF09'), +('graph_color2', '#FFFF00'), +('graph_color3', '#FF6600'), +('graph_color4', '#FF66CC'), +('graph_color5', '#CC0000'), +('graph_color6', '#0033FF'), +('graph_color7', '#99FF99'), +('graph_color8', '#330066'), +('graph_color9', '#66FFFF'), +('graph_color10', '#6666FF'), ('sla_period', '604800'), ('trap2agent', '0'), ('date_format', 'F j, Y, g:i a'),