diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index d5791dcc76..b74e8c1560 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.726-180827 +Version: 7.0NG.726-180904 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 9a55654585..43ea3a400c 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.726-180827" +pandora_version="7.0NG.726-180904" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 6b57ec6f3b..44678d3fbd 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.726'; -use constant AGENT_BUILD => '180827'; +use constant AGENT_BUILD => '180904'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 008a191ebd..365c4932c2 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.726 -%define release 180827 +%define release 180904 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 014dfae1ec..397a11f66b 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.726 -%define release 180827 +%define release 180904 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index ec0aa622c6..3dd4fb013a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.726" -PI_BUILD="180827" +PI_BUILD="180904" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 1282a16065..e2740e3c84 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180827} +{180904} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7d9168dd91..f031c55ee5 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.726(Build 180827)") +#define PANDORA_VERSION ("7.0NG.726(Build 180904)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 9314b885e0..2d5195b07b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.726(Build 180827))" + VALUE "ProductVersion", "(7.0NG.726(Build 180904))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7d885222b8..697348b76a 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.726-180827 +Version: 7.0NG.726-180904 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index a3116668b9..2a4605f103 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.726-180827" +pandora_version="7.0NG.726-180904" package_pear=0 package_pandora=1 diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index b8b7481786..6947bfcc3a 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -77,15 +77,6 @@ $isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) $config["relative_path"] = enterprise_hook('skins_set_image_skin_path',array($config['id_user'])); -// Load user language -$user_language = get_user_language ($config['id_user']); - -$l10n = NULL; -if (file_exists ('./include/languages/'.$user_language.'.mo')) { - $l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$user_language.'.mo')); - $l10n->load_tables(); -} - if (isset($config['metaconsole'])) { // Not cool way of know if we are executing from metaconsole or normal console if ($config['metaconsole']) diff --git a/pandora_console/extras/mr/20.sql b/pandora_console/extras/mr/20.sql index b17abe229f..94e55dcf83 100644 --- a/pandora_console/extras/mr/20.sql +++ b/pandora_console/extras/mr/20.sql @@ -1,5 +1,13 @@ START TRANSACTION; +ALTER TABLE treport_content ADD COLUMN `recursion` TINYINT(1) default NULL; + +ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL; +ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL; +ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL; + +ALTER TABLE tagente_modulo ALTER COLUMN `parent_module_id` SET default 0; + -- Changes for the 'service like status' feature (Carrefour) ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_type` ENUM ('default', 'weight', 'service') DEFAULT 'default'; ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_warning` FLOAT(20, 3) NOT NULL default 0; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 2e6457c3f0..88478f5c9b 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1213,6 +1213,9 @@ UPDATE `tlink` SET `link` = 'https://github.com/pandorafms/pandorafms/issues' WH -- --------------------------------------------------------------------- ALTER TABLE tevent_filter ADD COLUMN `date_from` date DEFAULT NULL; ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL; +ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL; +ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL; +ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL; -- --------------------------------------------------------------------- -- Table `tusuario` -- --------------------------------------------------------------------- @@ -1228,7 +1231,7 @@ ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL defa -- --------------------------------------------------------------------- ALTER TABLE tagente_modulo ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; -ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL; +ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL default 0; ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL default 0; -- --------------------------------------------------------------------- @@ -1337,6 +1340,7 @@ ALTER TABLE treport_content ADD COLUMN `lapse_calc` tinyint(1) default '0'; ALTER TABLE treport_content ADD COLUMN `lapse` int(11) default '300'; ALTER TABLE treport_content ADD COLUMN `visual_format` tinyint(1) default '0'; ALTER TABLE treport_content ADD COLUMN `hide_no_data` tinyint(1) default '0'; +ALTER TABLE treport_content ADD COLUMN `recursion` tinyint(1) default NULL; -- --------------------------------------------------------------------- -- Table `tmodule_relationship` diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 8224d4f7a1..0196fb9393 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -603,7 +603,7 @@ else { } echo clippy_context_help("modules_not_learning_mode"); echo "</span>"; -echo '</div></form>'; + if ($id_agente) { echo '<div class="action-buttons" style="width: ' . $table->width . '">'; diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index 851e5b5e58..f83d19e14d 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -65,6 +65,9 @@ if ($id) { $group_rep = $filter['group_rep']; $date_from = str_replace("-","/",$filter['date_from']); $date_to = str_replace("-","/",$filter['date_to']); + $source = $filter['source']; + $id_extra = $filter['id_extra']; + $user_comment = $filter['user_comment']; $tag_with_json = $filter['tag_with']; $tag_with_json_clean = io_safe_output($tag_with_json); @@ -130,6 +133,9 @@ if ($update || $create) { $group_rep = get_parameter('group_rep', ''); $date_from = get_parameter('date_from', ''); $date_to = get_parameter('date_to', ''); + $source = get_parameter('source'); + $id_extra = get_parameter('id_extra'); + $user_comment = get_parameter('user_comment'); $tag_with_base64 = get_parameter('tag_with', json_encode(array())); $tag_with_json = io_safe_input(base64_decode($tag_with_base64)); @@ -158,6 +164,9 @@ if ($update || $create) { 'tag_without' => $tag_without_json, 'date_from' => $date_from, 'date_to' => $date_to, + 'source' => $source, + 'id_extra' => $id_extra, + 'user_comment' => $user_comment, 'filter_only_alert' => $filter_only_alert); } @@ -390,6 +399,16 @@ if (!is_metaconsole()) { $text_module, false, true, '', array(), true, $id_agent_module); } +$sources = events_get_all_source(); +$table ->data[22][0] = '<b>' . __('Source') . '</b>'; +$table ->data[22][1] = html_print_select ($sources, 'source', $source, '', '', '', true); + +$table ->data[23][0] = '<b>' . __('Extra ID') . '</b>'; +$table ->data[23][1] = html_print_input_text ('id_extra', $id_extra, '', 11, 255, true); + +$table ->data[24][0] = '<b>' . __('Comment') . '</b>'; +$table ->data[24][1] = html_print_input_text ('user_comment', $user_comment, '', 35, 255, true); + echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=edit_filter&pure='.$config['pure'].'">'; html_print_table ($table); diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index c2ebad004d..9a2f5f3018 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -426,9 +426,12 @@ switch ($action) { $description = $item['description']; $period = $item['period']; $group = $item['id_group']; + $recursion = $item['recursion']; break; case 'event_report_agent': case 'event_report_group': + $recursion = $item['recursion']; + break; case 'event_report_module': $description = $item['description']; $period = $item['period']; @@ -477,12 +480,14 @@ switch ($action) { case 'group_report': $description = $item['description']; $group = $item['id_group']; + $recursion = $item['recursion']; break; case 'network_interfaces_report': $description = $item['description']; $group = $item['id_group']; $period = $item['period']; $fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0; + $recursion = $item['recursion']; break; case 'top_n': $description = $item['description']; @@ -521,6 +526,7 @@ switch ($action) { $es = json_decode($item['external_source'], true); $id_agents = $es['id_agents']; $selection_a_m = get_parameter('selection'); + $recursion = $item['recursion']; if ((count($es['module']) == 1) && ($es['module'][0] == 0)) { $module = ""; @@ -538,6 +544,7 @@ switch ($action) { $date = $es['date']; $inventory_modules = $es['inventory_modules']; $id_agents = $es['id_agents']; + $recursion = $item['recursion']; $idAgent = $es['id_agents']; $idAgentModule = $inventory_modules; @@ -549,6 +556,7 @@ switch ($action) { $es = json_decode($item['external_source'], true); $inventory_modules = $es['inventory_modules']; $id_agents = $es['id_agents']; + $recursion = $item['recursion']; break; case 'agent_configuration': @@ -557,6 +565,7 @@ switch ($action) { case 'group_configuration': $group = $item['id_group']; + $recursion = $item['recursion']; break; case 'netflow_area': @@ -609,6 +618,7 @@ switch ($action) { break; } + $urlForm = $config['homeurl'] . 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport; @@ -914,7 +924,7 @@ You can of course remove the warnings, that's why we include the source and do n html_print_select_groups($config['id_user'], "RM", true, 'combo_group', $group, ''); - echo " ".__('Recursion').html_print_checkbox('recursion', 1, 0, true); + echo " ".__('Recursion').html_print_checkbox('recursion', 1, $recursion, true); ?> </td> @@ -1760,6 +1770,9 @@ function print_SLA_list($width, $action, $idItem = null) { $itemsSLA = db_get_all_rows_filter( 'treport_content_sla_combined', array('id_report_content' => $idItem)); + + + if ($itemsSLA === false) { $itemsSLA = array(); } @@ -1971,6 +1984,9 @@ function print_General_list($width, $action, $idItem = null, $type = 'general') $itemsGeneral = db_get_all_rows_filter( 'treport_content_item', array('id_report_content' => $idItem)); + + + if ($itemsGeneral === false) { $itemsGeneral = array(); } diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index a9e955a04e..067b756908 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -940,17 +940,22 @@ switch ($action) { $report = db_get_row_filter('treport', array('id_report' => $idReport)); + + + $reportName = $report['name']; $idGroupReport = $report['id_group']; $description = $report['description']; $good_format = false; switch ($action) { case 'update': + $values = array(); - $values['id_report'] = $idReport; + $values['id_report'] = $idReport; //--------------------------------------------------- //$values['name'] = (string) get_parameter('name'); $values['description'] = get_parameter('description'); $values['type'] = get_parameter('type', null); + $values['recursion'] = get_parameter('recursion', null); $label = get_parameter('label', ''); //Add macros name @@ -1290,6 +1295,7 @@ switch ($action) { } break; case 'save': + $values = array(); $values['id_report'] = $idReport; $values['type'] = get_parameter('type', null); @@ -1303,6 +1309,7 @@ switch ($action) { $items_label['id_agent'] = get_parameter('id_agent'); $items_label['id_agent_module'] = get_parameter('id_agent_module'); $name_it = (string) get_parameter('name'); + $values['recursion'] = get_parameter('recursion', null); $values['name'] = reporting_label_macro($items_label, $name_it); // Support for projection graph, prediction date and SLA reports diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 9137957de5..cdde53af9f 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1583,8 +1583,28 @@ function loadFieldsFromDB(item) { $("select[name=clock_animation]").val(val); if (key == 'time_format') $("select[name=time_format]").val(val); - if (key == 'timezone') - $("select[name=timezone]").val(val); + if (key == 'timezone') { + var zone = val.split("/"); + $("select[name=zone]").val(zone[0]); + + $.ajax({ + type: "POST", + url: "ajax.php", + data: "page=godmode/setup/setup&select_timezone=1&zone=" + zone[0], + dataType: "json", + success: function(data) { + $("#timezone").empty(); + jQuery.each (data, function (id, value) { + timezone = value; + var timezone_country = timezone.replace (/^.*\//g, ""); + $("select[name='timezone']").append($("<option>").val(timezone).html(timezone_country)); + if (timezone == val) { + $("select[name='timezone']").val(timezone); + } + }); + } + }); + } if (key == 'value_show') { $("select[name=value_show]").val(val); diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index bdca26e56d..88b2392e14 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -686,8 +686,8 @@ $table_chars->data[$row][1] = html_print_select($options_full_escale, 'full_scal $row++; -$table_chars->data[$row][0] = __('Soft graphs:'); -$table_chars->data[$row][0] .= ui_print_help_tip(__('This option may cause performance issues'), true); +$table_chars->data[$row][0] = __('Show only average'); +$table_chars->data[$row][0] .= ui_print_help_tip(__('If enabled, the module graphs will only show the average value, otherwise it will show three sets of data showing maximums, averages and minimums.'), true); $options_soft_graphs = array(); $options_soft_graphs[0] = __('Standard mode'); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 4bb649d571..6ac53b997a 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC180827'; +$build_version = 'PC180904'; $pandora_version = 'v7.0NG.726'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 0d496bf9c4..f6b6da21cc 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1529,7 +1529,31 @@ function events_get_all_status ($report = false) { } return $fields; -} +} + +/** + * Return all event source. + * + * @return array event source array. + */ +function events_get_all_source () { + $event_table = events_get_events_table(is_metaconsole(),false); + $fields = array (); + $fields[''] = __('All'); + + if (users_is_admin()) { + $sources = db_get_all_rows_sql("SELECT DISTINCT(source) FROM ". $event_table); + } else { + $groups_user = users_get_groups ($config['id_user'], "ER", true); + $sources = db_get_all_rows_sql("SELECT DISTINCT(source) FROM ". $event_table. " WHERE id_grupo IN (" .implode(",",array_keys($groups_user)) .")"); + } + + foreach ($sources as $key => $source) { + $fields[$source['source']] = $source['source']; + } + + return $fields; +} /** * Decode a numeric status into status description. diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 6dcc1cd9d7..c5e8e53725 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2869,7 +2869,7 @@ function reporting_alert_get_fired($id_agent_module, $id_alert_template_module, if (empty($firedTimes)) { $firedTimes = array(); - $firedTimes[0]['timestamp'] = '----------------------------'; + $firedTimes[0]['timestamp'] = null; } foreach ($firedTimes as $fireTime) { @@ -3010,7 +3010,10 @@ function reporting_alert_report_group($report, $content) { (int) $report["datetime"]); $module_actions["actions"] = $data_action; + if ($module_actions["template_fired"][0] !== null) $data_row['alerts'][$ntemplates] = $module_actions; + else + $data_row = null; $ntemplates++; } @@ -3127,7 +3130,10 @@ function reporting_alert_report_agent($report, $content) { (int) $report["datetime"]); $module_actions["actions"] = $data_action; + if ($module_actions["template_fired"][0] !== null) $data_row['alerts'][$ntemplates] = $module_actions; + else + $data_row = null; $ntemplates++; } @@ -3248,7 +3254,10 @@ function reporting_alert_report_module($report, $content) { (int) $report["datetime"]); $module_actions["actions"] = $data_action; + if ($module_actions["template_fired"][0] !== null) $data_row['alerts'][$ntemplates] = $module_actions; + else + $data_row = null; $ntemplates++; } diff --git a/pandora_console/include/help/en/help_macros_visual_maps.php b/pandora_console/include/help/en/help_macros_visual_maps.php index 4ff573b19a..af01634f94 100644 --- a/pandora_console/include/help/en/help_macros_visual_maps.php +++ b/pandora_console/include/help/en/help_macros_visual_maps.php @@ -3,11 +3,11 @@ * @package Include/help/en */ ?> -<h1>Visual maps' macros</h1> +<h1>Visual console's macros</h1> It is possible to enter a macro in the text box when editing an element of the visual console. <br /><br /> -List of visual maps' macros: +List of visual console's macros: <ul> <li>_date_: Displays the date using the local PHP format. </li> <li>_time_: Displays the time using the local PHP format. </li> @@ -15,5 +15,5 @@ List of visual maps' macros: <li>_module_: Displays the name of the selected module. </li> <li>_agentdescription_: Displays the description of the selected agent. </li> <li>_address_: Displays the ip address of the selected agent. </li> - <li>_description_moduledescription_: Displays the description of the selected module. </li> + <li>_moduledescription_: Displays the description of the selected module. </li> </ul> \ No newline at end of file diff --git a/pandora_console/include/help/es/help_macros_visual_maps.php b/pandora_console/include/help/es/help_macros_visual_maps.php index 592752874e..e373d7417b 100644 --- a/pandora_console/include/help/es/help_macros_visual_maps.php +++ b/pandora_console/include/help/es/help_macros_visual_maps.php @@ -3,11 +3,11 @@ * @package Include/help/es */ ?> -<h1>Macros de mapas visuales</h1> +<h1>Macros de consolas visuales</h1> Es posible introducir una macro en el cuadro de texto al editar un elemento de la consola visual. <br /><br /> -Lista de macros de mapas visuales: +Lista de macros de consolas visuales: <ul> <li>_date_ : Muestra la fecha usando el formato local del PHP.</li> <li>_time_ : Muestra la hora usando el formato local del PHP.</li> diff --git a/pandora_console/install.php b/pandora_console/install.php index 9e9e24ac9c..f0826fb787 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@ <div style='height: 10px'> <?php $version = '7.0NG.726'; -$build = '180827'; +$build = '180904'; $banner = "v$version Build $build"; error_reporting(0); diff --git a/pandora_console/operation/events/events.build_query.php b/pandora_console/operation/events/events.build_query.php index 7716257cc4..936d933143 100755 --- a/pandora_console/operation/events/events.build_query.php +++ b/pandora_console/operation/events/events.build_query.php @@ -149,6 +149,18 @@ if ($severity != -1) { } } +if ($id_extra != '') { + $sql_post .= " AND id_extra LIKE '%$id_extra%'"; +} + +if ($user_comment != '') { + $sql_post .= " AND user_comment LIKE '%$user_comment%'"; +} + +if ($source != '') { + $sql_post .= " AND source LIKE '$source'"; +} + // In metaconsole mode the agent search is performed by name if ($meta) { $text_agent = get_parameter("text_agent",""); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 03101d09b4..ad692695ae 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -261,6 +261,9 @@ $time_to = (string)get_parameter('time_to', ''); $server_id = (int)get_parameter('server_id', 0); $text_agent = (string) get_parameter("text_agent"); $refr = (int) get_parameter ('refresh'); +$id_extra = (string) get_parameter('id_extra'); +$user_comment = (string) get_parameter('user_comment'); +$source = (string) get_parameter('source'); if ($id_agent != 0) { $text_agent = agents_get_alias($id_agent); diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index ea78086c6b..2add378167 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -89,7 +89,10 @@ if (is_ajax()) { $values['id_group_filter'] = get_parameter('id_group_filter'); $values['date_from'] = get_parameter('date_from'); $values['date_to'] = get_parameter('date_to'); - + $values['source'] = get_parameter('source'); + $values['id_extra'] = get_parameter('id_extra'); + $values['user_comment'] = get_parameter('user_comment'); + $exists = (bool)db_get_value_filter( 'id_filter', 'tevent_filter', $values); @@ -129,6 +132,10 @@ if (is_ajax()) { $values['id_group_filter'] = get_parameter('id_group_filter'); $values['date_from'] = get_parameter('date_from'); $values['date_to'] = get_parameter('date_to'); + $values['source'] = get_parameter('source'); + $values['id_extra'] = get_parameter('id_extra'); + $values['user_comment'] = get_parameter('user_comment'); + if (io_safe_output($values['tag_with']) == "[\"0\"]") { $values['tag_with'] = "[]"; } @@ -189,6 +196,10 @@ if ($user_filter != 0 && empty($id_name) && !$update_from_filter_table) { $status = $user_default_filter['status']; $event_view_hr = $user_default_filter['event_view_hr']; $group_rep = $user_default_filter['group_rep']; + $id_extra = $user_default_filter['id_extra']; + $user_comment = $user_default_filter['user_comment']; + $source = $user_default_filter['source']; + if ($user_default_filter['search'] != "") { $search = $user_default_filter['search']; } @@ -654,6 +665,17 @@ $data[2] .= html_print_select ($repeated_sel, "group_rep", $group_rep, '', '', 0 $table->data[] = $data; $table->rowclass[] = ''; +$data = array(); +$sources = events_get_all_source(); +$data[0] = __('Source') . $jump; +$data[0] .= html_print_select ($sources, 'source', $source, '', '', '', true); +$data[1] = __('Extra ID') . $jump; +$data[1] .= html_print_input_text ('id_extra', $id_extra, '', 11, 255, true); +$data[2] = __("Comment") . $jump; +$data[2] .= html_print_input_text ('user_comment', $user_comment, '', 35, 255, true); +$table->data[] = $data; +$table->rowclass[] = ''; + $data = array(); $data[0] = ui_toggle(html_print_table($table_advanced, true), __('Advanced options'), '', true, true); @@ -952,6 +974,12 @@ $(document).ready( function() { $("#filter_only_alert").val(val); if (i == 'id_group_filter') $("#id_group_filter").val(val); + if (i == 'source') + $("#source").val(val); + if (i == 'id_extra') + $("#text-id_extra").val(val); + if (i == 'user_comment') + $("#text-user_comment").val(val); }); reorder_tags_inputs(); // Update the info with the loaded filter @@ -990,6 +1018,9 @@ $(document).ready( function() { $("#pagination").val(20); $("#update_from_filter_table").val(1); $("#text_id_agent").val(""); + $("#source").val(''); + $("#text-id_extra").val(''); + $("#text-user_comment").val(''); clear_tags_inputs(); @@ -1058,6 +1089,12 @@ $(document).ready( function() { $("#text-date_to").val(val.replace(/\-/g,"/")); } } + if (i == 'source') + $("#source").val(val); + if (i == 'id_extra') + $("#text-id_extra").val(val); + if (i == 'user_comment') + $("#text-user_comment").val(val); }); reorder_tags_inputs(); // Update the info with the loaded filter @@ -1123,7 +1160,10 @@ $(document).ready( function() { "filter_only_alert" : $("#filter_only_alert").val(), "id_group_filter": $("#id_group_filter").val(), "date_from": $("#text-date_from").val(), - "date_to": $("#text-date_to").val() + "date_to": $("#text-date_to").val(), + "source": $("#source").val(), + "id_extra": $("#text-id_extra").val(), + "user_comment": $("#text-user_comment").val() }, function (data) { $(".info_box").hide(); @@ -1220,7 +1260,10 @@ $(document).ready( function() { "filter_only_alert" : $("#filter_only_alert").val(), "id_group_filter": $("#id_group_filter").val(), "date_from": $("#text-date_from").val(), - "date_to": $("#text-date_to").val() + "date_to": $("#text-date_to").val(), + "source": $("#source").val(), + "id_extra": $("#text-id_extra").val(), + "user_comment": $("#text-user_comment").val() }, function (data) { $(".info_box").hide(); diff --git a/pandora_console/operation/gis_maps/public_console.php b/pandora_console/operation/gis_maps/public_console.php index 1bbe90bd12..3389e77220 100755 --- a/pandora_console/operation/gis_maps/public_console.php +++ b/pandora_console/operation/gis_maps/public_console.php @@ -153,11 +153,15 @@ if ($layers != false) { foreach ($groupsByAgentId as $agentId => $groupInfo) { $agentNamesOfGroupItems[$agentId] = $groupInfo["agent_name"]; } - + $agentNames = array_unique($agentNamesByGroup + $agentNamesByLayer + $agentNamesOfGroupItems); foreach ($agentNames as $agentName) { $idAgent = agents_get_agent_id($agentName); + if (!$idAgent) { + $idAgent = agents_get_agent_id_by_alias($agentName); + $idAgent = (!empty($idAgent)) ? $idAgent[0]['id_agente'] : 0; + } $coords = gis_get_data_last_position_agent($idAgent); if ($coords === false) { diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 35e6096114..0c6ee23221 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.726 -%define release 180827 +%define release 180904 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 1a91e1350e..ce2ed21b39 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.726 -%define release 180827 +%define release 180904 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index ef0d656735..f8eaf58854 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -259,7 +259,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `prediction_sample_window` int(10) default 0, `prediction_samples` int(4) default 0, `prediction_threshold` int(4) default 0, - `parent_module_id` int(10) unsigned NOT NULL, + `parent_module_id` int(10) unsigned NOT NULL default 0, `cps` int NOT NULL default 0, PRIMARY KEY (`id_agente_modulo`), KEY `main_idx` (`id_agente_modulo`,`id_agente`), @@ -1079,6 +1079,9 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` ( `filter_only_alert` int(10) NOT NULL default -1, `date_from` date default NULL, `date_to` date default NULL, + `source` tinytext NOT NULL, + `id_extra` tinytext NOT NULL, + `user_comment` text NOT NULL, PRIMARY KEY (`id_filter`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -1289,6 +1292,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` ( `lapse` int(11) UNSIGNED NOT NULL default '300', `visual_format` tinyint(1) UNSIGNED NOT NULL default '0', `hide_no_data` tinyint(1) default 0, + `recursion` tinyint(1) default NULL, PRIMARY KEY(`id_rc`), FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`) ON UPDATE CASCADE ON DELETE CASCADE diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 842d5e4e3d..5f259c4acb 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.726-180827 +Version: 7.0NG.726-180904 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index ca38d563f8..31f520655d 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.726-180827" +pandora_version="7.0NG.726-180904" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 245e8cb8fe..5a87dcdd89 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -45,7 +45,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.726"; -my $pandora_build = "180827"; +my $pandora_build = "180904"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/PluginServer.pm b/pandora_server/lib/PandoraFMS/PluginServer.pm index b94de25598..d57ed6407d 100644 --- a/pandora_server/lib/PandoraFMS/PluginServer.pm +++ b/pandora_server/lib/PandoraFMS/PluginServer.pm @@ -153,7 +153,7 @@ sub data_consumer ($$) { return unless defined $agent; # Use the smallest timeout - my $timeout = (($plugin->{'max_timeout'} < $pa_config->{'plugin_timeout'}) && $pa_config->{'max_timeout'}) ? + my $timeout = (($plugin->{'max_timeout'} < $pa_config->{'plugin_timeout'}) && $plugin->{'max_timeout'}) ? $plugin->{'max_timeout'} : $pa_config->{'plugin_timeout'}; # Setting default timeout if is invalid diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 793ec077b1..bf454bed07 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -32,7 +32,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.726"; -my $pandora_build = "180827"; +my $pandora_build = "180904"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 44dee36d06..e7ba2d470f 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.726 -%define release 180827 +%define release 180904 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 7ffb5014d8..cfab1cd536 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.726 -%define release 180827 +%define release 180904 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 6cac72fcae..3de83b1456 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.726" -PI_BUILD="180827" +PI_BUILD="180904" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 6e41d9f237..304bf7e3b5 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.726 PS180827"; +my $version = "7.0NG.726 PS180904"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 51e76ded68..c2bea673d9 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.726 PS180827"; +my $version = "7.0NG.726 PS180904"; # save program name for logging my $progname = basename($0);