diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 510f6e5de5..2029b2fbd5 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.748-200817 +Version: 7.0NG.748-200826 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 58b17371d1..9628188e25 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.748-200817" +pandora_version="7.0NG.748-200826" 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 ce76c6d66f..ba978f6e27 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.748'; -use constant AGENT_BUILD => '200817'; +use constant AGENT_BUILD => '200826'; # 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 63ffbb3f2c..3c0e329156 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.748 -%define release 200817 +%define release 200826 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 b2a4144872..e2ddd2d12b 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.748 -%define release 200817 +%define release 200826 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 d8ff9c5ba0..ffaba2c469 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.748" -PI_BUILD="200817" +PI_BUILD="200826" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index f668dc85ad..2b4ec6de1e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{200817} +{200826} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 25fe082ef5..9c80bb0274 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.748(Build 200817)") +#define PANDORA_VERSION ("7.0NG.748(Build 200826)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 72d707ec1c..54929f97ff 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.748(Build 200817))" + VALUE "ProductVersion", "(7.0NG.748(Build 200826))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4434c88f19..533ba97aca 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.748-200817 +Version: 7.0NG.748-200826 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 1e29f086a2..a047d27b00 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.748-200817" +pandora_version="7.0NG.748-200826" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/41.sql b/pandora_console/extras/mr/41.sql new file mode 100644 index 0000000000..58cf54f69f --- /dev/null +++ b/pandora_console/extras/mr/41.sql @@ -0,0 +1,9 @@ +START TRANSACTION; + +ALTER TABLE `talert_templates` ADD COLUMN `previous_name` text; +ALTER TABLE `talert_actions` ADD COLUMN `previous_name` text; +ALTER TABLE `talert_commands` ADD COLUMN `previous_name` text; +ALTER TABLE `ttag` ADD COLUMN `previous_name` text NULL; +ALTER TABLE `tconfig_os` ADD COLUMN `previous_name` text NULL; + +COMMIT; \ No newline at end of file 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 193705ed89..d741afb9ae 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 @@ -1312,6 +1312,8 @@ ALTER TABLE talert_actions ADD COLUMN `field12_recovery` TEXT NOT NULL DEFAULT " ALTER TABLE talert_actions ADD COLUMN `field13_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_actions ADD COLUMN `field14_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_actions` ADD COLUMN `previous_name` text; + ALTER TABLE `talert_actions` MODIFY COLUMN `field11` text NOT NULL, MODIFY COLUMN `field12` text NOT NULL, MODIFY COLUMN `field13` text NOT NULL, @@ -1325,6 +1327,7 @@ UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria IMS UPDATE `talert_commands` SET `description` = 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using: _field1_ as destination email address, and _field2_ as subject for message. _field3_ as text of message. _field4_ as content type (text/plain or html/text).', `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"Content Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id=1; ALTER TABLE `talert_commands` ADD COLUMN `id_group` mediumint(8) unsigned NULL default 0; ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text; +ALTER TABLE `talert_commands` ADD COLUMN `previous_name` text; UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1; @@ -1337,6 +1340,11 @@ ALTER TABLE `talert_commands` MODIFY COLUMN `id_group` mediumint(8) unsigned NUL -- --------------------------------------------------------------------- ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT ''; +-- --------------------------------------------------------------------- +-- Table `ttag` +-- --------------------------------------------------------------------- +ALTER TABLE `ttag` ADD COLUMN `previous_name` text NULL; + -- --------------------------------------------------------------------- -- Table `tconfig` -- --------------------------------------------------------------------- @@ -1381,7 +1389,9 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_content', ''); -- Table `tconfig_os` -- --------------------------------------------------------------------- -INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES (100, 'Cluster', 'Cluster agent', 'so_cluster.png'); +ALTER TABLE `tconfig_os` ADD COLUMN `previous_name` text NULL; + +INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES (100, 'Cluster', 'Cluster agent', 'so_cluster.png', ''); UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `tconfig_os` WHERE `id_os` = 21 and `name` = 'Cluster'); @@ -2461,6 +2471,8 @@ INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES -- Alter table `talert_templates` -- ---------------------------------------------------------------------- +ALTER TABLE `talert_templates` ADD COLUMN `previous_name` text; + ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal'); ALTER TABLE `talert_templates` MODIFY COLUMN `field11` text NOT NULL, diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index 150245acaf..38b601e6b7 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -362,6 +362,7 @@ $templates = alerts_get_alert_templates( 'description', 'type', 'id_group', + 'previous_name', ] ); if ($templates === false) { diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index 2091a9ee54..9300dc038b 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -83,6 +83,10 @@ if ($update_command) { $values['command'] = $command; $values['description'] = $description; $values['id_group'] = $id_group; + // Only for Metaconsole. Save the previous name for synchronizing. + if (is_metaconsole()) { + $values['previous_name'] = db_get_value('name', 'talert_commands', 'id', $id); + } // Check it the new name is used in the other command. $id_check = db_get_value('id', 'talert_commands', 'name', $name); diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index f9f8876e9c..9333664477 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -34,6 +34,9 @@ if (! check_acl($config['id_user'], 0, 'LM')) { $duplicate_template = (bool) get_parameter('duplicate_template'); $id = (int) get_parameter('id'); $pure = get_parameter('pure', 0); +$step = (int) get_parameter('step', 1); +// We set here the number of steps. +define('LAST_STEP', 3); // If user tries to duplicate/edit a template with group=ALL then must have "PM" access privileges if ($duplicate_template) { @@ -56,7 +59,6 @@ if ($a_template !== false) { if (defined('METACONSOLE')) { alerts_meta_print_header(); } else { - $step = (int) get_parameter('step', 1); if ($step == 1) { $help_header = ''; } else if ($step == 2) { @@ -113,7 +115,6 @@ if ($a_template !== false) { if (defined('METACONSOLE')) { alerts_meta_print_header(); } else { - $step = (int) get_parameter('step', 1); if ($step == 1) { $help_header = ''; } else if ($step == 2) { @@ -252,24 +253,20 @@ function update_template($step) $wizard_level = (string) get_parameter('wizard_level'); $priority = (int) get_parameter('priority'); $id_group = get_parameter('id_group'); - - switch ($config['dbtype']) { - case 'mysql': - case 'postgresql': - $name_check = db_get_value('name', 'talert_templates', 'name', $name); - break; - - case 'oracle': - $name_check = db_get_value('name', 'talert_templates', 'to_char(name)', $name); - break; + // Only for Metaconsole. Save the previous name for synchronizing. + if (is_metaconsole()) { + $previous_name = db_get_value('name', 'talert_templates', 'id', $id); + } else { + $previous_name = ''; } $values = [ - 'name' => $name, - 'description' => $description, - 'id_group' => $id_group, - 'priority' => $priority, - 'wizard_level' => $wizard_level, + 'name' => $name, + 'description' => $description, + 'id_group' => $id_group, + 'priority' => $priority, + 'wizard_level' => $wizard_level, + 'previous_name' => $previous_name, ]; $result = alerts_update_alert_template($id, $values); diff --git a/pandora_console/godmode/setup/os.php b/pandora_console/godmode/setup/os.php index 99cce6e61d..73e10ecd52 100644 --- a/pandora_console/godmode/setup/os.php +++ b/pandora_console/godmode/setup/os.php @@ -98,6 +98,10 @@ switch ($action) { $values = []; $values['name'] = $name; $values['description'] = $description; + // Only for Metaconsole. Save the previous name for synchronizing. + if (is_metaconsole()) { + $values['previous_name'] = db_get_value('name', 'tconfig_os', 'id_os', $idOS); + } if (($icon !== 0) && ($icon != '')) { $values['icon_name'] = $icon; diff --git a/pandora_console/godmode/tag/edit_tag.php b/pandora_console/godmode/tag/edit_tag.php index 96b4e158e3..0b4d78f748 100644 --- a/pandora_console/godmode/tag/edit_tag.php +++ b/pandora_console/godmode/tag/edit_tag.php @@ -79,6 +79,10 @@ if ($update_tag && $id_tag != 0) { $values['url'] = $url_tag; $values['email'] = $email_tag; $values['phone'] = $phone_tag; + // Only for Metaconsole. Save the previous name for synchronizing. + if (is_metaconsole()) { + $values['previous_name'] = db_get_value('name', 'ttag', 'id_tag', $id_tag); + } $result = false; if ($values['name'] != '') { diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 459e9849a4..230b55a476 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -1093,7 +1093,8 @@ if ($dialogue_event_response) { } } else { echo "