diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index fe6e873a22..dd40ab43d1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.728-181112 +Version: 7.0NG.728-181113 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 fbb6748c0d..5405c2e93e 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.728-181112" +pandora_version="7.0NG.728-181113" 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 5971ea884b..aba0856a7a 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.728'; -use constant AGENT_BUILD => '181112'; +use constant AGENT_BUILD => '181113'; # 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 32ed9e7f75..42a174a880 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.728 -%define release 181112 +%define release 181113 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 2b0c71bf6c..d4f8aad316 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.728 -%define release 181112 +%define release 181113 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 1faeaf607e..5bad6fa1cf 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.728" -PI_BUILD="181112" +PI_BUILD="181113" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8adf396df1..92ffc7a8c6 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{181112} +{181113} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 33daa693bd..9b4848fb00 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.728(Build 181112)") +#define PANDORA_VERSION ("7.0NG.728(Build 181113)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 9f9b037c4c..eb3eccc555 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.728(Build 181112))" + VALUE "ProductVersion", "(7.0NG.728(Build 181113))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 3e71004ea0..d47d93efa2 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.728-181112 +Version: 7.0NG.728-181113 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 fcaa0249ce..c5c6cbdf7c 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.728-181112" +pandora_version="7.0NG.728-181113" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/22.sql b/pandora_console/extras/mr/22.sql index d0a099460b..39c18cad6c 100644 --- a/pandora_console/extras/mr/22.sql +++ b/pandora_console/extras/mr/22.sql @@ -2,6 +2,19 @@ START TRANSACTION; ALTER TABLE `tusuario` DROP COLUMN `flash_chart`; +ALTER TABLE `tusuario` ADD COLUMN `default_custom_view` int(10) unsigned NULL default '0'; + ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL; +CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(600) NOT NULL, + `id_group` int(10) unsigned default '0', + `id_custom_field` varchar(600) default '', + `id_custom_fields_data` varchar(600) default '', + `id_status` varchar(600) default '', + `module_search` varchar(600) default '', + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + COMMIT; 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 8980cf0982..a2d81b64d9 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 @@ -1231,6 +1231,7 @@ ALTER TABLE tusuario ADD COLUMN `session_time` int(10) signed NOT NULL default ' alter table tusuario add autorefresh_white_list text not null default ''; ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30'; ALTER TABLE `tusuario` DROP COLUMN `flash_chart`; +ALTER TABLE `tusuario` ADD COLUMN `default_custom_view` int(10) unsigned NULL default '0'; -- --------------------------------------------------------------------- -- Table `tagente_modulo` @@ -1811,3 +1812,17 @@ ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_method` varchar(25) NOT NULL def ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_method` varchar(25) NOT NULL default ''; ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_pass` varchar(255) NOT NULL default ''; ALTER TABLE `trecon_task` ADD COLUMN `snmp_security_level` varchar(25) NOT NULL default ''; + +-- --------------------------------------------------------------------- +-- Table `tagent_custom_fields_filter` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(600) NOT NULL, + `id_group` int(10) unsigned default '0', + `id_custom_field` varchar(600) default '', + `id_custom_fields_data` varchar(600) default '', + `id_status` varchar(600) default '', + `module_search` varchar(600) default '', + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 36b67da66f..5f364389ed 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1943,7 +1943,7 @@ switch ($tab) { var aget_id_os = ''; - if('' != $('#text-name').val() && + if('' != $('#text-name').val() && '' == 19){ event.preventDefault(); @@ -1977,7 +1977,7 @@ switch ($tab) { var module_type_snmp = ''; - if('' != $('#text-name').val() && ( + if('' != $('#text-name').val() && ( module_type_snmp == 15 || module_type_snmp == 16 || module_type_snmp == 17 || module_type_snmp == 18)){ event.preventDefault(); diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 7334985178..28b6ec96a5 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -169,6 +169,7 @@ if ($create_user) { $values['language'] = get_parameter ('language', 'default'); $values['timezone'] = (string) get_parameter('timezone'); $values['default_event_filter'] = (int) get_parameter('default_event_filter'); + $values['default_custom_view'] = (int) get_parameter('default_custom_view'); $dashboard = get_parameter('dashboard', ''); $visual_console = get_parameter('visual_console', ''); @@ -281,6 +282,7 @@ if ($update_user) { $values['language'] = (string) get_parameter ('language'); $values['timezone'] = (string) get_parameter('timezone'); $values['default_event_filter'] = (int) get_parameter('default_event_filter'); + $values['default_custom_view'] = (int) get_parameter('default_custom_view'); $dashboard = get_parameter('dashboard', ''); $visual_console = get_parameter('visual_console', ''); @@ -570,7 +572,16 @@ if (!$meta) { } } -$table->data[11][0] = __('Interactive charts').' '.ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true) ; +if($meta){ + $array_filters = get_filters_custom_fields_view(0, true); + $table->data[11][0] = __('Search custom field view').' '.ui_print_help_tip(__('Load by default the selected view in custom field view'), true); + $table->data[11][1] =html_print_select( + $array_filters, 'default_custom_view', + $user_info['default_custom_view'], '', __('None'), 0, + true, false, true, '', false + ); +} + $values = array(-1 => __('Use global conf'), 1 => __('Yes'), 0 => __('No')); $table->data[12][0] = __('Home screen'). @@ -724,7 +735,6 @@ $(document).ready (function () { } else { $('#user_configuration_table-metaconsole_agents_manager').hide(); - $('#user_configuration_table-metaconsole_assigned_server').show(); $('#user_configuration_table-metaconsole_access_node').hide(); } }); diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 8d4fca2cb8..90df3419e8 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -35,9 +35,15 @@ $get_id_tag = (bool) get_parameter('get_id_tag', 0); $get_type = (bool) get_parameter('get_type', 0); $list_modules = (bool) get_parameter('list_modules', 0); $get_agent_modules_json_by_name = (bool) get_parameter('get_agent_modules_json_by_name', 0); + $get_custom_fields_data = (bool) get_parameter('get_custom_fields_data', 0); $build_table_custom_fields = (bool)get_parameter('build_table_custom_fields', 0); $build_table_child_custom_fields = (bool)get_parameter('build_table_child_custom_fields', 0); +$build_table_save_filter = (bool)get_parameter('build_table_save_filter', 0); +$append_tab_filter = (bool)get_parameter('append_tab_filter', 0); +$create_filter_cf = (bool)get_parameter('create_filter_cf', 0); +$update_filter_cf = (bool)get_parameter('update_filter_cf', 0); +$delete_filter_cf = (bool)get_parameter('delete_filter_cf', 0); if ($get_agent_modules_json_by_name) { $agent_name = get_parameter('agent_name'); @@ -1326,8 +1332,6 @@ if($build_table_child_custom_fields){ $name_where ); - hd($query, true, true); - $modules = db_get_all_rows_sql ($query); $table_modules = new stdClass(); @@ -1335,15 +1339,15 @@ if($build_table_child_custom_fields){ $table_modules->class="databox data"; $table_modules->head = array(); - $table_modules->head[0] = __('Name'); - $table_modules->head[1] = __('Data'); - $table_modules->head[2] = __('Min Warning'); - $table_modules->head[3] = __('Max Warning'); - $table_modules->head[4] = __('Min Critical'); - $table_modules->head[5] = __('Max Critical'); + $table_modules->head[0] = __('Module name'); + $table_modules->head[1] = __('Min Warning'); + $table_modules->head[2] = __('Max Warning'); + $table_modules->head[3] = __('Min Critical'); + $table_modules->head[4] = __('Max Critical'); + $table_modules->head[5] = __('Status'); $table_modules->head[6] = __('Current interval'); $table_modules->head[7] = __('Date'); - $table_modules->head[8] = __('Status'); + $table_modules->head[8] = __('Status'); $table_modules->data = array(); if(isset($modules) && is_array($modules)){ @@ -1355,7 +1359,7 @@ if($build_table_child_custom_fields){ $table_modules->data[$key][4] = $value['min_critical']; $table_modules->data[$key][5] = $value['max_critical']; $table_modules->data[$key][6] = $value['current_interval']; - $table_modules->data[$key][7] = date('d/m/Y h:i:s', $value['utimestamp']); + $table_modules->data[$key][7] = date('d/m/Y h:i:s', $value['utimestamp']); switch ($value['estado']) { case 0: case 300: @@ -1428,6 +1432,275 @@ if($build_table_child_custom_fields){ return; } +if($build_table_save_filter){ + $type_form = get_parameter("type_form", ''); + + if($type_form == 'save'){ + $tabs = '