diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index b7d3b6428e..90db43aca6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.771-230615 +Version: 7.0NG.771-230620 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 7e15a1be7b..23094dec42 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.771-230615" +pandora_version="7.0NG.771-230620" 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 75e94c30ca..d4f3095eb7 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.771'; -use constant AGENT_BUILD => '230615'; +use constant AGENT_BUILD => '230620'; # 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 ae46211a58..5fa4c9b2bd 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.771 -%define release 230615 +%define release 230620 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 770b4d6cf5..b2073fd66c 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.771 -%define release 230615 +%define release 230620 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 ce11a63fbd..cfa7f491a0 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.771" -PI_BUILD="230615" +PI_BUILD="230620" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 146addb04e..7235af42fa 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230615} +{230620} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ef6af645e4..8f246709c7 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.771 Build 230615") +#define PANDORA_VERSION ("7.0NG.771 Build 230620") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 80185cd65d..1328bab922 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.771(Build 230615))" + VALUE "ProductVersion", "(7.0NG.771(Build 230620))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7da79ae012..306302fdf2 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.771-230615 +Version: 7.0NG.771-230620 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 123e6587f7..dfcd7c0fa4 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.771-230615" +pandora_version="7.0NG.771-230620" package_pear=0 package_pandora=1 diff --git a/pandora_console/godmode/massive/massive_edit_users.php b/pandora_console/godmode/massive/massive_edit_users.php index 46022c2833..4833f340aa 100644 --- a/pandora_console/godmode/massive/massive_edit_users.php +++ b/pandora_console/godmode/massive/massive_edit_users.php @@ -31,7 +31,7 @@ check_login(); global $config; -if (users_is_admin() === false) { +if (check_acl($config['id_user'], 0, 'UM') !== 1) { db_pandora_audit( AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive edit users' diff --git a/pandora_console/godmode/massive/massive_operations.php b/pandora_console/godmode/massive/massive_operations.php index b4d4474c20..b9fb5e0781 100755 --- a/pandora_console/godmode/massive/massive_operations.php +++ b/pandora_console/godmode/massive/massive_operations.php @@ -70,16 +70,13 @@ $options_agents = [ ]; if (check_acl($config['id_user'], 0, 'UM')) { + $options_users['edit_users'] = __('Edit users in bulk'); if (is_metaconsole() === false) { $options_users = [ 'add_profiles' => __('Bulk profile add'), 'delete_profiles' => __('Bulk profile delete'), ]; } - - if (users_is_admin() === true) { - $options_users['edit_users'] = __('Edit users in bulk'); - } } else { $options_users = []; } diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 38ac32b635..7ec49b4d08 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -6776,6 +6776,8 @@ function chooseType() { $("#row_dyn_height").show(); $("#row_servers").show(); $("#row_historical_db_check").show(); + $("#sql_example").hide(); + $("#sql_entry").show(); break; case 'url': diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index f6a67cce8e..1c3a88e73d 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -2198,10 +2198,6 @@ switch ($action) { ); if ($values['treport_custom_sql_id'] == 0) { $sql = get_parameter('sql', ''); - if ($sql !== '') { - $good_format = db_validate_sql($sql); - } - $values['external_source'] = $sql; } @@ -2218,6 +2214,28 @@ switch ($action) { } else { $values['server_name'] = get_parameter('combo_server'); } + + if ($sql !== '') { + if ($values['server_name'] === 'all') { + $servers_connection = metaconsole_get_connections(); + foreach ($servers_connection as $key => $s) { + $good_format = db_validate_sql($sql, $s['server_name']); + } + + // Reconnected in nodo if exist. + if ($server_id !== 0) { + $connection = metaconsole_get_connection_by_id( + $server_id + ); + metaconsole_connect($connection); + } + } else if ($server_id === 0) { + // Connect with node if not exist conexion. + $good_format = db_validate_sql($sql, (is_metaconsole() === true) ? $values['server_name'] : false); + } else { + $good_format = db_validate_sql($sql); + } + } } else if ($values['type'] == 'url') { $values['external_source'] = get_parameter('url'); } else if ($values['type'] == 'event_report_group') { @@ -2965,7 +2983,25 @@ switch ($action) { } if ($sql !== '') { - $good_format = db_validate_sql($sql, (is_metaconsole() === true) ? $values['server_name'] : false); + if ($values['server_name'] === 'all') { + $servers_connection = metaconsole_get_connections(); + foreach ($servers_connection as $key => $s) { + $good_format = db_validate_sql($sql, $s['server_name']); + } + + // Reconnected in nodo if exist. + if ($server_id !== 0) { + $connection = metaconsole_get_connection_by_id( + $server_id + ); + metaconsole_connect($connection); + } + } else if ($server_id === 0) { + // Connect with node if not exist conexion. + $good_format = db_validate_sql($sql, (is_metaconsole() === true) ? $values['server_name'] : false); + } else { + $good_format = db_validate_sql($sql); + } } } else if ($values['type'] == 'url') { $values['external_source'] = get_parameter('url'); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e5ba9d302f..2d9e3e3462 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC230615'; +$build_version = 'PC230620'; $pandora_version = 'v7.0NG.771'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 18b5b9eda6..3dcb84a8c1 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4253,7 +4253,9 @@ function reporting_group_report($report, $content) $data_node = reporting_groups_nodes($content); $count_events += $data_node['count_events']; foreach ($data_node['group_stats'] as $key => $value) { - $group_stats[$key] += $value; + if (array_key_exists($key, $group_stats)) { + $group_stats[$key] += $value; + } } if (is_metaconsole() === true) { diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index 4a0076e847..9e9e1c0941 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -654,6 +654,18 @@ function snmp_browser_print_oid( ); } + if (isset($_POST['print_copy_oid'])) { + // Hidden by default. + $output .= html_print_button( + __('Use this OID'), + 'use_iod', + false, + 'use_oid()', + 'class="sub add invisible"', + true + ); + } + // Select agent modal. $output .= snmp_browser_print_create_modules(true); @@ -1134,6 +1146,14 @@ function snmp_browser_print_container( false, 'id_agent_module' ); + $output .= html_print_input_hidden( + 'is_policy_agent', + 1, + true, + false, + false, + 'is_policy_agent' + ); $output .= html_print_table($table, true); $output .= html_print_div( [ diff --git a/pandora_console/include/javascript/pandora_snmp_browser.js b/pandora_console/include/javascript/pandora_snmp_browser.js index 58a1972c40..87c2675f8b 100644 --- a/pandora_console/include/javascript/pandora_snmp_browser.js +++ b/pandora_console/include/javascript/pandora_snmp_browser.js @@ -7,6 +7,10 @@ function snmpBrowse() { // Hide the data div hideOIDData(); + $("#button-srcbutton") + .find("div") + .addClass("rotation"); + // Reset previous searches $("#search_results").css("display", "none"); $("#hidden-search_count").val(-1); @@ -258,7 +262,7 @@ function snmpGet(oid) { var ajax_url = $("#hidden-ajax_url").val(); var server_to_exec = $("#server_to_exec").val(); var target_port = $("#target_port").val(); - var print_create_agent_module = true; + var is_policy_or_agent = $("#is_policy_agent").val(); // Check for a custom action var custom_action = $("#hidden-custom_action").val(); @@ -283,7 +287,11 @@ function snmpGet(oid) { params["custom_action"] = custom_action; params["page"] = "include/ajax/snmp_browser.ajax"; params["target_port"] = target_port; - params["print_create_agent_module"] = print_create_agent_module; + if (typeof is_policy_or_agent !== "undefined") { + params["print_copy_oid"] = 1; + } else { + params["print_create_agent_module"] = 1; + } // SNMP get! jQuery.ajax({ diff --git a/pandora_console/include/lib/Dashboard/Widgets/BlockHistogram.php b/pandora_console/include/lib/Dashboard/Widgets/BlockHistogram.php index ef2b91a3f1..88fcfa1830 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/BlockHistogram.php +++ b/pandora_console/include/lib/Dashboard/Widgets/BlockHistogram.php @@ -143,6 +143,9 @@ class BlockHistogram extends Widget $widgetId ); + // Include. + include_once $config['homedir'].'/include/functions_reporting.php'; + // Width. $this->width = $width; diff --git a/pandora_console/include/lib/Dashboard/Widgets/GroupedMeterGraphs.php b/pandora_console/include/lib/Dashboard/Widgets/GroupedMeterGraphs.php index 2eed27df11..774dbfe7fc 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/GroupedMeterGraphs.php +++ b/pandora_console/include/lib/Dashboard/Widgets/GroupedMeterGraphs.php @@ -170,6 +170,9 @@ class GroupedMeterGraphs extends Widget $widgetId ); + // Include. + include_once $config['homedir'].'/include/functions_reporting.php'; + // Width. $this->width = $width; diff --git a/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php b/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php index 128877d66e..a2bf912eaa 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php +++ b/pandora_console/include/lib/Dashboard/Widgets/graph_module_histogram.php @@ -351,7 +351,7 @@ class GraphModuleHistogramWidget extends Widget 'agent_id' => $values['agentId'], 'metaconsole_id' => $values['metaconsoleId'], 'style' => 'width: inherit;', - 'filter_modules' => (users_access_to_agent($values['agentId']) === false) ? [$values['moduleId']] : [], + 'filter_modules' => (users_access_to_agent($values['agentId'], 'AR', false, is_metaconsole()) === false) ? [$values['moduleId']] : [], 'nothing' => __('None'), 'nothing_value' => 0, ], diff --git a/pandora_console/include/lib/Dashboard/Widgets/os_quick_report.php b/pandora_console/include/lib/Dashboard/Widgets/os_quick_report.php index cd500e2972..0fb08f0719 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/os_quick_report.php +++ b/pandora_console/include/lib/Dashboard/Widgets/os_quick_report.php @@ -133,6 +133,7 @@ class OsQuickReportWidget extends Widget // Includes. enterprise_include_once('/include/functions_services.php'); enterprise_include_once('/include/functions_servicemap.php'); + include_once $config['homedir'].'/include/functions_os.php'; // WARNING: Do not edit. This chunk must be in the constructor. parent::__construct( diff --git a/pandora_console/include/rest-api/models/VisualConsole/Item.php b/pandora_console/include/rest-api/models/VisualConsole/Item.php index 89d3edd144..ad3e01e0ac 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Item.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Item.php @@ -1865,6 +1865,10 @@ class Item extends CachedModel $save = array_merge($dataModelEncode, $dataEncode); + if (!empty($save['label'])) { + $save['label'] = io_safe_output(io_safe_input(str_replace("'", "\'", $save['label']))); + } + $result = \db_process_sql_update( 'tlayout_data', $save, diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/Label.php b/pandora_console/include/rest-api/models/VisualConsole/Items/Label.php index f02e136a18..c1672f10ac 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/Label.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/Label.php @@ -90,11 +90,11 @@ final class Label extends Item // Default values. if (isset($values['width']) === false) { - $values['width'] = 10; + $values['width'] = 50; } if (isset($values['height']) === false) { - $values['height'] = 10; + $values['height'] = 50; } return $values; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 8e7a4f817c..b5875c2207 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -12240,3 +12240,8 @@ div.parent_graph > p.legend_background > table > tbody > tr { .toggle-traffic-graph { margin: 0px !important; } + +div#visual-console-container * { + font-size: unset; + line-height: unset; +} diff --git a/pandora_console/install.php b/pandora_console/install.php index 8baec4cc82..36eac431a0 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@