Merge branch 'develop' into ent-11807-security-hardening-console-informes

This commit is contained in:
Daniel Cebrian 2023-08-29 10:30:05 +02:00
commit 77c7694082
137 changed files with 25970 additions and 709 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, AIX version
# Version 7.0NG.773.2, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, FreeBSD Version
# Version 7.0NG.773.2, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, HP-UX Version
# Version 7.0NG.773.2, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, GNU/Linux
# Version 7.0NG.773.2, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, GNU/Linux
# Version 7.0NG.773.2, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, Solaris Version
# Version 7.0NG.773.2, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS
# Version 7.0NG.773
# Version 7.0NG.773.2
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.773, AIX version
# Version 7.0NG.773.2, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.773
# Version 7.0NG.773.2
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.773, HPUX Version
# Version 7.0NG.773.2, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773
# Version 7.0NG.773.2
# Licensed under GPL license v2,
# (c) 2003-2023 Pandora FMS
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773
# Version 7.0NG.773.2
# Licensed under GPL license v2,
# (c) 2003-2023 Pandora FMS
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773
# Version 7.0NG.773.2
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.773, Solaris version
# Version 7.0NG.773.2, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, AIX version
# Version 7.0NG.773.2, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.773-230818
Version: 7.0NG.773.2-230829
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.773-230818"
pandora_version="7.0NG.773.2-230829"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -31,7 +31,7 @@ fi
if [ "$#" -ge 2 ]; then
VERSION="$2"
else
VERSION="7.0NG.773"
VERSION="7.0NG.773.2"
fi
# Path for the generated DMG file

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773.2" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773.2" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" />
<script>
<![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.773</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.773 Pandora FMS on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.773</string>
<key>CFBundleVersion</key> <string>7.0NG.773.2</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.773.2 Pandora FMS on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.773.2</string>
<key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, GNU/Linux
# Version 7.0NG.773.2, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, FreeBSD Version
# Version 7.0NG.773.2, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, HP-UX Version
# Version 7.0NG.773.2, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773
# Version 7.0NG.773.2
# Licensed under GPL license v2,
# Copyright (c) 2004-2023 Pandora FMS
# https://pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, GNU/Linux
# Version 7.0NG.773.2, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, NetBSD Version
# Version 7.0NG.773.2, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773, Solaris Version
# Version 7.0NG.773.2, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1030,8 +1030,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.773';
use constant AGENT_BUILD => '230818';
use constant AGENT_VERSION => '7.0NG.773.2';
use constant AGENT_BUILD => '230829';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773
%define release 230818
%define version 7.0NG.773.2
%define release 230829
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
@ -25,7 +25,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
Requires: coreutils unzip
Requires: util-linux procps grep
Requires: /sbin/ip /bin/awk
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip)
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip) perl(File::Copy) perl(Sys::Hostname)
# Required by plugins
#Requires: sh-utils sed passwd net-tools rpm
AutoReq: 0

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773
%define version 7.0NG.773.2
%define release 230725
Summary: Pandora FMS Linux agent, binary version
@ -26,9 +26,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
Requires: coreutils unzip
Requires: util-linux procps grep
Requires: /sbin/ip /bin/awk
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip)
# Required by plugins
#Requires: sh-utils sed passwd net-tools rpm
#Requires: libnsl
AutoReq: 0
Provides: %{name}-%{version}

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773
%define release 230818
%define version 7.0NG.773.2
%define release 230829
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.773"
PI_BUILD="230818"
PI_VERSION="7.0NG.773.2"
PI_BUILD="230829"
OS_NAME=`uname -s`
FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS
# Version 7.0NG.773
# Version 7.0NG.773.2
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version
@ -522,4 +522,11 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default
#module_type generic_data_string
#module_exec echo Bordón
#module_native_encoding OEM
#module_end
#module_end
# Hardening plugin for security compliance analysis.
#module_begin
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_sca.exe"
#module_absoluteinterval 7d
#module_end

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d93bd9d56c938063045fa2093198d324746f84df2b74567648f3baebd635657
size 5248006

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.773}
{Pandora FMS Windows Agent v7.0NG.773.2}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230818}
{230829}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.773 Build 230818")
#define PANDORA_VERSION ("7.0NG.773.2 Build 230829")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.773(Build 230818))"
VALUE "ProductVersion", "(7.0NG.773.2(Build 230829))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.773-230818
Version: 7.0NG.773.2-230829
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.773-230818"
pandora_version="7.0NG.773.2-230829"
package_pear=0
package_pandora=1

View File

@ -261,12 +261,27 @@ function agents_modules_load_js()
}
function select_selected () {
// $('#id_agents2 option').each(function(){
// if($(this).attr('selected') === 'selected'){
// $(this).prop('selected', true);
// }
// });
var f = document.forms.filter_form;
f.action = "index.php?sec=view&sec2=extensions/agents_modules";
$('#filter_form').submit();
}
/* <![CDATA[ */
function export_csv() {
let group_id = $('#group_id option:selected').val();
let module_group_id = $('#modulegroup option:selected').val();
let agent_id = $('#id_agents2 option:selected').map((_, e) => e.value).get();
let module_id = $('#module option:selected').map((_, e) => e.value).get();
let filters_array = {group_id: group_id, module_group_id:module_group_id, agent_id:agent_id, module_id:module_id}
let jsonFilters = JSON.stringify(filters_array)
let filters = window.btoa(jsonFilters)
var f = document.forms.filter_form;
blockResubmit($(this));
f.action = "extensions/agents_modules_csv.php?get_agents_module_csv=1&filters="+filters;
$("#filter_form").submit();
}
/* ]]> */
</script>
<?php
}
@ -653,7 +668,7 @@ function mainAgentsModules()
}
if ($config['pure'] != 1) {
$show_filters = '<form method="post" action="index.php?sec=view&sec2=extensions/agents_modules" class="w100p">';
$show_filters = '<form id="filter_form" method="post" action="index.php?sec=view&sec2=extensions/agents_modules" class="w100p">';
$show_filters .= '<table class="filter-table-adv w100p no-border" cellpadding="4" cellspacing="4">';
$show_filters .= '<tr>';
$show_filters .= '<td width="33%">'.$filter_type.'</td>';
@ -679,6 +694,13 @@ function mainAgentsModules()
'onclick' => 'select_selected()',
],
true
).html_print_button(
__('Export to CSV'),
'srcbutton_csv',
false,
'export_csv()',
['class' => 'secondary mini'],
true,
),
],
true

View File

@ -0,0 +1,118 @@
<?php
/**
* Export data.
*
* @category Tools
* @package Pandora FMS
* @subpackage Operation
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Pandora FMS
* Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
global $config;
if (true) {
include_once '../include/config.php';
include_once '../include/functions_agents.php';
include_once '../include/functions_reporting.php';
include_once '../include/functions_modules.php';
include_once '../include/functions_users.php';
include_once $config['homedir'].'/include/config.php';
include_once $config['homedir'].'/include/functions_agents.php';
include_once $config['homedir'].'/include/functions_reporting.php';
include_once $config['homedir'].'/include/functions_modules.php';
include_once $config['homedir'].'/include/functions_users.php';
}
check_login();
// ACL Check.
if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Agent view (Grouped)'
);
include 'general/noaccess.php';
exit;
}
$get_agents_module_csv = get_parameter('get_agents_module_csv', 0);
if ($get_agents_module_csv === '1') {
// ***************************************************
// Header output
// ***************************************************
$config['ignore_callback'] = true;
while (@ob_end_clean()) {
}
$filename = 'agents_module_view_'.date('Ymd').'-'.date('His');
// Set cookie for download control.
setDownloadCookieToken();
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="'.$filename.'.csv"');
// ***************************************************
// Data processing
// ***************************************************
echo pack('C*', 0xEF, 0xBB, 0xBF);
$json_filters = get_parameter('filters', '');
$filters = json_decode(
base64_decode(
get_parameter('filters', '')
),
true
);
$results = export_agents_module_csv($filters);
$divider = $config['csv_divider'];
$dataend = PHP_EOL;
$header_fields = [
__('Agent'),
__('Module'),
__('Data'),
];
$out_csv = '';
foreach ($header_fields as $key => $value) {
$out_csv .= $value.$divider;
}
$out_csv .= "\n";
foreach ($results as $result) {
foreach ($result as $key => $value) {
$out_csv .= io_safe_output($value).$divider;
}
$out_csv .= "\n";
}
echo io_safe_output($out_csv);
exit;
}

View File

@ -366,59 +366,37 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
$header_autorefresh_counter .= '</div>';
}
// Button for feedback pandora.
if (enterprise_installed() && $config['activate_feedback']) {
$header_feedback = '<div id="feedback-icon-header">';
$header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>';
$header_feedback .= '<div id="msg-header" class="invisible"></div>';
$header_feedback .= html_print_image(
'images/send_feedback@header.svg',
true,
[
'class' => 'main_menu_icon invert_filter',
'title' => __('Feedback'),
'id' => 'feedback-header',
'alt' => __('Feedback'),
'style' => 'cursor: pointer;',
]
);
$header_feedback .= '</div>';
}
// Support.
if (enterprise_installed()) {
$header_support_link = $config['custom_support_url'];
$modal_box = '<div id="modal_help" class="invisible">
<div id="modal-feedback-form" class="invisible"></div>
<div id="msg-header" class="invisible"></div>
<a href="https://pandorafms.com/manual" target="_blank">'.__('Pandora documentation').'</a>';
if (enterprise_installed() === true) {
$modal_box .= '<a href="https://support.pandorafms.com/" target="_blank">'.__('Enterprise support ').'</a>';
$modal_box .= '<a href="#" id="feedback-header">'.__('Give us feedback').'</a>';
} else {
$header_support_link = 'https://pandorafms.com/forums/';
$modal_box .= '<a href="https://pandorafms.com/community/forums/" target="_blank">'.__('Community Support').'</a>';
}
$header_support = '<div id="header_support">';
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">';
$header_support .= html_print_image(
'images/support@header.svg',
true,
[
'title' => __('Go to support'),
'class' => 'main_menu_icon bot invert_filter',
'alt' => 'user',
]
);
$header_support .= '</a></div>';
$modal_box .= '<hr class="separator" />';
$modal_box .= '<a href="https://github.com/pandorafms/pandorafms/issues" target="_blank">'.__('Open an issue in Github').'</a>';
$modal_box .= '<a href="https://discord.com/invite/xVt2ruSxmr" target="_blank">'.__('Join discord community').'</a>';
$modal_box .= '</div>';
// Documentation.
$header_docu = '<div id="header_docu">';
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">';
$header_docu .= html_print_image(
'images/documentation@header.svg',
true,
$modal_help = html_print_div(
[
'title' => __('Go to documentation'),
'class' => 'main_menu_icon bot invert_filter',
'alt' => 'user',
]
'id' => 'modal-help-content',
'content' => html_print_image(
'images/help@header.svg',
true,
[
'title' => __('Help'),
'class' => 'main_menu_icon bot invert_filter',
'alt' => 'user',
]
).$modal_box,
],
true,
);
$header_docu .= '</a></div>';
// User.
@ -472,11 +450,11 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
echo '</span>';
echo '</div>';
echo '<div class="header_center"></div>';
echo '<div class="header_right">'.$header_support, $header_docu, $header_user, $header_logout.'</div>';
echo '<div class="header_right">'.$modal_help, $header_user, $header_logout.'</div>';
} else {
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
<div class="header_center">'.$header_searchbar.'</div>
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $modal_help, $header_user, $header_logout.'</div>';
}
?>
</div> <!-- Closes #table_header_inner -->
@ -554,6 +532,54 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
element.style.display = "none"
}
function notifications_clean_all() {
let wrapper_inner = document.getElementById('notification-wrapper-inner');
while (wrapper_inner.firstChild) {
wrapper_inner.removeChild(wrapper_inner.firstChild);
}
}
function mark_all_notification_as_read() {
jQuery.post ("ajax.php",
{
"page" : "godmode/setup/setup_notifications",
"mark_all_notification_as_read" : 1
},
function (data, status) {
notifications_clean_all();
location.reload();
},
"json"
)
.fail(function(xhr, textStatus, errorThrown){
console.error(
"Failed to mark al notification as read. Error: ",
xhr.responseText
);
});
}
function filter_notification() {
let notification_type = '';
$('.notification-item').hide();
$(".checkbox_filter_notifications:checkbox:checked").each(function() {
notification_type = $(this).val();
console.log(notification_type);
$('.notification-item[value='+notification_type+']').show();
if (notification_type == 'All'){
$('.notification-item').show();
}
});
if (notification_type == 'All'){
$('.notification-item').show();
}
if (notification_type == ''){
$('.notification-item').hide();
}
}
function click_on_notification_toast(event) {
var match = /notification-(.*)-id-([0-9]+)/.exec(event.target.id);
if (!match) {
@ -960,8 +986,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
<?php if (enterprise_installed()) { ?>
// Feedback.
$("#feedback-header").click(function () {
// Clean DOM.
$("#feedback-header").empty();
// Function charge Modal.
show_feedback();
});
@ -1067,6 +1091,22 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
return false;
});
$(document).click(function(event) {
if (!$(event.target).closest('#modal-help-content').length &&
$('#modal_help').hasClass('invisible') === false) {
$('#modal_help').addClass('invisible');
}
});
$('#modal-help-content').on('click', (e) => {
if($(e.target).prop('tagName') === 'A') {
$('#modal_help').addClass('invisible');
} else {
$('#modal_help').removeClass('invisible');
}
});
});
/* ]]> */
</script>

View File

@ -30,7 +30,7 @@ require_once __DIR__.'/../include/functions_html.php';
echo '<style>
:root {';
if ($config['style'] === 'pandora') {
echo '--login-background-color: rgba(255, 255, 255, 0.4);';
echo '--login-background-color: rgba(255, 255, 255, 0.50);';
echo '--login-label-color: #545454;';
echo '--login-text-color: #000;';
$style_theme = 'white-theme';
@ -237,16 +237,18 @@ if (is_metaconsole() === true) {
);
}
} else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'enterprise/images/custom_logo_login/'.$config['custom_logo_login'];
if (!isset($config['custom_logo_login'])) {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/'.$config['custom_logo_login']), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
} else {
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'images/custom_logo_login/'.$config['custom_logo_login'];
if (empty($config['custom_logo_login']) === true) {
html_print_image(ui_get_full_url('images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else {
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
}

View File

@ -1558,7 +1558,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
$all_modules = true;
}
if ($all_common_modules === true) {
if ($all_common_modules === true || $all_modules === true) {
$module_names = explode(',', get_parameter('all_common_modules'));
}
@ -1602,7 +1602,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
foreach ($agents as $agent_id) {
$agent_id = (int) $agent_id;
// Check module belongs to the agent.
if ($modules_selection_mode == 'all' && $all_modules === false) {
if ($modules_selection_mode == 'all' && ($all_modules === false || $all_modules === true)) {
$check = false;
foreach ($module_names as $module_name) {
$check_module = modules_get_agentmodule_id(
@ -1666,7 +1666,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
);
}
if ($result !== false && (bool) $all_modules === false) {
if ($result !== false && ((bool) $all_modules === false || (bool) $all_modules === true)) {
foreach ($module_names as $module_name) {
$module = modules_get_agentmodule_id(
$module_name,

View File

@ -190,14 +190,21 @@ $output .= html_print_label_input_block(
html_print_extended_select_for_time(
'period',
$period,
'',
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'',
'0',
false,
true,
false,
false,
'w100p'
'w100p',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
)
);
$output .= "</td><td class='datos2' width='50%'>";

View File

@ -1470,10 +1470,21 @@ $class = 'databox filters';
html_print_extended_select_for_time(
'period',
$period,
'',
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'',
'0',
10
10,
false,
false,
true,
'',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
);
?>
</td>
@ -1493,10 +1504,21 @@ $class = 'databox filters';
html_print_extended_select_for_time(
'period_range',
$period_range,
'',
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'',
'0',
10
10,
false,
false,
true,
'',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'period_range\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
);
?>
</td>
@ -1536,10 +1558,21 @@ $class = 'databox filters';
html_print_extended_select_for_time(
'period1',
$period_pg,
'',
'check_period_warning(this)',
'',
'0',
10
10,
false,
false,
true,
'',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'period\')'
);
?>
</td>
@ -1555,10 +1588,21 @@ $class = 'databox filters';
html_print_extended_select_for_time(
'period2',
$projection_period,
'',
'check_period_warning(this)',
'',
'0',
10
10,
false,
false,
true,
'',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'period\')'
);
?>
</td>
@ -3489,7 +3533,7 @@ $class = 'databox filters';
html_print_extended_select_for_time(
'lapse',
$lapse,
'',
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
__('None'),
'0',
10,
@ -3497,7 +3541,13 @@ $class = 'databox filters';
'',
'',
'',
!$lapse_calc
!$lapse_calc,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'lapse\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
);
?>
</td>

View File

@ -555,6 +555,7 @@ switch ($activeTab) {
$type = (int) get_parameter('type', STATIC_GRAPH);
$image = get_parameter('image');
$range = (int) get_parameter('range', 50);
$range_vertical = (int) get_parameter('range_vertical', 50);
$width = (int) get_parameter('width', 0);
$height = (int) get_parameter('height', 0);
$period = (int) get_parameter('period', 0);
@ -567,6 +568,9 @@ switch ($activeTab) {
$label_type = get_parameter('label_type', 'agent_module');
$enable_link = get_parameter('enable_link', 'enable_link');
$show_on_top = get_parameter('show_on_top', 0);
$pos_x = get_parameter('pos_x', 0);
$pos_y = get_parameter('pos_y', 0);
$max_elements_row = (int) get_parameter('max_elements_row', 0);
// This var switch between creation of items, item_per_agent = 0 => item per module; item_per_agent <> 0 => item per agent
$item_per_agent = get_parameter('item_per_agent', 0);
@ -611,6 +615,7 @@ switch ($activeTab) {
$image,
$idVisualConsole,
$range,
$range_vertical,
$width,
$height,
$period,
@ -626,7 +631,10 @@ switch ($activeTab) {
$kind_relationship,
$item_in_the_map,
$fontf,
$fonts
$fonts,
$pos_x,
$pos_y,
$max_elements_row
);
$statusProcessInDB = [
@ -668,6 +676,7 @@ switch ($activeTab) {
$image,
$idVisualConsole,
$range,
$range_vertical,
$width,
$height,
$period,
@ -683,7 +692,10 @@ switch ($activeTab) {
$kind_relationship,
$item_in_the_map,
$fontf,
$fonts
$fonts,
$pos_x,
$pos_y,
$max_elements_row
);
} else {
$id_modules = [];
@ -722,6 +734,7 @@ switch ($activeTab) {
$image,
$idVisualConsole,
$range,
$range_vertical,
$width,
$height,
$period,
@ -737,7 +750,10 @@ switch ($activeTab) {
$kind_relationship,
$item_in_the_map,
$fontf,
$fonts
$fonts,
$pos_x,
$pos_y,
$max_elements_row
);
}
}

View File

@ -144,22 +144,28 @@ $table->data['all_0'][0] = html_print_label_input_block(
$table->rowstyle['staticgraph'] = 'display: none;';
$table->colspan['staticgraph'][0] = 2;
$table->data['staticgraph'][0] = html_print_label_input_block(
__('Image'),
html_print_select(
'<div class="flex">'.html_print_select(
$images_list,
'image',
'',
'',
'',
'',
true
)
true,
false,
true,
'',
false,
'width: 49%'
).'<span id="image_prev" class="mrgn_lft_10px mrgn_top-10px"><img src="'.$config['homeurl'].'/images/console/icons/appliance_ok.png"></span></div>'
);
$table->rowstyle['all_1'] = 'display: none;';
$table->data['all_1'][0] = html_print_label_input_block(
__('Range between elements (px)'),
__('Horizontal range between elements (px)'),
html_print_input_text(
'range',
50,
@ -170,6 +176,18 @@ $table->data['all_1'][0] = html_print_label_input_block(
)
);
$table->data['all_1'][1] = html_print_label_input_block(
__('Vertical range between elements (px)'),
html_print_input_text(
'range_vertical',
50,
'',
5,
5,
true
)
);
$input_size = __('Width').': ';
$input_size .= html_print_input_text('width', 0, '', 5, 5, true);
$input_size .= __('Height').': ';
@ -425,6 +443,16 @@ if (is_metaconsole() === false) {
);
}
$table->data['all_4_01'][0] = html_print_label_input_block(
__('Filter agents'),
html_print_input_text('filter_agents', '', '', false, 255, true)
);
$table->data['all_4_01'][1] = html_print_label_input_block(
__('Filter modules'),
html_print_input_text('filter_modules', '', '', false, 255, true)
);
$table->rowstyle['all_4'] = 'display: none;';
$table->data['all_4'][0] = html_print_label_input_block(
__('Agents').ui_print_help_tip(
@ -549,6 +577,16 @@ $table->data['all_8'][1] = html_print_label_input_block(
).'</span>'
);
$table->data['all_10'][0] = html_print_label_input_block(
__('Max. elements for row'),
html_print_input_text('max_elements_row', 0, '', false, 255, true)
);
$table->data['all_10'][1] = html_print_label_input_block(
__('Position'),
'<div class="flex_center"><span class="mrgn_right_10px">X</span>'.html_print_input_text('pos_x', 0, '', false, 255, true, false, false, '', 'w50p').'<span class="margin-lr-10">Y</span>'.html_print_input_text('pos_y', 0, '', false, 255, true, false, false, '', 'w50p').'</div>'
);
if (is_metaconsole() === true) {
$pure = get_parameter('pure', 0);
@ -831,6 +869,44 @@ function item_per_agent_change(itemPerAgent) {
function metaconsole_init() {
$("#groups").change();
}
$('#text-filter_agents').on('keyup',function(){
if ($(this).val() !== ''){
findInSelect('id_agents',$(this).val());
} else {
$('#id_agents option').each(function(){
$(this).removeClass('invisible');
});
}
});
$('#text-filter_modules').on('keyup',function(){
if ($(this).val() !== ''){
findInSelect('module',$(this).val());
} else {
$('#module option').each(function(){
$(this).removeClass('invisible');
});
}
});
function findInSelect(selectid, find){
var select = $('#'+selectid+' option');
select.each(function(){
var regex = new RegExp(find, "gi");
if ($(this).html().match(regex) === null) {
$(this).addClass('invisible');
} else {
$(this).removeClass('invisible');
}
})
}
$('#image').on('change', function(){
var img = $(this).val();
$('#image_prev').html('<img src="<?php echo $config['homeurl']; ?>/images/console/icons/'+img+'.png">');
})
</script>
<style type="text/css">
select[name='kind_relationship'] option[disabled='disabled'] {

View File

@ -24,6 +24,14 @@ if (! check_acl($config['id_user'], 0, 'AR')
ui_require_css_file('discovery');
ui_require_javascript_file('pandora_alerts');
ui_include_time_picker();
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_css_file('main.min', 'include/javascript/fullcalendar/');
ui_require_javascript_file('main.min', 'include/javascript/fullcalendar/');
ui_require_javascript_file('pandora_fullcalendar');
/**
* Mask class names.
@ -204,3 +212,115 @@ if ($classname_selected === null) {
Wizard::printBigButtonsList($wiz_data);
}
$is_management_allowed = is_management_allowed();
$task_id = get_parameter('task', '');
if ($task_id !== '') {
$task = db_get_row_filter(
'tuser_task_scheduled',
['id' => $task_id]
);
$args = unserialize($task['args']);
$event_calendar = io_safe_output($args['weekly_schedule']);
} else {
$event_calendar = '{"monday":[{"start":"00:00:00","end":"00:00:00"}],"tuesday":[{"start":"00:00:00","end":"00:00:00"}],"wednesday":[{"start":"00:00:00","end":"00:00:00"}],"thursday":[{"start":"00:00:00","end":"00:00:00"}],"friday":[{"start":"00:00:00","end":"00:00:00"}],"saturday":[{"start":"00:00:00","end":"00:00:00"}],"sunday":[{"start":"00:00:00","end":"00:00:00"}]}';
}
?>
<script type="text/javascript">
$(document).ready (function () {
$("#table-new-job-3").hide();
var edit = '<?php echo $task_id; ?>';
if (edit != '') {
exec_calendar();
}
$("#scheduled").change(exec_calendar);
function exec_calendar() {
if ($("#scheduled").val() == "weekly") {
var is_management_allowed = parseInt('<?php echo (int) $is_management_allowed; ?>');
var eventsBBDD = '<?php echo $event_calendar; ?>';
var events = loadEventBBDD(eventsBBDD);
var calendarEl = document.getElementById('calendar_map');
var options = {
contentHeight: "auto",
headerToolbar: {
left: "",
center: "",
right: is_management_allowed === 0 ? '' : "timeGridWeek,dayGridWeek"
},
buttonText: {
dayGridWeek: '<?php echo __('Simple'); ?>',
timeGridWeek: '<?php echo __('Detailed'); ?>'
},
dayHeaderFormat: { weekday: "short" },
initialView: "dayGridWeek",
navLinks: false,
selectable: true,
selectMirror: true,
slotDuration: "01:00:00",
slotLabelInterval: "02:00:00",
snapDuration: "01:00:00",
slotMinTime: "00:00:00",
slotMaxTime: "24:00:00",
scrollTime: "01:00:00",
locale: "en-GB",
firstDay: 1,
eventTimeFormat: {
hour: "numeric",
minute: "2-digit",
hour12: false
},
eventColor: "#82b92e",
editable: is_management_allowed === 0 ? false : true,
dayMaxEvents: 3,
dayPopoverFormat: { weekday: "long" },
defaultAllDay: false,
displayEventTime: true,
displayEventEnd: true,
selectOverlap: false,
eventOverlap: false,
allDaySlot: true,
droppable: false,
select: is_management_allowed === 0 ? false : select_alert_template,
selectAllow: is_management_allowed === 0 ? false : selectAllow_alert_template,
eventAllow: is_management_allowed === 0 ? false : eventAllow_alert_template,
eventDrop: is_management_allowed === 0 ? false : eventDrop_alert_template,
eventDragStop: is_management_allowed === 0 ? false : eventDragStop_alert_template,
eventResize: is_management_allowed === 0 ? false : eventResize_alert_template,
eventMouseEnter: is_management_allowed === 0 ? false : eventMouseEnter_alert_template,
eventMouseLeave: is_management_allowed === 0 ? false : eventMouseLeave_alert_template,
eventClick: is_management_allowed === 0 ? false : eventClick_alert_template,
};
var settings = {
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
timeText: '<?php echo __('Time'); ?>',
hourText: '<?php echo __('Hour'); ?>',
minuteText: '<?php echo __('Minute'); ?>',
secondText: '<?php echo __('Second'); ?>',
currentText: '<?php echo __('Now'); ?>',
closeText: '<?php echo __('Close'); ?>',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
removeText: '<?php echo __('Remove'); ?>',
userLanguage: '<?php echo get_user_language(); ?>',
loadingText: '<?php echo __('Loading, this operation might take several minutes...'); ?>',
tooltipText: '<?php echo __('Drag out to remove'); ?>',
alert: '<?php echo __('Alert'); ?>'
}
var calendar = fullCalendarPandora(calendarEl, options, settings, events);
calendar.render();
$("#table-new-job-3").show();
$('.fc-event-title').hide();
$(".fc-button-active" ).trigger( "click" );
} else {
$("#calendar_map").html();
$("#table-new-job-3").hide();
}
}
});
</script>

View File

@ -187,6 +187,27 @@ if (get_parameter('mark_notification_as_read', 0)) {
return;
}
if (get_parameter('mark_all_notification_as_read', 0)) {
$unread_messages = db_get_all_rows_sql('SELECT id_mensaje FROM tnotification_user WHERE utimestamp_read is NULL');
if ($unread_messages !== false) {
foreach ($unread_messages as $messages) {
messages_process_read($messages['id_mensaje']);
}
$result = true;
} else {
$result = false;
}
// If there is new messages, get the info.
echo json_encode(
['result' => $result]
);
return;
}
if (get_parameter('get_notifications_dropdown', 0)) {
echo notifications_print_dropdown();
return;

View File

@ -592,6 +592,9 @@ $userManagementTable->data['line2_looknfeel'][0] = html_print_select_from_sql(
true
);
// Hidden hint to change theme.
$hin_change_theme = ui_print_help_tip(__('When changing the theme, the login screen logo will be restricted to the default for that color scheme, if you have a custom logo, adjust it after changing the theme.'), true, '', '', 'display: none;');
if (is_metaconsole() === true) {
if (users_is_admin() === true) {
$userManagementTable->data['line1_looknfeel'][1] = $outputMetaAccess[0];
@ -599,7 +602,7 @@ if (is_metaconsole() === true) {
}
} else {
if (function_exists('skins_print_select')) {
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme');
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme').$hin_change_theme;
$userManagementTable->data['line2_looknfeel'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
}
}
@ -817,5 +820,10 @@ $(document).ready(function () {
128,
128
);
//Hint to change theme.
$('#skin1').on("change", () => {
$('#advanced-line1_looknfeel-1 > a').css('display', 'block');
})
});
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>help_pandora</title>
<g id="help_pandora" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,0 C15.4050388,0 20,1.5951272 20,5.39448104 L20,14.605519 C20,18.4048728 15.4050388,20 10,20 C4.59496118,20 0,18.4048728 0,14.605519 L0,5.39448104 C0,1.5951272 4.59496118,0 10,0 Z M9.79831933,13.1716621 C8.99159664,13.1716621 8.35294118,13.8092643 8.35294118,14.5940054 C8.35294118,15.3623978 8.99159664,16 9.79831933,16 C10.605042,16 11.2605042,15.3623978 11.2605042,14.5940054 C11.2605042,13.8092643 10.605042,13.1716621 9.79831933,13.1716621 Z M9.91596639,4 C7.46218487,4 6,5.61852861 6,7.53133515 C6,7.74386921 6.01680672,7.98910082 6.06722689,8.21798365 L8.42016807,8.29972752 C8.40336134,8.23433243 8.3697479,8.07084469 8.3697479,7.69482289 C8.3697479,6.92643052 8.94117647,6.15803815 9.91596639,6.15803815 C10.9243697,6.15803815 11.4117647,6.77929155 11.4117647,7.41689373 C11.4117647,7.84196185 11.2605042,8.23433243 10.8067227,8.5613079 L9.94957983,9.18256131 C8.99159664,9.88555858 8.67226891,10.719346 8.67226891,11.4877384 C8.67226891,11.7493188 8.68907563,11.9782016 8.7394958,12.2070845 L10.7394958,12.2070845 C10.7394958,11.4713896 11.1428571,11.0463215 11.7310924,10.6212534 L12.3697479,10.1634877 C13.3781513,9.42779292 14,8.52861035 14,7.22070845 C14,5.58583106 12.6386555,4 9.91596639,4 Z" id="Mask" fill="#3F3F3F"></path>
<g id="?" transform="translate(6, 4)"></g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1444,6 +1444,7 @@ if ($add_comment === true) {
if ($change_status === true) {
$event_ids = get_parameter('event_ids');
$new_status = get_parameter('new_status');
$group_rep = (int) get_parameter('group_rep', 0);
$server_id = 0;
if (is_metaconsole() === true) {
$server_id = (int) get_parameter('server_id');
@ -1457,10 +1458,19 @@ if ($change_status === true) {
$node->connect();
}
$return = events_change_status(
explode(',', $event_ids),
$new_status
);
if ($group_rep !== 3) {
$return = events_change_status(
explode(',', $event_ids),
$new_status
);
} else {
// Update all elements with same extraid.
$return = events_update_status(
$event_ids,
(int) $new_status,
['group_rep' => $group_rep]
);
}
} catch (\Exception $e) {
// Unexistent agent.
if (is_metaconsole() === true

View File

@ -169,6 +169,7 @@ class ConsoleSupervisor
* NOTIF.PHP.DISABLE_FUNCTIONS
* NOTIF.PHP.CHROMIUM
* NOTIF.PHP.VERSION
* NOTIF.PHP.VERSION.SUPPORT
*/
$this->checkPHPSettings();
@ -210,6 +211,12 @@ class ConsoleSupervisor
$this->checkUpdateManagerRegistration();
/*
* Check if has API access.
* NOTIF.API.ACCESS
*/
$this->checkApiAccess();
/*
* Check if there're new messages in UM.
* NOTIF.UPDATEMANAGER.MESSAGES
@ -377,6 +384,7 @@ class ConsoleSupervisor
* NOTIF.PHP.DISABLE_FUNCTIONS
* NOTIF.PHP.CHROMIUM
* NOTIF.PHP.VERSION
* NOTIF.PHP.VERSION.SUPPORT
*/
$this->checkPHPSettings();
@ -434,6 +442,12 @@ class ConsoleSupervisor
$this->checkUpdateManagerRegistration();
/*
* Check if has API access.
* NOTIF.API.ACCESS
*/
$this->checkApiAccess();
/*
* Check if event storm protection is activated.
* NOTIF.MISC.EVENTSTORMPROTECTION
@ -498,6 +512,12 @@ class ConsoleSupervisor
$this->checkUpdateManagerRegistration();
/*
* Check if has API access.
* NOTIF.API.ACCESS
*/
$this->checkApiAccess();
/*
* Check if there're new messages in UM.
* NOTIF.UPDATEMANAGER.MESSAGES
@ -856,6 +876,7 @@ class ConsoleSupervisor
case 'NOTIF.PHP.DISABLE_FUNCTIONS':
case 'NOTIF.PHP.CHROMIUM':
case 'NOTIF.PHP.VERSION':
case 'NOTIF.PHP.VERSION.SUPPORT':
case 'NOTIF.HISTORYDB':
case 'NOTIF.PANDORADB':
case 'NOTIF.PANDORADB.HISTORICAL':
@ -864,6 +885,7 @@ class ConsoleSupervisor
case 'NOTIF.METACONSOLE.DB_CONNECTION':
case 'NOTIF.DOWNTIME':
case 'NOTIF.UPDATEMANAGER.REGISTRATION':
case 'NOTIF.API.ACCESS':
case 'NOTIF.MISC.EVENTSTORMPROTECTION':
case 'NOTIF.MISC.DEVELOPBYPASS':
case 'NOTIF.MISC.FONTPATH':
@ -1811,14 +1833,14 @@ class ConsoleSupervisor
$url = 'https://www.php.net/supported-versions.php';
$this->notify(
[
'type' => 'NOTIF.PHP.VERSION',
'type' => 'NOTIF.PHP.VERSION.SUPPORT',
'title' => __('PHP UPDATE REQUIRED'),
'message' => __('You should update your PHP version because it will be out of official support').'<br>'.__('Current PHP version: ').PHP_VERSION,
'url' => $url,
]
);
} else {
$this->cleanNotifications('NOTIF.PHP.VERSION');
$this->cleanNotifications('NOTIF.PHP.VERSION.SUPPORT');
}
}
@ -2366,6 +2388,30 @@ class ConsoleSupervisor
}
/**
* Check if has access to the API
*
* @return void
*/
public function checkApiAccess()
{
global $config;
include_once $config['homedir'].'/include/functions_update_manager.php';
if (update_manager_verify_api() === false) {
$this->notify(
[
'type' => 'NOTIF.API.ACCESS',
'title' => __('Cannot access the Pandora FMS API '),
'message' => __('Please check the configuration, some components may fail due to this misconfiguration.'),
]
);
} else {
$this->cleanNotifications('NOTIF.API.ACCESS');
}
}
/**
* Check if user 'admin' is enabled and using default password.
*

View File

@ -542,13 +542,21 @@ class CustomNetScan extends Wizard
'extra' => '<span id="interval_manual_container">'.html_print_extended_select_for_time(
'interval',
$this->task['interval_sweep'],
'',
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'',
'0',
false,
true,
false,
false
false,
'',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'interval\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
).'</span>',
];

View File

@ -122,10 +122,11 @@ class Tree
public function setFilter($filter)
{
// There is not module filter in metaconsole.
if (is_metaconsole()) {
/*
if (is_metaconsole()) {
$filter['searchModule'] = '';
$filter['statusModule'] = self::TV_DEFAULT_AGENT_STATUS;
}
}*/
$this->filter = $filter;
}

View File

@ -20,8 +20,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC230818';
$pandora_version = 'v7.0NG.773';
$build_version = 'PC230829';
$pandora_version = 'v7.0NG.773.2';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();

View File

@ -2760,69 +2760,7 @@ function agents_delete_agent($id_agents, $disableACL=false)
enterprise_include_once('include/functions_agents.php');
enterprise_hook('agent_delete_from_cache', [$id_agent]);
// Delete agent from visual console.
db_process_sql_delete(
'tlayout_data',
['id_agent' => $id_agent]
);
// Delete agent from visual dashboards.
db_process_sql(
'UPDATE twidget_dashboard
SET options = NULL
WHERE options LIKE ("%\"agentid\":\"'.$id_agent.'\"%")'
);
// Delete agent from treport.
db_process_sql_delete(
'treport_content',
['id_agent' => $id_agent]
);
// Delete rules from tevent alerts (correlative alerts)
db_process_sql_delete(
'tevent_rule',
[
'agent' => $id_agent,
'operator_agent' => '==',
]
);
db_process_sql_delete(
'tevent_rule',
[
'log_agent' => $id_agent,
'operator_log_agent' => '==',
]
);
// Delete from gis maps history
db_process_sql_delete(
'tgis_data_history',
['tagente_id_agente' => $id_agent]
);
// Delete from policies.
db_process_sql_delete(
'tpolicy_agents',
['id_agent' => $id_agent]
);
// Delete from tnetwork maps
db_process_sql_delete(
'titem',
['source_data' => $id_agent]
);
db_process_sql_delete(
'trel_item',
[
'id_parent_source_data' => $id_agent,
'id_child_source_data' => $id_agent,
],
'OR'
);
// Delete agent from fav menu.
db_process_sql_delete(
'tfavmenu_user',

View File

@ -477,7 +477,7 @@ function events_update_status($id_evento, $status, $filter=null)
{
global $config;
if (!$status) {
if (!$status && $status !== 0) {
return false;
}
@ -1762,11 +1762,9 @@ function events_get_all(
}
}
$string_metaconsole_connections = implode(',', $metaconsole_connections);
$explode_metaconsole_connections = explode(',', $string_metaconsole_connections);
$result_meta = Promise\wait(
parallelMap(
$explode_metaconsole_connections,
$metaconsole_connections,
function ($node_int) use ($sql, $history) {
try {
if (is_metaconsole() === true
@ -3540,11 +3538,15 @@ function events_page_responses($event)
);
if ($status_blocked === false) {
if (isset($event['server_id']) === false) {
$event['server_id'] = '0';
}
$data[2] = html_print_button(
__('Update'),
'status_button',
false,
'event_change_status("'.$event['similar_ids'].'",'.$event['server_id'].');',
'event_change_status("'.$event['similar_ids'].'",'.$event['server_id'].', '.$event['group_rep'].');',
[
'icon' => 'next',
'mode' => 'link',

View File

@ -1744,8 +1744,8 @@ function html_print_select_multiple_modules_filtered(array $data):string
[
'label' => __('Agents'),
'label_class' => 'font-title-font',
'type' => 'select',
'fields' => $agents,
'type' => 'select_from_sql',
'sql' => 'SELECT `id_agente`,`nombre` FROM tagente',
'name' => 'filtered-module-agents-'.$uniqId,
'selected' => explode(',', $data['mAgents']),
'return' => true,
@ -1925,8 +1925,7 @@ function html_print_extended_select_for_unit(
$select_style=false,
$unique_name=true,
$disabled=false,
$no_change=0,
$class='w100p'
$no_change=0
) {
global $config;
@ -1958,7 +1957,7 @@ function html_print_extended_select_for_unit(
ob_start();
echo '<div id="'.$uniq_name.'_default" class="'.$class.' inline_line">';
echo '<div id="'.$uniq_name.'_default" class="w100p inline_line">';
html_print_select(
$fields,
$uniq_name.'_select',
@ -2167,7 +2166,8 @@ function html_print_extended_select_for_time(
$style_icon='',
$no_change=false,
$allow_zero=0,
$units=null
$units=null,
$script_input=''
) {
global $config;
$admin = is_user_admin($config['id_user']);
@ -2257,7 +2257,7 @@ function html_print_extended_select_for_time(
echo '</div>';
echo '<div id="'.$uniq_name.'_manual" class="w100p inline_flex">';
html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class);
html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class, $script_input);
html_print_input_hidden($name, $selected, false, $uniq_name);
html_print_select(
@ -2905,6 +2905,8 @@ function html_print_anchor(
$output .= '>';
$output .= (isset($options['text']) === true) ? $options['text'] : '';
$output .= (isset($options['content']) === true) ? io_safe_input_html($options['content']) : '';
$output .= '</a>';
@ -3964,14 +3966,6 @@ function html_print_table(&$table, $return=false)
}
}
if (isset($table->tdid)) {
foreach ($table->tdid as $keyrow => $tid) {
foreach ($tid as $key => $id) {
$tdid[$keyrow][$key] = $id;
}
}
}
if (isset($table->cellstyle)) {
foreach ($table->cellstyle as $keyrow => $cstyle) {
foreach ($cstyle as $key => $cst) {
@ -4155,10 +4149,6 @@ function html_print_table(&$table, $return=false)
$colspan[$keyrow][$key] = '';
}
if (!isset($tdid[$keyrow][$key])) {
$tdid[$keyrow][$key] = '';
}
if (!isset($rowspan[$keyrow][$key])) {
$rowspan[$keyrow][$key] = '';
}
@ -4179,16 +4169,10 @@ function html_print_table(&$table, $return=false)
$style[$key] = '';
}
if ($tdid[$keyrow][$key] !== '') {
$tid = $tdid[$keyrow][$key];
} else {
$tid = $tableid.'-'.$keyrow.'-'.$key;
}
if ($class === 'datos5' && $key === 1) {
$output .= '<td id="'.$tid.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
$output .= '<td id="'.$tableid.'-'.$keyrow.'-'.$key.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
} else {
$output .= '<td id="'.$tid.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].'" '.$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
$output .= '<td id="'.$tableid.'-'.$keyrow.'-'.$key.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].'" '.$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
}
}
@ -5790,7 +5774,11 @@ function html_print_input($data, $wrapper='div', $input_only=false)
((isset($data['class']) === true) ? $data['class'] : ''),
((isset($data['readonly']) === true) ? $data['readonly'] : false),
((isset($data['custom_fields']) === true) ? $data['custom_fields'] : false),
((isset($data['style_icon']) === true) ? $data['style_icon'] : '')
((isset($data['style_icon']) === true) ? $data['style_icon'] : ''),
((isset($data['no_change']) === true) ? $data['no_change'] : ''),
((isset($data['allow_zero']) === true) ? $data['allow_zero'] : ''),
((isset($data['units']) === true) ? $data['units'] : null),
((isset($data['script_input']) === true) ? $data['script_input'] : '')
);
break;
@ -7137,6 +7125,7 @@ function html_print_menu_button(array $options, bool $return=false)
'class' => ($options['class'] ?? ''),
'style' => ($options['style'] ?? ''),
'onClick' => ($options['onClick'] ?? ''),
'text' => ($options['text'] ?? ''),
'content' => $content,
],
$return

View File

@ -950,11 +950,14 @@ if (is_ajax()) {
$dialog = '
<div id="about-tabs" class="invisible overflow-hidden">
<ul>
<li><a href="#tab-general-view">'.__('Information').'</a></li>
<li><a href="#tab-database">'.__('Database').'</a></li>
<li><a href="#tab-system-info">'.__('System Info').'</a></li>
<li><a href="#tab-php-system">'.__('PHP System').'</a></li>
<li class="ui-tabs-close-button" style="float:right!important;">
<li><a href="#tab-general-view">'.__('Information').'</a></li>';
if ((bool) check_acl($config['id_user'], 0, 'PM') === true || $config['is_admin']['admin'] === true) {
$dialog .= '<li><a href="#tab-database">'.__('Database').'</a></li>
<li><a href="#tab-system-info">'.__('System Info').'</a></li>
<li><a href="#tab-php-system">'.__('PHP System').'</a></li>';
}
$dialog .= '<li class="ui-tabs-close-button" style="float:right!important;">
<img id="about-close" style="cursor: pointer;" src="'.ui_get_full_url('/include/styles/images/dialog-titlebar-close.png', false, false, false).'" alt="'.__('Close').'" title="'.__('Close').'" width="25px">
</li>
</ul>
@ -986,7 +989,7 @@ if (is_ajax()) {
$dialog .= '<p><b><a href="https://pandorafms.com/contact/" target="_blank">'.__('Contact Pandora FMS for official support contract.').'</a></b></p>';
}
if (((bool) check_acl($config['id_user'], 0, 'PM') === true) && (is_metaconsole() === false)) {
if (((bool) check_acl($config['id_user'], 0, 'PM') === true || $config['is_admin']['admin'] === true) && (is_metaconsole() === false)) {
$dialogButtons = [];
$dialogButtons[] = html_print_button(
@ -1028,222 +1031,224 @@ if (is_ajax()) {
</tbody>
</table>
<p class="trademark-copyright">Trademark and copyright 2004 - '.date('Y').' <a href="https://pandorafms.com/" target="_blank">Pandora FMS</a>. All rights reserved</p>
</div>
<div id="tab-database" class="div-scroll">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('Database health status').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_health->data->unknownAgents->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_health->data->unknownAgents->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_health->data->notInitAgents->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_health->data->notInitAgents->value.'</p>
</th>
</tr>
<tr class="about-last-tr">
<th style="width: 50%;">
<p class="about-last-p"><span>'.$db_health->data->pandoraDbLastRun->name.'</span></p>
</th>
<th style="width: 50%;">
<p class="about-last-p" style="font-size: 10pt;">'.$db_health->data->pandoraDbLastRun->value.'</p>
</th>
</tr>
</div>';
if ((bool) check_acl($config['id_user'], 0, 'PM') === true || $config['is_admin']['admin'] === true) {
$dialog .= '<div id="tab-database" class="div-scroll">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('Database health status').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_health->data->unknownAgents->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_health->data->unknownAgents->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_health->data->notInitAgents->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_health->data->notInitAgents->value.'</p>
</th>
</tr>
<tr class="about-last-tr">
<th style="width: 50%;">
<p class="about-last-p"><span>'.$db_health->data->pandoraDbLastRun->name.'</span></p>
</th>
<th style="width: 50%;">
<p class="about-last-p" style="font-size: 10pt;">'.$db_health->data->pandoraDbLastRun->value.'</p>
</th>
</tr>
<tr>
<th colspan="2">
<h2><span> - </span>'.__('Database status info').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeFirstVersion->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeFirstVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeVersion->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeBuild->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeBuild->value.'</p>
</th>
</tr>
<tr class="about-last-tr">
<th style="width: 50%;">
<p class="about-last-p"><span>'.$db_info->data->dbSize->name.'</span></p>
</th>
<th style="width: 50%;">
<p class="about-last-p" style="font-size: 10pt;">'.$db_info->data->dbSize->value.'</p>
</th>
</tr>
<tr>
<th colspan="2">
<h2><span> - </span>'.__('Database status info').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeFirstVersion->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeFirstVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeVersion->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_info->data->dbSchemeBuild->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeBuild->value.'</p>
</th>
</tr>
<tr class="about-last-tr">
<th style="width: 50%;">
<p class="about-last-p"><span>'.$db_info->data->dbSize->name.'</span></p>
</th>
<th style="width: 50%;">
<p class="about-last-p" style="font-size: 10pt;">'.$db_info->data->dbSize->value.'</p>
</th>
</tr>
<tr>
<th colspan="2">
<h2><span> - </span>'.__('Tables fragmentation in the %s database', $product_name).'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationMax->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationMax->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationValue->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationValue->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationStatus->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$fragmentation_status.'</p>
</th>
</tr>
</tbody>
</table>
<tr>
<th colspan="2">
<h2><span> - </span>'.__('Tables fragmentation in the %s database', $product_name).'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationMax->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationMax->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationValue->name.'</span></p>
</th>
<th style="width: 50%;">
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationValue->value.'</p>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$db_fragmentation->data->tablesFragmentationStatus->name.'</span></p>
</th>
<th style="width: 50%;">
<p>'.$fragmentation_status.'</p>
</th>
</tr>
</tbody>
</table>
</div>
<div id="tab-system-info">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('System Info').'</h2>
</th>
</tr>
<tr>
<th style="width: 30%;">
<p><span>'.$sys_info->data->cpuInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->cpuInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ramInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->osInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->osInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->hostnameInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->hostnameInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ipInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->ipInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$system_date->data->date->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$system_date->data->date->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
<div id="tab-php-system">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('PHP system').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$php_sys->data->phpVersion->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->phpVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxExecutionTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->maxExecutionTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxInputTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->maxInputTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->memoryLimit->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->memoryLimit->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->sessionLifetime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->sessionLifetime->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
</div>
<div id="tab-system-info">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('System Info').'</h2>
</th>
</tr>
<tr>
<th style="width: 30%;">
<p><span>'.$sys_info->data->cpuInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->cpuInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ramInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->osInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->osInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->hostnameInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->hostnameInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->ipInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->ipInfo->value.'</p>
</th>
</tr>
<tr>
<th style="width: 15%;">
<p><span>'.$system_date->data->date->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$system_date->data->date->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
<div id="tab-php-system">
<table class="table-about">
<tbody style="text-align: left;">
<tr>
<th colspan="2">
<h2><span> - </span>'.__('PHP system').'</h2>
</th>
</tr>
<tr>
<th style="width: 50%;">
<p><span>'.$php_sys->data->phpVersion->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->phpVersion->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxExecutionTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->maxExecutionTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->maxInputTime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->maxInputTime->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->memoryLimit->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->memoryLimit->value.'</p>
</th>
</tr>
<tr>
<th style="width: 35%;">
<p><span>'.$php_sys->data->sessionLifetime->name.'</span></p>
</th>
<th style="width: 65%;">
<p style="font-size: 10pt;">'.$php_sys->data->sessionLifetime->value.'</p>
</th>
</tr>
</tbody>
</table>
</div>
</div>
';
';
}
echo $dialog;
}

View File

@ -4687,3 +4687,75 @@ function get_agent_module_childs(
}
}
}
/**
* Function for export a csv file from Agents/Module view
*
* @param array $filters Data from agents/module filter.
*
* @return array Returns the data that will be saved in the csv file
*/
function export_agents_module_csv($filters)
{
$query_filter = '';
foreach ($filters as $key => $filter) {
switch ($key) {
case 'group_id':
if ($filter != 0) {
$query_filter .= ' AND ta.id_grupo = '.$filter.' ';
}
break;
case 'module_group_id':
if ($filter != 0) {
$query_filter .= ' AND tam.id_module_group = '.$filter.' ';
;
}
break;
case 'agent_id':
if (count($filter) > 0) {
$agent_filter = '('.implode(', ', $filter).')';
$query_filter .= ' AND ta.id_agente IN '.$agent_filter.' ';
}
break;
case 'module_id':
if (count($filter) > 0) {
if (is_numeric($filter[0]) === false) {
foreach ($filter as $key => $module) {
$filter[$key] = io_safe_input($module);
}
$module_filter = '(\''.implode("', '", $filter).'\')';
$query_filter .= ' AND tam.nombre IN '.$module_filter.' ';
} else {
$module_filter = '('.implode(', ', $filter).')';
$query_filter .= ' AND tam.id_tipo_modulo IN '.$module_filter.' ';
}
}
break;
default:
// Nothing to do
break;
}
}
// Query fields result.
$query = sprintf(
'SELECT ta.alias as agent, tam.nombre as module, tae.datos as data
FROM tagente_modulo as tam
INNER JOIN tagente as ta ON tam.id_agente = ta.id_agente
INNER JOIN tagente_estado as tae ON tam.id_agente_modulo = tae.id_agente_modulo
WHERE ta.disabled = 0
%s
',
$query_filter
);
$result = db_get_all_rows_sql($query);
return $result;
}

View File

@ -136,6 +136,7 @@ function notifications_get_subtypes(?string $source=null)
'NOTIF.PHP.DISABLE_FUNCTIONS',
'NOTIF.PHP.CHROMIUM',
'NOTIF.PHP.VERSION',
'NOTIF.PHP.VERSION.SUPPORT',
'NOTIF.HISTORYDB',
'NOTIF.PANDORADB',
'NOTIF.PANDORADB.HISTORICAL',
@ -145,6 +146,7 @@ function notifications_get_subtypes(?string $source=null)
'NOTIF.METACONSOLE.DB_CONNECTION',
'NOTIF.DOWNTIME',
'NOTIF.UPDATEMANAGER.REGISTRATION',
'NOTIF.API.ACCESS',
'NOTIF.MISC.EVENTSTORMPROTECTION',
'NOTIF.MISC.DEVELOPBYPASS',
'NOTIF.MISC.FONTPATH',
@ -1009,6 +1011,106 @@ function notifications_print_user_switch($source, $user, $label)
}
/**
* Generates an HTML of notification filter types.
*
* @return string HTML filter notification.
*/
function notification_filter()
{
$types_list[] = 'All';
$notification_types = db_get_all_rows_sql('SELECT DISTINCT tm.subtype FROM tmensajes as tm INNER JOIN tnotification_user as tnu ON tm.id_mensaje = tnu.id_mensaje WHERE tnu.utimestamp_read IS NULL');
if ($notification_types !== false) {
foreach ($notification_types as $notification_type) {
$type = explode('.', $notification_type['subtype'])[1];
$types_list[] = $type;
}
}
$types_list = array_unique($types_list);
$notification_filter = "<ul id='menu-filter_notification'>";
$notification_filter .= "<li>
<input type='checkbox' name='filter_menu' id='filter_menu'>
<label for='filter_menu' id='filter_menu_label'>".__('Filter').'</label>';
$notification_filter .= "<ul class='sublevel-filter_notification'>";
foreach ($types_list as $type) {
if ($type === 'All') {
$checked = 'checked';
} else {
$checked = '';
}
switch ($type) {
case 'HISTORYDB':
$type_name = 'HISTORY DB';
break;
case 'PANDORADB':
$type_name = 'PANDORA DB';
break;
case 'UPDATEMANAGER':
$type_name = 'UPDATE MANAGER';
break;
case 'ALLOWOVERRIDE':
$type_name = 'ALLOW OVERRIDE';
break;
case 'DISCOVERYTASK':
$type_name = 'DISCOVERY TASK';
break;
default:
$type_name = $type;
break;
}
$notification_filter .= "<li><div class='item-filter'>
<input type='checkbox'
class='checkbox_filter_notifications'
value=".$type."
name='filter_".$type."'
".$checked."
id='filter_".$type."'>
<label for='filter_".$type."'>".$type_name.'</label>
</div>
</li>';
}
$notification_filter .= "<li><div class='item-filter'>";
$notification_filter .= html_print_div(
[
'class' => 'action-buttons w100p',
'content' => html_print_submit_button(
__('Filter'),
'btn_submit',
false,
[
'class' => 'mini sub filter',
'icon' => 'search mini',
'onClick' => 'filter_notification()',
],
true
),
],
true
);
$notification_filter .= '</div>
</li>';
$notification_filter .= '</ul>';
$notification_filter .= '</li>';
$notification_filter .= '</ul>';
return $notification_filter;
}
/**
* Generates the dropdown notifications menu.
*
@ -1021,9 +1123,24 @@ function notifications_print_dropdown()
$mess = [];
}
$notification_menu = html_print_menu_button(
[
'href' => 'javascript:',
'class' => 'notification_menu_actions',
'text' => __('Mark all as read'),
'onClick' => 'mark_all_notification_as_read()',
],
true
);
$notification_filter = notification_filter();
return sprintf(
"<div id='notification-wrapper'>
<div id='notification-wrapper-inner'>
<div class='notificaion_menu_container'>
<div class='menu_tab filter_notification'>%s</div>
<div class='menu_tab notification_menu'>%s</div>
</div>
%s
</div>
</div>
@ -1033,6 +1150,8 @@ function notifications_print_dropdown()
>
</div>
",
$notification_filter,
$notification_menu,
array_reduce(
$mess,
function ($carry, $message) {
@ -1092,6 +1211,8 @@ function notifications_print_dropdown_element($message_info)
$message_info['subject'] = io_safe_input($img);
}
$type = explode('.', $message_info['subtype'])[1];
if (strlen($body_preview) >= 170) {
$body_preview = substr($body_preview, 0, 150);
$body_preview .= __('. Read More...');
@ -1102,6 +1223,7 @@ function notifications_print_dropdown_element($message_info)
class='notification-item'
onclick='%s'
id='notification-item-id-%s'
value='%s'
href='%s'
target='%s'
>
@ -1115,8 +1237,9 @@ function notifications_print_dropdown_element($message_info)
</p>
</div>
</a>",
$action.';click_on_notification_toast(event)',
$action.'; click_on_notification_toast(event)',
$message_info['id_mensaje'],
$type,
messages_get_url($message_info['id_mensaje']),
$target,
html_print_image('images/info.svg', true, ['style' => 'height: 40px;margin-left: -20px;margin-top: -40px;']),

View File

@ -620,45 +620,33 @@ function planned_downtimes_stop($downtime)
$count = 0;
foreach ($agents as $agent) {
if ($agent['all_modules']) {
$modules = db_get_all_rows_filter(
'tplanned_downtime_modules',
[
'id_agent' => $agent['id_agent'],
'id_downtime' => $id_downtime,
]
);
if (empty($modules)) {
$modules = [];
}
foreach ($modules as $module) {
$result = db_process_sql_update(
'tagente',
['quiet' => 0],
['id_agente' => $agent['id_agent']]
'tagente_modulo',
[
'quiet' => 0,
'quiet_by_downtime' => 0,
],
[
'quiet_by_downtime' => 1,
'id_agente_modulo' => $module['id_agent_module'],
]
);
if ($result) {
$count++;
}
} else {
$modules = db_get_all_rows_filter(
'tplanned_downtime_modules',
[
'id_agent' => $agent['id_agent'],
'id_downtime' => $id_downtime,
]
);
if (empty($modules)) {
$modules = [];
}
foreach ($modules as $module) {
$result = db_process_sql_update(
'tagente_modulo',
[
'quiet' => 0,
'quiet_by_downtime' => 0,
],
[
'quiet_by_downtime' => 1,
'id_agente_modulo' => $module['id_agent_module'],
]
);
if ($result) {
$count++;
}
}
}
}
break;

View File

@ -4166,9 +4166,9 @@ function ui_print_datatable(array $parameters)
// * START JAVASCRIPT.
if (is_metaconsole() === false) {
$file_path = ui_get_full_url('include/javascript/datatablesFunction.js');
$file_path = 'include/javascript/datatablesFunction.js';
} else {
$file_path = ui_get_full_url('../../include/javascript/datatablesFunction.js');
$file_path = '../../include/javascript/datatablesFunction.js';
}
$file_content = file_get_contents($file_path);

View File

@ -55,6 +55,18 @@ function update_manager_verify_registration()
}
/**
* Verifies api state.
*
* @return boolean Status.
*/
function update_manager_verify_api()
{
global $config;
return (isset($config['has_api_access']) === true && $config['has_api_access'] == '1');
}
/**
* Retrieves current update from DB.
*

View File

@ -2554,6 +2554,7 @@ function visual_map_process_wizard_add(
$image,
$id_layout,
$range,
$range_vertical,
$width=0,
$height=0,
$period='',
@ -2562,7 +2563,10 @@ function visual_map_process_wizard_add(
$max_value=0,
$type_percentile='',
$value_show='',
$type=''
$type='',
$pos_x=10,
$pos_y=10,
$max_elements_row=0
) {
if (empty($id_agents)) {
print_error_message(__('No agents selected'));
@ -2572,14 +2576,9 @@ function visual_map_process_wizard_add(
$id_agents = (array) $id_agents;
$error = false;
$pos_y = 10;
$pos_x = 10;
$elements_row = 1;
$initial_x = $pos_x;
foreach ($id_agents as $id_agent) {
if ($pos_x > 600) {
$pos_x = 10;
$pos_y = ($pos_y + $range);
}
$value_height = $height;
$value_image = $image;
$value_type = $type;
@ -2628,7 +2627,14 @@ function visual_map_process_wizard_add(
db_process_sql_insert('tlayout_data', $values);
$pos_x = ($pos_x + $range);
if (($max_elements_row === $elements_row) && $max_elements_row !== 0) {
$elements_row = 1;
$pos_x = $initial_x;
$pos_y = ($range_vertical + $pos_y);
} else {
$pos_x = ($pos_x + $range);
$elements_row++;
}
}
$return = ui_print_success_message(__('Agent successfully added to layout'), '', true);
@ -2654,6 +2660,7 @@ function visual_map_process_wizard_add_modules(
$image,
$id_layout,
$range,
$range_vertical,
$width,
$height,
$period,
@ -2669,7 +2676,10 @@ function visual_map_process_wizard_add_modules(
$kind_relationship=VISUAL_MAP_WIZARD_PARENTS_NONE,
$item_in_the_map=0,
$fontf='lato',
$fonts='12pt'
$fonts='12pt',
$pos_x=10,
$pos_y=10,
$max_elements_row=0
) {
if (empty($width) === true) {
$width = 0;
@ -2691,15 +2701,9 @@ function visual_map_process_wizard_add_modules(
$id_modules = (array) $id_modules;
$error = false;
$pos_y = 10;
$pos_x = 10;
$elements_row = 1;
$initial_x = $pos_x;
foreach ($id_modules as $id_module) {
if ($pos_x > 600) {
$pos_x = 10;
$pos_y = ($pos_y + $range);
}
if ($id_server != 0) {
$connection = db_get_row_filter(
'tmetaconsole_setup',
@ -2820,7 +2824,14 @@ function visual_map_process_wizard_add_modules(
db_process_sql_insert('tlayout_data', $values);
$pos_x = ($pos_x + $range);
if (($max_elements_row === $elements_row) && $max_elements_row !== 0) {
$elements_row = 1;
$pos_x = $initial_x;
$pos_y = ($range_vertical + $pos_y);
} else {
$pos_x = ($pos_x + $range);
$elements_row++;
}
}
$return = ui_print_success_message(__('Modules successfully added to layout'), '', true);
@ -2885,6 +2896,7 @@ function visual_map_process_wizard_add_agents(
$image,
$id_layout,
$range,
$range_vertical,
$width,
$height,
$period,
@ -2900,7 +2912,10 @@ function visual_map_process_wizard_add_agents(
$kind_relationship=VISUAL_MAP_WIZARD_PARENTS_NONE,
$item_in_the_map=0,
$fontf='lato',
$fonts='12pt'
$fonts='12pt',
$pos_x=10,
$pos_y=10,
$max_elements_row=0
) {
global $config;
@ -2925,9 +2940,8 @@ function visual_map_process_wizard_add_agents(
$id_agents = (array) $id_agents;
$error = false;
$pos_y = 10;
$pos_x = 10;
$elements_row = 1;
$initial_x = $pos_x;
$relationship = true;
$relationships_agents = [];
// Check if the set a none relationship
@ -2945,11 +2959,6 @@ function visual_map_process_wizard_add_agents(
$id_agent = $id_a;
}
if ($pos_x > 600) {
$pos_x = 10;
$pos_y = ($pos_y + $range);
}
$value_height = $height;
$value_image = $image;
$value_type = $type;
@ -3061,6 +3070,15 @@ function visual_map_process_wizard_add_agents(
$id_item = db_process_sql_insert('tlayout_data', $values);
if (($max_elements_row === $elements_row) && $max_elements_row !== 0) {
$elements_row = 1;
$pos_x = $initial_x;
$pos_y = ($range_vertical + $pos_y);
} else {
$pos_x = ($pos_x + $range);
$elements_row++;
}
if ($relationship) {
switch ($kind_relationship) {
case VISUAL_MAP_WIZARD_PARENTS_AGENT_RELANTIONSHIP:
@ -3093,8 +3111,6 @@ function visual_map_process_wizard_add_agents(
break;
}
}
$pos_x = ($pos_x + $range);
}
foreach ($relationships_agents as $relationship_item) {

View File

@ -86,8 +86,8 @@ function showConnectionMessage(conn = true, msg = "") {
.closest(".ui-dialog-content")
.dialog("close");
} else {
data.title = "Connection with server has been lost";
data.text = "Connection status: " + msg;
data.title = get_php_value("title_conexion_interval");
data.text = get_php_value("status_conexion_interval") + msg;
infoMessage(data, "message_dialog_connection");
}

20740
pandora_console/include/javascript/d3.v7.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -2487,3 +2487,39 @@ function menuActionButtonResizing() {
"width: calc(100% - " + $("#menu_full").width() + "px);"
);
}
function check_period_warning(time, title, message) {
var period = time.value;
var times = 0;
if (period >= 2592000 && period < 7776000) {
WarningPeriodicityModal(title, message);
} else if (period >= 7776000 && period < 15552000) {
do {
WarningPeriodicityModal(title, message);
times = times + 1;
} while (times < 2);
} else if (period >= 15552000) {
do {
WarningPeriodicityModal(title, message);
times = times + 1;
} while (times < 3);
}
}
function check_period_warning_manual(input_name, title, message) {
var period = {
value:
$("#text-" + input_name + "_text").val() *
$("#" + input_name + "_units option:selected").val()
};
check_period_warning(period, title, message);
}
function WarningPeriodicityModal(title, message) {
confirmDialog({
title: title,
message: message,
strCancelButton: "Ok",
hideOkButton: 1
});
}

View File

@ -217,6 +217,12 @@ function initialiceLayout(data) {
success: function(widgetData) {
// Remove spinner.
removeSpinner(element);
if (widgetData.includes('class="post-widget"')) {
widgetData = widgetData.replace("<script", "&lt;script");
widgetData = widgetData.replace("</script", "&lt;/script");
}
$("#widget-" + id + " .content-widget").append(widgetData);
$("#button-add-widget-" + id).click(function() {

View File

@ -322,7 +322,7 @@ function perform_response(response, response_id, index = "") {
}
// Change the status of an event to new, in process or validated.
function event_change_status(event_ids, server_id) {
function event_change_status(event_ids, server_id, group_rep) {
var new_status = $("#estado").val();
$("#button-status_button").attr("disabled", "disabled");
@ -334,7 +334,8 @@ function event_change_status(event_ids, server_id) {
change_status: 1,
event_ids: event_ids,
new_status: new_status,
server_id: server_id
server_id: server_id,
group_rep: group_rep
},
type: "POST",
url: getUrlAjax(),

View File

@ -421,6 +421,8 @@ class BasicChart extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -304,7 +304,8 @@ class BlockHistogram extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -308,6 +308,8 @@ class DataMatrix extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];
@ -324,6 +326,8 @@ class DataMatrix extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'slice\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -392,6 +392,8 @@ class CustomGraphWidget extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -367,6 +367,8 @@ class GraphModuleHistogramWidget extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -340,6 +340,7 @@ class GroupsStatusWidget extends Widget
// Head agents.
$table->data[0][0] = '<span>';
$table->data[0][0] .= html_print_image(
'images/agent.png',
true,
@ -359,38 +360,70 @@ class GroupsStatusWidget extends Widget
$table->data[0][1] .= '</span>';
if ($stats['total_agents'] !== 0) {
if (is_metaconsole() === true) {
$agentdetail_url = $url.'&statusAgent=';
} else {
$agentdetail_url = $url.'&status=';
}
// Agent Critical.
$table->data[1][0] = $this->getCellCounter(
$agent_url = '';
$agent_url .= $agentdetail_url.'1';
$agent_data = '<a href="'.$agent_url.'">';
$agent_data .= $this->getCellCounter(
$stats['agent_critical'],
'',
'bg_ff5'
);
$agent_data .= '</a>';
$table->data[1][0] = $agent_data;
// Agent Warning.
$table->data[2][0] = $this->getCellCounter(
$agent_url = '';
$agent_url .= $agentdetail_url.'2';
$agent_data = '<a href="'.$agent_url.'">';
$agent_data .= $this->getCellCounter(
$stats['agent_warning'],
'',
'bg_ffd'
);
$agent_data .= '</a>';
$table->data[2][0] = $agent_data;
// Agent OK.
$table->data[3][0] = $this->getCellCounter(
$agent_url = '';
$agent_url .= $agentdetail_url.'0';
$agent_data = '<a href="'.$agent_url.'">';
$agent_data .= $this->getCellCounter(
$stats['agent_ok'],
'',
'bg_82B92E'
);
$agent_data .= '</a>';
$table->data[3][0] = $agent_data;
// Agent Unknown.
$table->data[1][1] = $this->getCellCounter(
$agent_url = '';
$agent_url .= $agentdetail_url.'3';
$agent_data = '<a href="'.$agent_url.'">';
$agent_data .= $this->getCellCounter(
$stats['agent_unknown'],
'#B2B2B2'
);
$agent_data .= '</a>';
$table->data[1][1] = $agent_data;
// Agent Not Init.
$table->data[2][1] = $this->getCellCounter(
$agent_url = '';
$agent_url .= $agentdetail_url.'5';
$agent_data = '<a href="'.$agent_url.'">';
$agent_data .= $this->getCellCounter(
$stats['agent_not_init'],
'#4a83f3'
);
$agent_data .= '</a>';
$table->data[2][1] = $agent_data;
$data .= html_print_table($table, true);
$data .= '</div>';
@ -436,38 +469,69 @@ class GroupsStatusWidget extends Widget
$table->data[0][1] .= '</b>';
$table->data[0][1] .= '</span>';
if (is_metaconsole() === true) {
$monitordetail_url = $url.'&statusModule=';
} else {
$monitordetail_url = 'index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group='.$this->values['groupId'].'&status=';
}
// Modules Critical.
$table->data[1][0] = $this->getCellCounter(
$module_url = '';
$module_url .= $monitordetail_url.'1';
$module_data = '<a href="'.$module_url.'">';
$module_data .= $this->getCellCounter(
$stats['monitor_critical'],
'',
'bg_ff5'
);
$module_data .= '</a>';
$table->data[1][0] = $module_data;
// Modules Warning.
$table->data[2][0] = $this->getCellCounter(
$module_url = '';
$module_url .= $monitordetail_url.'2';
$module_data = '<a href="'.$module_url.'">';
$module_data .= $this->getCellCounter(
$stats['monitor_warning'],
'',
'bg_ffd'
);
$module_data .= '</a>';
$table->data[2][0] = $module_data;
// Modules OK.
$table->data[3][0] = $this->getCellCounter(
$module_url = '';
$module_url .= $monitordetail_url.'0';
$module_data = '<a href="'.$module_url.'">';
$module_data .= $this->getCellCounter(
$stats['monitor_ok'],
'',
'bg_82B92E'
);
$module_data .= '</a>';
$table->data[3][0] = $module_data;
// Modules Unknown.
$table->data[1][1] = $this->getCellCounter(
$module_url = '';
$module_url .= $monitordetail_url.'3';
$module_data = '<a href="'.$module_url.'">';
$module_data .= $this->getCellCounter(
$stats['monitor_unknown'],
'#B2B2B2'
);
$module_data .= '</a>';
$table->data[1][1] = $module_data;
// Modules Not Init.
$table->data[2][1] = $this->getCellCounter(
$module_url = '';
$module_url .= $monitordetail_url.'5';
$module_data = '<a href="'.$module_url.'">';
$module_data .= $this->getCellCounter(
$stats['monitor_not_init'],
'#4a83f3'
);
$module_data .= '</a>';
$table->data[2][1] = $module_data;
$data .= html_print_table($table, true);
$data .= '</div>';

View File

@ -205,6 +205,8 @@ class Netflow extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];
$chart_types = netflow_get_chart_types();

View File

@ -352,6 +352,8 @@ class SingleGraphWidget extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -381,6 +381,8 @@ class SLAPercentWidget extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -260,6 +260,8 @@ class TopNWidget extends Widget
'nothing' => __('None'),
'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -317,6 +317,8 @@ final class BasicChart extends Item
'value' => $values['period'],
'nothing' => __('None'),
'nothing_value' => 0,
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -633,6 +633,8 @@ final class ModuleGraph extends Item
'value' => $values['period'],
'nothing' => __('None'),
'nothing_value' => 0,
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];

View File

@ -1535,7 +1535,45 @@ div#head {
input.datos {
background-color: #f5f5f5;
}
#modal_help {
position: absolute;
top: -2px;
right: 32px;
background: white;
display: flex;
min-width: 160px;
flex-direction: column;
filter: drop-shadow(1px 2px 2px #0000005e);
padding: 10px 0px;
}
#modal-help-content {
position: relative;
cursor: pointer;
}
#modal_help a {
margin: 3px 0px;
padding: 0px 15px;
}
#modal_help a:hover {
color: var(--primary-color);
}
#modal_help .separator {
width: 100%;
opacity: 0.4;
}
#modal_help::before {
content: "";
border: 8px solid #0000;
border-bottom: 8px solid white;
left: auto;
right: -16px;
top: 5px;
position: absolute;
transform: rotate(90deg);
}
#modal_help.invisible {
display: none;
}
/*
* ---------------------------------------------------------------------
* - REPORTS -
@ -7054,6 +7092,10 @@ div.graph div.legend table {
margin-top: -10px;
}
.mrgn_top-15px {
margin-top: -15px;
}
.mrgn_top_0px {
margin-top: 0px;
}
@ -9412,7 +9454,8 @@ div.stat-win-spinner img {
.select2-selection--multiple
.select2-selection__rendered {
padding: 5px 10px 10px !important;
max-height: 120px;
min-height: 100px;
max-height: 250px;
overflow: auto !important;
}
@ -10792,10 +10835,6 @@ button.ui-button.ui-widget.submit-cancel:active {
border-color: #96a2bf;
}
.cursor-default {
cursor: default;
}
.hasColorPicker {
z-index: 10;
}
@ -12288,14 +12327,6 @@ div.parent_graph > p.legend_background > table > tbody > tr {
margin: 0px !important;
}
form.max_floating_element_size > ul#ul_tree_azure {
background-color: #fff;
border-spacing: 0px;
border-radius: 6px;
margin-bottom: 20px;
border: 1px solid #e2e2e2;
}
#grid_img {
position: absolute;
margin-top: -2px;
@ -12331,6 +12362,88 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
width: 100% !important;
}
.notificaion_menu_container {
display: flex;
padding-top: 10px;
padding-left: 15px;
}
.notification_menu {
width: 100px;
}
.filter_notification {
width: auto;
min-width: 50px;
}
#menu-filter_notification * {
list-style: none;
}
#menu-filter_notification li {
line-height: 180%;
}
#menu-filter_notification input[name="filter_menu"] {
position: absolute;
left: -1000em;
}
#menu-filter_notification label[id="filter_menu_label"]:before {
content: "\025b8";
margin-right: 4px;
}
#menu-filter_notification
input[name="filter_menu"]:checked
~ label[id="filter_menu_label"]:before {
content: "\025be";
}
#menu-filter_notification .sublevel-filter_notification {
display: none;
}
#menu-filter_notification input[name="filter_menu"]:checked ~ ul {
display: block;
}
.item-filter > label {
display: inline-block;
width: auto;
vertical-align: middle;
}
.item-filter > input[type="checkbox"] {
display: inline-block;
width: 40px;
height: 100%;
vertical-align: middle;
}
/*Horizontal tree*/
.horizontal_tree-icon {
position: absolute;
background: #f4f4f4;
margin-top: 140px;
margin-left: 15px;
transform: rotate(-90deg);
}
.horizontal_tree-icon-sunburst {
position: absolute;
background: #f4f4f4;
margin-top: 40px;
/*margin-left: 15px;*/
transform: rotate(-90deg);
}
.tree-icon {
position: absolute;
background: #f4f4f4;
margin-top: 140px;
margin-left: 15px;
}
.label_agent_service > label {
margin-top: 15px;
}
.animation-blink {
-webkit-animation: glowing 1500ms infinite;
-moz-animation: glowing 1500ms infinite;

View File

@ -1851,3 +1851,10 @@ a.pandora_pagination,
color: #fff !important;
background-color: #333 !important;
}
#modal_help {
background: #222222;
}
#modal_help::before {
border-bottom: 8px solid #222222;
}

View File

@ -1516,10 +1516,12 @@ echo html_print_div(
// Connection lost alert.
set_js_value('check_conexion_interval', $config['check_conexion_interval']);
set_js_value('title_conexion_interval', __('Connection with console has been lost'));
set_js_value('status_conexion_interval', __('Connection status: '));
ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
if ($config['pure'] == 0) {

View File

@ -130,8 +130,8 @@
</div>
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.773';
$build = '230818';
$version = '7.0NG.773.2';
$build = '230829';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -233,7 +233,25 @@ $table->data[2][2] .= html_print_image(
$table->data[3][1] = __('Time range');
$table->data[3][2] = html_print_extended_select_for_time('period', $period, '', '', 0, 7, true);
$table->data[3][2] = html_print_extended_select_for_time(
'period',
$period,
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'',
0,
7,
true,
false,
true,
'',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
);
$table->data[4][2] = __('Show events');
$table->data[4][3] = html_print_checkbox('draw_events', 1, (bool) $draw_events, true);

View File

@ -89,8 +89,8 @@ $label = db_get_value(
ui_require_css_file('register', 'include/styles/', true);
// Connection lost alert.
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
ui_print_message_dialog(

View File

@ -157,6 +157,10 @@ try {
throw new Exception('Invalid filter. ['.$plain_filter.']');
}
if (key_exists('server_id', $filter) === true && is_array($filter['server_id']) === false) {
$filter['server_id'] = explode(',', $filter['server_id']);
}
$filter['csv_all'] = true;
$names = events_get_column_names($column_names);

View File

@ -274,8 +274,8 @@ if ($layers != false) {
// Connection lost alert.
ui_require_css_file('register', 'include/styles/', true);
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');

View File

@ -344,7 +344,25 @@ if ($view_graph) {
$searchForm .= "<td class='datos w30p'>";
$searchForm .= html_print_label_input_block(
__('Time range'),
html_print_extended_select_for_time('period', (string) $period, '', '', 0, 10, true, 'width:100%')
html_print_extended_select_for_time(
'period',
(string) $period,
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'',
0,
10,
true,
'width:100%',
true,
'',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
)
);
$searchForm .= '</td>';
$searchForm .= '</tr><tr>';

View File

@ -291,47 +291,46 @@ if (is_metaconsole() === true) {
);
}
if (is_metaconsole() === false) {
// Module filter.
$module_status_arr = [];
$module_status_arr[-1] = __('All');
// Default.
$module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
$module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning');
$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
$module_status_arr['fired'] = __('Fired alerts');
// if (is_metaconsole() === false) {
// Module filter.
$module_status_arr = [];
$module_status_arr[-1] = __('All');
// Default.
$module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
$module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning');
$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
$module_status_arr['fired'] = __('Fired alerts');
$table->data['last_row'][] = html_print_label_input_block(
__('Search module'),
html_print_input_text('search_module', $search_module, '', 25, 30, true)
);
$table->data['last_row'][] = html_print_label_input_block(
__('Search module'),
html_print_input_text('search_module', $search_module, '', 25, 30, true)
);
$table->data['last_row'][] = html_print_label_input_block(
__('Show not init modules'),
html_print_checkbox_switch('show_not_init_modules', $show_not_init_modules, true, true)
);
$table->data['last_row'][] = html_print_label_input_block(
__('Module status'),
html_print_select(
$module_status_arr,
'status_module',
$status_module,
'',
'',
0,
true,
false,
false,
'',
false,
'width:100%'
)
);
}
$table->data['last_row'][] = html_print_label_input_block(
__('Show not init modules'),
html_print_checkbox_switch('show_not_init_modules', $show_not_init_modules, true, true)
);
$table->data['last_row'][] = html_print_label_input_block(
__('Module status'),
html_print_select(
$module_status_arr,
'status_module',
$status_module,
'',
'',
0,
true,
false,
false,
'',
false,
'width:100%'
)
);
// }
$form_html = '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$tab.'&pure='.$config['pure'].'">';
$form_html .= html_print_table($table, true);
$form_html .= html_print_div(

View File

@ -54,8 +54,8 @@ echo '<link rel="stylesheet" href="'.$url_css_modal.'?v='.$config['current_packa
// Connection lost alert.
ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
require_once 'include/functions_visual_map.php';

View File

@ -35,8 +35,8 @@ ui_require_css_file('register', 'include/styles/', true);
// Connection lost alert.
ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.773
%define release 230818
%define version 7.0NG.773.2
%define release 230829
# User and Group under which Apache is running
%define httpd_name httpd

Some files were not shown because too many files have changed in this diff Show More