Merge branch develop into ent-10065-post-filtros-de-eventos-privados

This commit is contained in:
Jorge Rincon 2023-08-18 09:19:57 +02:00
commit 3e4178c490
126 changed files with 38609 additions and 33565 deletions

View File

@ -32,6 +32,7 @@ services:
PUBLICURL: ""
SLEEP: 5
RETRIES: 10
TZ: 'Europe/Madrid'
networks:
- pandora
ports:

View File

@ -10,6 +10,8 @@ ENV DBPORT=3306
ENV SLEEP=5
ENV RETRIES=1
ENV OPEN=1
ENV TZ='Europe/Madrid'
ENV LC_ALL=C

View File

@ -230,6 +230,10 @@ fi
echo "" > /opt/pandora/crontasks || touch /opt/pandora/crontasks
#set localtime
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/$TZ /etc/localtime
#install pandora packages
echo "-> Istalling pandorafms"
cd /opt/pandora

View File

@ -28,6 +28,7 @@ $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spe
$CODEHOME/pandora_console/pandora_console.redhat.spec \
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec\
$CODEHOME/pandora_server/pandora_server.redhat.spec \
$PANDHOME_ENT/pandora_agents/pandora_agent.spec \
$PANDHOME_ENT/pandora_server/pandora_server_enterprise.redhat.spec \

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.772, AIX version
# Version 7.0NG.773, 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.772, FreeBSD Version
# Version 7.0NG.773, 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.772, HP-UX Version
# Version 7.0NG.773, 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.772, GNU/Linux
# Version 7.0NG.773, 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.772, GNU/Linux
# Version 7.0NG.773, 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.772, Solaris Version
# Version 7.0NG.773, 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.772
# Version 7.0NG.773
# 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.772, AIX version
# Version 7.0NG.773, 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.772
# Version 7.0NG.773
# 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.772, HPUX Version
# Version 7.0NG.773, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.772
# Version 7.0NG.773
# 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.772
# Version 7.0NG.773
# 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.772
# Version 7.0NG.773
# 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.772, Solaris version
# Version 7.0NG.773, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.772, AIX version
# Version 7.0NG.773, 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.772-230807
Version: 7.0NG.773-230818
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.772-230807"
pandora_version="7.0NG.773-230818"
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.772"
VERSION="7.0NG.773"
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.772" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773" 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.772" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773" 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.772</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.772 Pandora FMS on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.772</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>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.772, GNU/Linux
# Version 7.0NG.773, 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.772, FreeBSD Version
# Version 7.0NG.773, 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.772, HP-UX Version
# Version 7.0NG.773, 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.772
# Version 7.0NG.773
# Licensed under GPL license v2,
# Copyright (c) 2004-2023 Pandora FMS
# https://pandorafms.com
@ -310,3 +310,9 @@ module_plugin autodiscover --default
#module_description Zombies process on system
#module_group System
#module_end
#Hardening plugin for security compliance analysis. Enable to use it.
#module_begin
#module_plugin /usr/share/pandora_agent/plugins/pandora_sca
#module_absoluteinterval 7d
#module_end

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.772, GNU/Linux
# Version 7.0NG.773, 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.772, NetBSD Version
# Version 7.0NG.773, 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.772, Solaris Version
# Version 7.0NG.773, 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.772';
use constant AGENT_BUILD => '230807';
use constant AGENT_VERSION => '7.0NG.773';
use constant AGENT_BUILD => '230818';
# 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.772
%define release 230807
%define version 7.0NG.773
%define release 230818
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

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.772
%define version 7.0NG.773
%define release 230725
Summary: Pandora FMS Linux agent, binary version
@ -19,7 +19,7 @@ Group: System/Monitoring
Packager: Sancho Lerena <slerena@artica.es>
Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
BuildArch: noarch
BuildArch: x86_64
Requires(pre): shadow-utils
Requires(post): chkconfig /bin/ln
Requires(preun): chkconfig /bin/rm /usr/sbin/userdel

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.772
%define release 230807
%define version 7.0NG.773
%define release 230818
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.772"
PI_BUILD="230807"
PI_VERSION="7.0NG.773"
PI_BUILD="230818"
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.772
# Version 7.0NG.773
# 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,5 +522,4 @@ 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

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.772}
{Pandora FMS Windows Agent v7.0NG.773}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230807}
{230818}
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.772 Build 230807")
#define PANDORA_VERSION ("7.0NG.773 Build 230818")
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.772(Build 230807))"
VALUE "ProductVersion", "(7.0NG.773(Build 230818))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.772-230807
Version: 7.0NG.773-230818
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.772-230807"
pandora_version="7.0NG.773-230818"
package_pear=0
package_pandora=1

View File

@ -1702,4 +1702,9 @@ enterprise/meta/monitoring/wizard/wizard.module.network.php
enterprise/meta/monitoring/wizard/wizard.module.web.php
enterprise/meta/monitoring/wizard/wizard.php
enterprise/meta/monitoring/wizard/wizard.update_agent.php
enterprise/meta/monitoring/wizard/wizard.update_module.php
enterprise/meta/monitoring/wizard/wizard.update_module.php
enterprise/godmode/wizards/Applications.class.php
enterprise/godmode/wizards/Cloud.class.php
enterprise/images/wizard/applications.png
enterprise/images/wizard/cloud.png
enterprise/images/wizard/consoletasks.png

File diff suppressed because one or more lines are too long

View File

@ -2,4 +2,13 @@ START TRANSACTION;
ALTER TABLE tevent_filter ADD private_filter_user text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL;
UPDATE `twelcome_tip`
SET title = 'Scheduled&#x20;downtimes',
url = 'https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#scheduled_downtimes'
WHERE title = 'planned&#x20;stops';
UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
COMMIT;

View File

@ -0,0 +1,81 @@
<?php
/**
* Static page to lock access to console
*
* @category Wizard
* @package Pandora FMS
* @subpackage Applications.VMware
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org 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.
* ============================================================================
*/
// Begin.
ui_require_css_file('maintenance');
?>
<html>
<body>
<div class="responsive center padding-6">
<p>
<?php
if (is_metaconsole() === true) {
echo __('You cannot use this metaconsole until merging process is finished');
} else {
echo __('You cannot use this console until merging process is finished');
}
?>
</p>
<br>
<br>
<?php
html_print_image(
'images/pandora_tinylogo.png',
false,
['class' => 'responsive flex margn']
);
html_print_image(
'images/maintenance.png',
false,
[
'class' => 'responsive',
'width' => 800,
]
);
?>
<br>
<br>
<p><?php echo __('You will be automatically redirected when all tasks finish'); ?></p>
</div>
</body>
<script type="text/javascript">
$(document).ready(function() {
setTimeout(
function() {
location.reload();
},
10000
);
})
</script>
</html>

View File

@ -259,6 +259,8 @@ if (!empty($news)) {
$output_news .= '</div></div>';
} else {
$text = str_replace('<script', '&lt;script', $text);
$text = str_replace('</script', '&lt;/script', $text);
$output_news .= nl2br($text);
}

View File

@ -1758,7 +1758,10 @@ if ($update_module) {
];
if ($id_module_type == 30 || $id_module_type == 31 || $id_module_type == 32 || $id_module_type == 33) {
if ($id_module_type === 30 || $id_module_type === 31
|| $id_module_type === 32 || $id_module_type === 33
|| $id_module_type === 38
) {
$plugin_parameter_split = explode('&#x0a;', $values['plugin_parameter']);
$values['plugin_parameter'] = '';
@ -1954,7 +1957,10 @@ if ($create_module) {
'warning_time' => $warning_time,
];
if ($id_module_type === 30 || $id_module_type === 31 || $id_module_type === 32 || $id_module_type === 33) {
if ($id_module_type === 30 || $id_module_type === 31
|| $id_module_type === 32 || $id_module_type === 33
|| $id_module_type === 38
) {
$plugin_parameter_split = explode('&#x0a;', $values['plugin_parameter']);
$values['plugin_parameter'] = '';

View File

@ -407,8 +407,7 @@ if ($edit_module === true) {
$help_header = 'local_module';
}
if ($id_module_type === 6 || $id_module_type === 7
) {
if ($id_module_type === 6 || $id_module_type === 7) {
$help_header = 'icmp_module_tab';
}
@ -420,7 +419,7 @@ if ($edit_module === true) {
$help_header = 'tcp_module_tab';
}
if ($id_module_type >= 30 && $id_module_type <= 33) {
if (($id_module_type >= 30 && $id_module_type <= 33) || $id_module_type === 38) {
$help_header = 'webserver_module_tab';
}
}

View File

@ -233,7 +233,6 @@ if ($adopt === false) {
}
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3';

View File

@ -262,7 +262,7 @@ $data[1] = '';
$table_conditions->data[] = $data;
$data[0] = __('Use special days list');
$data[1] = (isset($alert['special_day']) && $alert['special_day'] == 1) ? __('Yes') : __('No');
$data[1] = (isset($template['special_day']) && (int) $template['special_day'] !== 0) ? __('Yes') : __('No');
$table_conditions->data[] = $data;
$data[0] = __('Time threshold');

View File

@ -103,6 +103,7 @@ if ($create_profiles) {
$groups_id = get_parameter('groups_id', -1);
$users_id = get_parameter('users_id', -1);
$n_added = 0;
$msg_error = __('Profiles cannot be added');
if ($profiles_id == -1 || $groups_id == -1 || $users_id == -1) {
$result = false;
@ -155,6 +156,8 @@ if ($create_profiles) {
if ($return !== false) {
$n_added++;
}
} else {
$msg_error = __('The profile already exist on the user');
}
}
}
@ -182,7 +185,7 @@ if ($create_profiles) {
ui_print_result_message(
$n_added > 0,
__('Profiles added successfully').'('.$n_added.')',
__('Profiles cannot be added')
$msg_error
);
}

View File

@ -965,7 +965,6 @@ $table->data[19][0] = html_print_label_input_block(
);
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3';

View File

@ -82,12 +82,12 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
// Applications.
$sub2 = [];
if (enterprise_installed() === true) {
$sub2['godmode/servers/discovery&wiz=app&mode=MicrosoftSQLServer']['text'] = __('Microsoft SQL Server');
$sub2['godmode/servers/discovery&wiz=app&mode=mysql']['text'] = __('Mysql');
$sub2['godmode/servers/discovery&wiz=app&mode=oracle']['text'] = __('Oracle');
$sub2['godmode/servers/discovery&wiz=app&mode=vmware']['text'] = __('VMware');
$sub2['godmode/servers/discovery&wiz=app&mode=SAP']['text'] = __('SAP');
$sub2['godmode/servers/discovery&wiz=app&mode=DB2']['text'] = __('DB2');
$sub2['godmode/servers/discovery&wiz=app&mode=MicrosoftSQLServer']['text'] = __('Microsoft SQL Server (legacy)');
$sub2['godmode/servers/discovery&wiz=app&mode=mysql']['text'] = __('Mysql (legacy)');
$sub2['godmode/servers/discovery&wiz=app&mode=oracle']['text'] = __('Oracle (legacy)');
$sub2['godmode/servers/discovery&wiz=app&mode=vmware']['text'] = __('VMware (legacy)');
$sub2['godmode/servers/discovery&wiz=app&mode=SAP']['text'] = __('SAP (legacy)');
$sub2['godmode/servers/discovery&wiz=app&mode=DB2']['text'] = __('DB2 (legacy)');
}
$extensions = ManageExtensions::getExtensionBySection('app');
@ -112,9 +112,9 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
// Cloud.
$sub2 = [];
if (enterprise_installed() === true) {
$sub2['godmode/servers/discovery&wiz=cloud&mode=amazonws']['text'] = __('Amazon Web Services');
$sub2['godmode/servers/discovery&wiz=cloud&mode=azure']['text'] = __('Microsoft Azure');
$sub2['godmode/servers/discovery&wiz=cloud&mode=gcp']['text'] = __('Google Compute Platform');
$sub2['godmode/servers/discovery&wiz=cloud&mode=amazonws']['text'] = __('Amazon Web Services (legacy)');
$sub2['godmode/servers/discovery&wiz=cloud&mode=azure']['text'] = __('Microsoft Azure (legacy)');
$sub2['godmode/servers/discovery&wiz=cloud&mode=gcp']['text'] = __('Google Compute Platform (legacy)');
}

View File

@ -45,7 +45,6 @@ if (!$id && !isset($snmp_community)) {
}
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3';

View File

@ -1280,8 +1280,7 @@ switch ($action) {
$discovery_tasklist = new DiscoveryTaskList();
$report_task_data = $discovery_tasklist->showListConsoleTask(true);
if (is_array($report_task_data) === true || strpos($report_task_data, 'class="nf"') === false) {
if (is_array($report_task_data) === true || (strpos($report_task_data, 'class="nf"') === false && $report_task_data !== -1)) {
$task_table = '<div class="mrgn_top_15px white_box">';
$task_table .= '<span class="white_table_graph_header">'.__('Report tasks');
$task_table .= ui_print_help_tip(__('To schedule a report, do it from the editing view of each report.'), true);
@ -1290,6 +1289,10 @@ switch ($action) {
$task_table .= '</div></div>';
echo $task_table;
} else {
if ($report_task_data === -1) {
$report_task_data = '';
}
ui_print_info_message($report_task_data.__('To schedule a report, do it from the editing view of each report.'));
}

View File

@ -182,7 +182,7 @@ if ($layoutDatas === false) {
$alternativeStyle = true;
$parents = visual_map_get_items_parents($idVisualConsole);
$x = 0;
foreach ($layoutDatas as $layoutData) {
$idLayoutData = $layoutData['id'];
@ -537,7 +537,8 @@ foreach ($layoutDatas as $layoutData) {
$table->data[($i + 1)][5] = '';
$table->data[($i + 1)][5] .= html_print_checkbox('multiple_delete_items', $idLayoutData, false, true);
$table->data[($i + 1)][5] .= '<a href="'.$url_delete.'" '.'onclick="javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
$table->data[($i + 1)][5] .= '<a href="'.$url_delete.'"onclick="javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
$table->data[($i + 1)][5] .= html_print_input_hidden('updated_'.$idLayoutData, '0', true);
// Second row
$table->data[($i + 2)]['icon'] = '';
@ -778,6 +779,12 @@ foreach ($layoutDatas as $layoutData) {
$alternativeStyle = !$alternativeStyle;
$i = ($i + 3);
$x++;
}
$x = (($x * 13) + 14);
if ($x > ini_get('max_input_vars')) {
ui_print_warning_message(__('You have to change the <b>"max_input_vars"</b> and set bigger value on <b>php.ini</b> for update, there is too much elements to update'));
}
$pure = get_parameter('pure', 0);
@ -888,6 +895,16 @@ ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
return false;
});
$('select[id^="image_"], input[name^="width_"], input[name^="height"], input[name^="left_"], input[name^="top_"], select[id^="parent_"], input[id^="agent_"], select[id^="module_"]').change(function(){
var id = $(this).attr('id').split('_')[1];
$('#hidden-updated_'+id).val('1');
});
$('select[id^="map_linked"]').change(function(){
var id = $(this).attr('id').split('_')[2];
$('#hidden-updated_'+id).val('1');
});
defineTinyMCE('#tinyMCE_editor');
$("#dialog_label_editor").hide ()

View File

@ -418,7 +418,6 @@ switch ($activeTab) {
case 'update':
// Update background
$background = get_parameter('background');
$background_color = get_parameter('background_color');
$width = get_parameter('width');
$height = get_parameter('height');
@ -433,10 +432,9 @@ switch ($activeTab) {
db_process_sql_update(
'tlayout',
[
'background' => $background,
'background_color' => $background_color,
'width' => $width,
'height' => $height,
'background' => $background,
'width' => $width,
'height' => $height,
],
['id' => $idVisualConsole]
);
@ -463,62 +461,65 @@ switch ($activeTab) {
foreach ($idsElements as $idElement) {
$id = $idElement['id'];
$values = [];
$values['label'] = get_parameter('label_'.$id, '');
$values['image'] = get_parameter('image_'.$id, '');
$values['width'] = get_parameter('width_'.$id, 0);
$values['height'] = get_parameter('height_'.$id, 0);
$values['pos_x'] = get_parameter('left_'.$id, 0);
$values['pos_y'] = get_parameter('top_'.$id, 0);
switch ($idElement['type']) {
case NETWORK_LINK:
case LINE_ITEM:
continue 2;
$update = get_parameter('updated_'.$id, 0);
if ($update === '1') {
$values = [];
$values['label'] = get_parameter('label_'.$id, '');
$values['image'] = get_parameter('image_'.$id, '');
$values['width'] = get_parameter('width_'.$id, 0);
$values['height'] = get_parameter('height_'.$id, 0);
$values['pos_x'] = get_parameter('left_'.$id, 0);
$values['pos_y'] = get_parameter('top_'.$id, 0);
switch ($idElement['type']) {
case NETWORK_LINK:
case LINE_ITEM:
continue 2;
break;
break;
case SIMPLE_VALUE_MAX:
case SIMPLE_VALUE_MIN:
case SIMPLE_VALUE_AVG:
$values['period'] = get_parameter('period_'.$id, 0);
break;
case SIMPLE_VALUE_MAX:
case SIMPLE_VALUE_MIN:
case SIMPLE_VALUE_AVG:
$values['period'] = get_parameter('period_'.$id, 0);
break;
case MODULE_GRAPH:
$values['period'] = get_parameter('period_'.$id, 0);
unset($values['image']);
break;
case MODULE_GRAPH:
$values['period'] = get_parameter('period_'.$id, 0);
unset($values['image']);
break;
case GROUP_ITEM:
$values['id_group'] = get_parameter('group_'.$id, 0);
break;
case GROUP_ITEM:
$values['id_group'] = get_parameter('group_'.$id, 0);
break;
case CIRCULAR_PROGRESS_BAR:
case CIRCULAR_INTERIOR_PROGRESS_BAR:
case PERCENTILE_BUBBLE:
case PERCENTILE_BAR:
unset($values['height']);
break;
case CIRCULAR_PROGRESS_BAR:
case CIRCULAR_INTERIOR_PROGRESS_BAR:
case PERCENTILE_BUBBLE:
case PERCENTILE_BAR:
unset($values['height']);
break;
}
$agentName = get_parameter('agent_'.$id, '');
if (defined('METACONSOLE')) {
$values['id_metaconsole'] = (int) get_parameter('id_server_id_'.$id, '');
$values['id_agent'] = (int) get_parameter('id_agent_'.$id, 0);
} else {
$agent_id = (int) get_parameter('id_agent_'.$id, 0);
$values['id_agent'] = $agent_id;
}
$values['id_agente_modulo'] = get_parameter('module_'.$id, 0);
$values['id_custom_graph'] = get_parameter('custom_graph_'.$id, 0);
$values['parent_item'] = get_parameter('parent_'.$id, 0);
$values['id_layout_linked'] = get_parameter('map_linked_'.$id, 0);
if (enterprise_installed()) {
enterprise_visual_map_update_action_from_list_elements($type, $values, $id);
}
db_process_sql_update('tlayout_data', $values, ['id' => $id]);
}
$agentName = get_parameter('agent_'.$id, '');
if (defined('METACONSOLE')) {
$values['id_metaconsole'] = (int) get_parameter('id_server_id_'.$id, '');
$values['id_agent'] = (int) get_parameter('id_agent_'.$id, 0);
} else {
$agent_id = (int) get_parameter('id_agent_'.$id, 0);
$values['id_agent'] = $agent_id;
}
$values['id_agente_modulo'] = get_parameter('module_'.$id, 0);
$values['id_custom_graph'] = get_parameter('custom_graph_'.$id, 0);
$values['parent_item'] = get_parameter('parent_'.$id, 0);
$values['id_layout_linked'] = get_parameter('map_linked_'.$id, 0);
if (enterprise_installed()) {
enterprise_visual_map_update_action_from_list_elements($type, $values, $id);
}
db_process_sql_update('tlayout_data', $values, ['id' => $id]);
}
break;

View File

@ -189,7 +189,8 @@ $table->data[1][1] = html_print_label_input_block(
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
)
// .' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[2][0] = html_print_label_input_block(
@ -202,7 +203,8 @@ $table->data[2][0] = html_print_label_input_block(
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
)
// .' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[2][1] = html_print_label_input_block(
@ -215,7 +217,8 @@ $table->data[2][1] = html_print_label_input_block(
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
)
// .' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[3][0] = html_print_label_input_block(
@ -228,7 +231,8 @@ $table->data[3][0] = html_print_label_input_block(
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
)
// .' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[3][1] = html_print_label_input_block(
@ -325,6 +329,18 @@ if (enterprise_installed() || defined('DESTDIR')) {
],
true
);
$buttons .= html_print_button(
__('Show agent usage details'),
'agents_details',
false,
'show_agents_details_dialog()',
[
'fixed_id' => 'button-agents_details',
'icon' => 'next',
'mode' => 'secondary',
],
true
);
html_print_action_buttons(
$buttons
@ -369,3 +385,80 @@ if (enterprise_hook('print_activate_licence_dialog') == ENTERPRISE_NOT_HOOK) {
echo '</ul>';
echo '</div>';
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filter-table-adv';
$table->size = [];
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$table->colspan = [];
$table->data[0][0] = html_print_label_input_block(
__('Total Agents'),
html_print_input_text(
'total_agents',
$total_agents,
'',
30,
255,
true,
true
)
);
$table->data[0][1] = html_print_label_input_block(
__('Network & other devices'),
html_print_input_text(
'type_network',
$network_others,
'',
30,
255,
true,
true
)
);
$table->data[1][0] = html_print_label_input_block(
__('Workstations'),
html_print_input_text(
'type_workstation',
$workstations,
'',
30,
255,
true,
true
)
);
$table->data[1][1] = html_print_label_input_block(
__('Servers'),
html_print_input_text(
'type_server',
$servers,
'',
30,
255,
true,
true
)
);
$table->data[2][0] = html_print_label_input_block(
__('Show disabled agents'),
html_print_checkbox_switch(
'show_disabled_agents',
1,
1,
true,
false,
'show_disabled_agents()'
)
);
echo '<div id="agents_details_dialog" class="invisible left" title="'.__('Agents usage details').'">';
html_print_table($table);
echo '</div>';

View File

@ -1927,7 +1927,7 @@ $table_other->data[$row][] = html_print_label_input_block(
).html_print_div(
[
'class' => '',
'content' => __('Interval').html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false, '', false, 'width: 100%'),
'content' => __('Interval').html_print_select($units, 'interval_unit', '', '', '', '', true, false, false, '', false, 'width: 100%'),
],
true
).html_print_button(
@ -1975,7 +1975,7 @@ $table_other->data[$row][] = html_print_label_input_block(
).html_print_button(
__('Delete'),
'interval_del_btn',
empty($config['interval_values']),
false,
'',
[
'mode' => 'link',
@ -2009,7 +2009,7 @@ $table_other->data[$row][] = html_print_label_input_block(
).html_print_div(
[
'class' => '',
'content' => __('Interval').html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false, '', false, 'width: 100%'),
'content' => __('Interval').html_print_select($units, 'module_interval_unit', 1, '', '', '', true, false, false, '', false, 'width: 100%'),
],
true
).html_print_button(
@ -2316,9 +2316,15 @@ $(document).ready (function () {
// CUSTOM INTERVAL VALUES
//------------------------------------------------------------------
$("#button-interval_del_btn").click( function() {
var interval_selected = $('#intervals option:selected').val();
$('#hidden-interval_to_delete').val(interval_selected);
$('#submit-update_button').trigger('click');
confirmDialog({
title: "<?php echo __('Delete interval'); ?>",
message: "<?php echo __('This action is not reversible. Are you sure'); ?>",
onAccept: function() {
var interval_selected = $('#intervals option:selected').val();
$('#hidden-interval_to_delete').val(interval_selected);
$('#button-update_button').trigger('click');
}
});
});
$("#button-interval_add_btn").click( function() {

View File

@ -67,6 +67,9 @@ class Applications extends Wizard
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=app'
);
// Print Warning Message.
$this->printWarningMessage();
return $this;
}

View File

@ -220,6 +220,9 @@ class Cloud extends Wizard
echo '<div class="app_mssg"><i>*'.__('All company names used here are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.').'</i></div>';
}
// Print Warning Message.
$this->printWarningMessage();
return $result;
}

View File

@ -32,6 +32,8 @@ require_once $config['homedir'].'/include/class/HTML.class.php';
require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/functions_reports.php';
require_once $config['homedir'].'/include/functions_cron.php';
require_once $config['homedir'].'/godmode/wizards/Wizard.main.php';
enterprise_include_once('include/functions_tasklist.php');
enterprise_include_once('include/functions_cron.php');
@ -214,6 +216,10 @@ class DiscoveryTaskList extends HTML
html_print_action_buttons($this->printForm($form, true));
}
// Warning Message.
$wizar_main = new Wizard();
$wizar_main->printWarningMessage();
return $ret;
}
@ -569,7 +575,7 @@ class DiscoveryTaskList extends HTML
$recon_tasks = db_get_all_rows_sql(
sprintf(
'SELECT tasks.*, apps.section AS section, apps.short_name AS short_name
FROM trecon_task
FROM trecon_task tasks
LEFT JOIN tdiscovery_apps apps ON tasks.id_app = apps.id_app
WHERE id_group IN (%s) AND
(type IN (%s) OR section = "%s")',
@ -776,7 +782,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Cloud.Azure.Compute');
$data[6] .= __('Cloud.Azure.Compute (legacy)');
break;
case DISCOVERY_CLOUD_AWS_EC2:
@ -789,7 +795,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Cloud.AWS.EC2');
$data[6] .= __('Cloud.AWS.EC2 (legacy)');
break;
case DISCOVERY_CLOUD_AWS_RDS:
@ -802,7 +808,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.Cloud.Aws.RDS');
$data[6] .= __('Discovery.Cloud.Aws.RDS (legacy)');
break;
case DISCOVERY_CLOUD_AWS_S3:
@ -815,7 +821,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.Cloud.Aws.S3');
$data[6] .= __('Discovery.Cloud.Aws.S3 (legacy)');
break;
case DISCOVERY_APP_MYSQL:
@ -828,7 +834,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.MySQL');
$data[6] .= __('Discovery.App.MySQL (legacy)');
break;
case DISCOVERY_APP_ORACLE:
@ -841,7 +847,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.Oracle');
$data[6] .= __('Discovery.App.Oracle (legacy)');
break;
case DISCOVERY_APP_DB2:
@ -854,7 +860,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.DB2');
$data[6] .= __('Discovery.App.DB2 (legacy)');
break;
case DISCOVERY_DEPLOY_AGENTS:
@ -865,7 +871,7 @@ class DiscoveryTaskList extends HTML
true,
['title' => __('Agent deployment')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.Agent.Deployment');
$data[6] .= __('Discovery.Agent.Deployment (legacy)');
break;
case DISCOVERY_APP_MICROSOFT_SQL_SERVER:
@ -878,7 +884,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.Microsoft SQL Server');
$data[6] .= __('Discovery.App.Microsoft SQL Server (legacy)');
break;
case DISCOVERY_EXTENSION:
@ -906,7 +912,7 @@ class DiscoveryTaskList extends HTML
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.NetScan');
$data[6] .= __('Discovery.NetScan (legacy)');
} else {
// APP or external script recon task.
$data[6] = html_print_image(
@ -914,7 +920,7 @@ class DiscoveryTaskList extends HTML
true,
['class' => 'main_menu_icon invert_filter']
).'&nbsp;&nbsp;';
$data[6] .= $recon_script_name;
$data[6] .= $recon_script_name.' (legacy)';
}
break;
}
@ -2022,4 +2028,28 @@ class DiscoveryTaskList extends HTML
}
/*
* Generates warning message.
*
* @return void Warning message.
public function getWarningMessage()
{
return ui_print_warning_message(
__(
'Starting with version 773, the new modular system of discovery 2.0 has been implemented. The current
discovery (1.0) and its defined tasks will continue to function normally until the next LTS version,
in which migration to the new system will be mandatory.
The tasks of the current discovery (1.0) will be marked as legacy although it will not affect their
operation, it will only be a visual indicator to identify and differentiate the tasks of discovery 1.0
from those of the new version 2.0.
In the intermediate versions between the 773 and the next LTS version, more applications of the new
discovery 2.0 will be added. Both new and those that will come to replace the applications of the
current discovery 1.0. In addition, an automatic migration tool for legacy (1.0) tasks to the new 2.0
model will be included.'
)
);
}*/
}

View File

@ -522,4 +522,28 @@ class Wizard
}
/**
* Generates warning message.
*
* @return void Warning message.
*/
public function printWarningMessage()
{
return ui_print_warning_message(
__(
'Starting with version 773, the new modular system of discovery 2.0 has been implemented. The current
discovery (1.0) and its defined tasks will continue to function normally until the next LTS version,
in which migration to the new system will be mandatory.
The tasks of the current discovery (1.0) will be marked as legacy although it will not affect their
operation, it will only be a visual indicator to identify and differentiate the tasks of discovery 1.0
from those of the new version 2.0.
In the intermediate versions between the 773 and the next LTS version, more applications of the new
discovery 2.0 will be added. Both new and those that will come to replace the applications of the
current discovery 1.0. In addition, an automatic migration tool for legacy (1.0) tasks to the new 2.0
model will be included.'
)
);
}
}

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>Icons/Dark/20/checkbox-on@svg</title>
<g id="Icons/Dark/20/checkbox-on" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect id="Rectangle-2" stroke="#82b92e" stroke-width="2" x="1" y="1" width="18" height="18" rx="4"></rect>
<path d="M14.3713994,6.22237132 C14.8008905,5.87515972 15.4305323,5.94186038 15.7777439,6.37135141 C16.098247,6.76780467 16.0660673,7.33480068 15.7214138,7.69277628 L15.6287639,7.77769594 L8.20693177,13.7776959 C7.78987666,14.114854 7.18888164,14.0598005 6.83812914,13.672688 L6.76182606,13.5774872 L4.18365814,9.93238606 C3.86473931,9.48148781 3.97172977,8.85742777 4.42262802,8.53850895 C4.83884178,8.24412234 5.40260169,8.31264068 5.73770948,8.67956758 L5.81650513,8.77747883 L7.77861597,11.5510307 L14.3713994,6.22237132 Z" id="Path-10" fill="#82b92e" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / delete-v2@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-delete-v2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group" transform="translate(10.000000, 10.000000) rotate(45.000000) translate(-10.000000, -10.000000) translate(4.000000, 4.000000)" fill="#e63c52">
<path d="M6,0 C6.51283584,0 6.93550716,0.38604019 6.99327227,0.883378875 L7,1 L7,5 L11,5 C11.5522847,5 12,5.44771525 12,6 C12,6.51283584 11.6139598,6.93550716 11.1166211,6.99327227 L11,7 L7,7 L7,11 C7,11.5522847 6.55228475,12 6,12 C5.48716416,12 5.06449284,11.6139598 5.00672773,11.1166211 L5,11 L5,7 L1,7 C0.44771525,7 0,6.55228475 0,6 C0,5.48716416 0.38604019,5.06449284 0.883378875,5.00672773 L1,5 L5,5 L5,1 C5,0.44771525 5.44771525,0 6,0 Z" id="Path-7"></path>
</g>
<path d="M10,0 C4.4771525,0 0,4.4771525 0,10 C0,15.5228475 4.4771525,20 10,20 C15.5228475,20 20,15.5228475 20,10 C20,4.4771525 15.5228475,0 10,0 Z M10,2 C14.418278,2 18,5.581722 18,10 C18,14.418278 14.418278,18 10,18 C5.581722,18 2,14.418278 2,10 C2,5.581722 5.581722,2 10,2 Z" id="Oval" fill="#e63c52"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,7 @@
<?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>Security scan@svg</title>
<g id="Security-scan" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M12,3 C13.6568542,3 15,4.34314575 15,6 L15,8 L13,8 L13,6 C13,5.44771525 12.5522847,5 12,5 L8,5 C7.44771525,5 7,5.44771525 7,6 L7,8 L5,8 L5,6 C5,4.34314575 6.34314575,3 8,3 L12,3 Z M4,0 C4.55228475,0 5,0.44771525 5,1 C5,1.51283584 4.61395981,1.93550716 4.11662113,1.99327227 L4,2 L2,2 L2,4.00298691 C2,4.51582275 1.61395981,4.93849407 1.11662113,4.99625918 L1,5.00298691 C0.487164161,5.00298691 0.0644928393,4.61694672 0.00672773133,4.11960803 L0,4.00298691 L0,1 C0,0.487164161 0.38604019,0.0644928393 0.883378875,0.00672773133 L1,0 L4,0 Z M19,0 L19.1166211,0.00672773133 C19.6139598,0.0644928393 20,0.487164161 20,1 L20,4.00298691 L19.9932723,4.11960803 C19.9355072,4.61694672 19.5128358,5.00298691 19,5.00298691 L18.8833789,4.99625918 C18.3860402,4.93849407 18,4.51582275 18,4.00298691 L18,2 L16,2 L15.8833789,1.99327227 C15.3860402,1.93550716 15,1.51283584 15,1 C15,0.44771525 15.4477153,0 16,0 L19,0 Z M1,15 L1.11662113,15.0067277 C1.61395981,15.0644928 2,15.4871642 2,16 L2,18.0029869 L4,18.0029869 L4.11662113,18.0097146 C4.61395981,18.0674797 5,18.4901511 5,19.0029869 C5,19.5552717 4.55228475,20.0029869 4,20.0029869 L1,20.0029869 L0.883378875,19.9962592 C0.38604019,19.9384941 0,19.5158227 0,19.0029869 L0,16 L0.00672773133,15.8833789 C0.0644928393,15.3860402 0.487164161,15 1,15 Z M19,15 C19.5128358,15 19.9355072,15.3860402 19.9932723,15.8833789 L20,16 L20,19.0029869 C20,19.5158227 19.6139598,19.9384941 19.1166211,19.9962592 L19,20.0029869 L16,20.0029869 C15.4477153,20.0029869 15,19.5552717 15,19.0029869 C15,18.4901511 15.3860402,18.0674797 15.8833789,18.0097146 L16,18.0029869 L18,18.0029869 L18,16 C18,15.4871642 18.3860402,15.0644928 18.8833789,15.0067277 L19,15 Z M15,12 L15,14 C15,15.1045695 14.1045695,16 13,16 L7,16 C5.8954305,16 5,15.1045695 5,14 L5,12 L15,12 Z M1,9 L19,9 C19.5522847,9 20,9.44771525 20,10 C20,10.5522847 19.5522847,11 19,11 L1,11 C0.44771525,11 6.76353751e-17,10.5522847 0,10 C-6.76353751e-17,9.44771525 0.44771525,9 1,9 Z" id="Path-54" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -65,8 +65,8 @@ if ($check_web) {
__('Agent Web monitoring created on welcome'),
];
$id_agent = api_set_new_agent(0, '', $array_other, '', true);
if ($id_agent > 0) {
$id_agent = api_set_new_agent(0, '', $array_other, '', true, true);
if (is_integer($id_agent)) {
$module_name = get_parameter('module_name', 'Web_monitoring_module');
$text_to_search = get_parameter('text_to_search', '');
$url_goliat = get_parameter('url_goliat', 'https://pandorafms.com/en/');
@ -76,7 +76,7 @@ if ($check_web) {
ui_print_success_message(__('Your check has been created, <a href='.ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agent).'>click here to view the data</a>. Please note that it may take a few seconds to see data if your server is busy'));
}
} else {
ui_print_error_message(__('The Name is not valid for the modules.'));
ui_print_error_message(__($id_agent));
}
} else {
ui_print_error_message(__('Web server is not enabled.'));
@ -110,8 +110,8 @@ if ($check_connectivity) {
__('Basic connectivity'),
];
$id_agent = api_set_new_agent(0, '', $array_other, '', true);
if ($id_agent > 0) {
$id_agent = api_set_new_agent(0, '', $array_other, '', true, true);
if (is_integer($id_agent)) {
$ip_target = get_parameter('ip_target', '127.0.0.1');
$basic_network = create_module_basic_network($id_agent, $id_group, $ip_target);
$latency_network = create_module_latency_network($id_agent, $id_group, $ip_target);
@ -120,7 +120,7 @@ if ($check_connectivity) {
ui_print_success_message(__('Your check has been created, <a href='.ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agent).'>click here to view the data</a>. Please note that it may take a few seconds to see data if your server is busy'));
}
} else {
ui_print_error_message(__('The Name is not valid for the modules.'));
ui_print_error_message(__($id_agent));
}
} else {
ui_print_error_message(__('Web server is not enabled.'));

View File

@ -809,7 +809,6 @@ class AgentWizard extends HTML
// Fill with SNMP versions allowed.
$fieldsVersions = [
'1' => '1',
'2' => '2',
'2c' => '2c',
'3' => '3',
];

View File

@ -53,7 +53,10 @@ class AlertsList
*
* @var array
*/
public $AJAXMethods = ['loadModal', 'drawTable'];
public $AJAXMethods = [
'loadModal',
'drawTable',
];
/**

View File

@ -1112,7 +1112,6 @@ class CredentialStore extends Wizard
'script' => 'showVersion()',
'fields' => [
'1' => __('1'),
'2' => __('2'),
'2c' => __('2c'),
'3' => __('3'),
],

View File

@ -679,7 +679,7 @@ class WelcomeWindow extends Wizard
)
);
echo html_print_label_input_block(
__('Module group'),
__('Agent group'),
html_print_select_from_sql(
'SELECT * FROM tgrupo ORDER BY nombre',
'id_group',

View File

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

View File

@ -1916,7 +1916,7 @@ function api_set_update_agent_field($id_agent, $use_agent_alias, $params)
*
* @param $thrash3 Don't use.
*/
function api_set_new_agent($id_node, $thrash2, $other, $trhash3, $return=false)
function api_set_new_agent($id_node, $thrash2, $other, $trhash3, $return=false, $message=false)
{
global $config;
@ -2009,16 +2009,40 @@ function api_set_new_agent($id_node, $thrash2, $other, $trhash3, $return=false)
// Check if agent exists (BUG WC-50518-2).
if ($alias == '' && $alias_as_name === 0) {
if ($message === true) {
return 'No agent alias specified';
}
returnError('No agent alias specified');
} else if (agents_get_agent_id($nombre_agente)) {
if ($message === true) {
return 'The agent name already exists in DB.';
}
returnError('The agent name already exists in DB.');
} else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$grupo) === false) {
if ($message === true) {
return 'The group does not exist.';
}
returnError('The group does not exist.');
} else if (group_allow_more_agents($grupo, true, 'create') === false) {
if ($message === true) {
return 'Agent cannot be created due to the maximum agent limit for this group';
}
returnError('Agent cannot be created due to the maximum agent limit for this group');
} else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$id_os) === false) {
if ($message === true) {
return 'The OS does not exist.';
}
returnError('The OS does not exist.');
} else if ($server_name === false) {
if ($message === true) {
return 'The '.get_product_name().' Server does not exist.';
}
returnError('The '.get_product_name().' Server does not exist.');
} else {
if ($alias_as_name === 1) {
@ -13122,7 +13146,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
$ack_utimestamp = $val['ack_utimestamp'];
$values['id_usuario'] = $val['id_usuario'];
}
api_set_validate_event_by_id($val['id_evento']);
}
}

View File

@ -1489,6 +1489,15 @@ function config_update_config()
$interval_values_array = explode(',', $interval_values);
if (in_array($new_interval, $interval_values_array) === false) {
$interval_values_array[] = $new_interval;
// Get current periods.
$current_period = get_periods(false, false, true);
if (!isset($current_period[-1])) {
$new_current_period = array_keys($current_period);
$new_current_period = implode(',', $new_current_period);
// Add new periods to current.
array_push($interval_values_array, $new_current_period);
}
$interval_values = implode(',', $interval_values_array);
}
}
@ -4079,7 +4088,11 @@ function config_prepare_session()
}
if ($update_cookie === true) {
if ((int) $user['session_max_time_expire'] > 0 && time() < $user['session_max_time_expire']) {
if (isset($user) === true
&& isset($user['session_max_time_expire']) === true
&& (int) $user['session_max_time_expire'] > 0
&& time() < $user['session_max_time_expire']
) {
$sessionMaxTimeout = $user['session_max_time_expire'];
} else {
$sessionMaxTimeout = (time() + $sessionCookieExpireTime);

View File

@ -2608,22 +2608,27 @@ function events_print_type_img(
case 'going_down_critical':
case 'going_up_critical':
// This is to be backwards compatible.
$style .= ' event_module_background_state icon_background_critical';
$icon = 'images/module_critical.png';
break;
case 'going_up_normal':
case 'going_down_normal':
// This is to be backwards compatible.
$style .= ' event_module_background_state icon_background_normal';
// $style .= ' event_module_background_state icon_background_normal';
$icon = 'images/module_ok.png';
break;
case 'going_up_warning':
$icon = 'images/module_warning.png';
// $style .= ' event_module_background_state icon_background_warning';
case 'going_down_warning':
$style .= ' event_module_background_state icon_background_warning';
$icon = 'images/module_warning.png';
// $style .= ' event_module_background_state icon_background_warning';
break;
case 'going_unknown':
$style .= ' event_module_background_state icon_background_unknown';
// $style .= ' event_module_background_state icon_background_unknown';
$icon = 'images/module_unknown.png';
break;
case 'alert_fired':
@ -2660,23 +2665,24 @@ function events_print_type_img(
if ($only_url) {
$output = $urlImage.'/'.$icon;
} else {
$output .= html_print_div(
[
'title' => events_print_type_description($type, true),
'class' => $style,
'style' => ((empty($icon) === false) ? 'background-image: url('.$icon.'); background-repeat: no-repeat;' : ''),
],
true
);
/*
$output .= html_print_image(
$output .= html_print_div(
[
'title' => events_print_type_description($type, true),
'class' => $style,
'style' => ((empty($icon) === false) ? 'background-image: url('.$icon.'); background-repeat: no-repeat;' : ''),
],
true
);
*/
$output .= html_print_image(
$icon,
true,
[
'title' => events_print_type_description($type, true),
'class' => $style,
]
);*/
);
}
if ($return) {
@ -2779,16 +2785,14 @@ function events_print_type_img_pdf(
break;
case 'new_agent':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / agents@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-agents" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group" transform="translate(0.000000, 1.000000)">
<rect id="Rectangle" fill="#3F3F3F" x="0" y="6" width="10" height="6" rx="1"></rect>
<polyline id="Path-43" stroke="#3F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" points="3 4 6.9967103 -2.30926389e-14 15 -2.30926389e-14 19 4 19 14 15 18 6.9967103 18 3 14.0223656"></polyline>
</g>
</g>
</svg>';
$svg = html_print_image(
'/images/agent_mc.png',
true,
[
'class' => 'image_status invert_filter',
'title' => 'agents',
]
);
break;
case 'configuration_change':
@ -2803,6 +2807,18 @@ function events_print_type_img_pdf(
break;
case 'unknown':
break;
case 'alert_fired':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / alert@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-alert" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,20 C11.4190985,20 12.5702076,18.8808594 12.5702076,17.5 L7.42979244,17.5 C7.42979244,18.8808594 8.5809015,20 10,20 Z M18.6540098,14.1519531 C17.8777645,13.3410156 16.425318,12.1210937 16.425318,8.125 C16.425318,5.08984375 14.2364028,2.66015625 11.2849029,2.0640625 L11.2849029,1.25 C11.2849029,0.559765625 10.7095493,0 10,0 C9.29045075,0 8.71509711,0.559765625 8.71509711,1.25 L8.71509711,2.0640625 C5.76359722,2.66015625 3.57468198,5.08984375 3.57468198,8.125 C3.57468198,12.1210938 2.12223547,13.3410156 1.3459902,14.1519531 C1.10492023,14.4039062 0.998045886,14.7050781 1.00002702,15 C1.00447442,15.640625 1.52156948,16.25 2.28977909,16.25 L17.7102209,16.25 C18.4784305,16.25 18.9959274,15.640625 18.999973,15 C19.0019541,14.7050781 18.8950798,14.4035156 18.6540098,14.1519531 L18.6540098,14.1519531 Z" id="Shape" fill="#e63c52"></path>
</g>
</svg>';
break;
default:
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / event@svg</title>

View File

@ -2227,7 +2227,7 @@ function html_print_extended_select_for_time(
$nothing_value,
false,
false,
false,
true,
$class,
$readonly,
'font-size: xx-small;'.$select_style
@ -6241,6 +6241,57 @@ function html_print_input($data, $wrapper='div', $input_only=false)
<?php
break;
case 'datetime':
$date = (empty($data['value']) === true) ? '' : date('Y-m-d', $data['value']);
$time = (empty($data['value']) === true) ? '' : date('H:i:s', $data['value']);
ui_require_css_file('datepicker');
ui_include_time_picker();
ui_require_jquery_file(
'ui.datepicker-'.get_user_language(),
'include/javascript/i18n/'
);
$inputDate = html_print_input_text(
$data['name'].'_date',
$date,
'',
false,
10,
true,
false,
false,
'',
'',
'',
'off'
);
$inputTime = html_print_input_text(
$data['name'].'_time',
$time,
'',
false,
10,
true,
false,
false,
'',
'',
'',
'off'
);
$output .= html_print_div(
[
'content' => sprintf(
'<div class="datetime-adv-opt">%s<span>:</span>%s</div>',
$inputDate,
$inputTime
),
],
true
);
break;
default:
// Ignore.
break;

View File

@ -793,7 +793,7 @@ function modules_create_agent_module(
// Encrypt passwords.
if (isset($values['plugin_pass']) === true) {
// Avoid two times encryption.
$plugin_pass = io_safe_output($values['plugin_pass']);
$plugin_pass = io_output_password($values['plugin_pass']);
$values['plugin_pass'] = io_input_password($plugin_pass);
}

View File

@ -645,9 +645,13 @@ function planned_downtimes_stop($downtime)
foreach ($modules as $module) {
$result = db_process_sql_update(
'tagente_modulo',
['quiet' => 0],
[
'id_agente_modulo' => $module['id_agent_module'],
'quiet' => 0,
'quiet_by_downtime' => 0,
],
[
'quiet_by_downtime' => 1,
'id_agente_modulo' => $module['id_agent_module'],
]
);
@ -672,32 +676,68 @@ function planned_downtimes_stop($downtime)
foreach ($agents as $agent) {
$result = db_process_sql_update(
'tagente',
[
'disabled' => 0,
'update_module_count' => 1,
],
['update_module_count' => 1],
['id_agente' => $agent['id_agent']]
);
if ($result) {
$result_disabled = db_process_sql_update(
'tagente',
[
'disabled' => 0,
'disabled_by_downtime' => 0,
],
[
'disabled_by_downtime' => 1,
'id_agente' => $agent['id_agent'],
]
);
if ($result !== false && $result_disabled !== false) {
$count++;
}
}
break;
case 'disable_agent_modules':
$update_sql = sprintf(
'UPDATE tagente_modulo tam, tagente ta, tplanned_downtime_modules tpdm
SET tam.disabled = 0, ta.update_module_count = 1
WHERE tpdm.id_agent_module = tam.id_agente_modulo AND
ta.id_agente = tam.id_agente AND
tpdm.id_downtime = %d',
$id_downtime
$agents = db_get_all_rows_filter(
'tplanned_downtime_agents',
['id_downtime' => $id_downtime]
);
if (empty($agents)) {
$agents = [];
}
db_process_sql($update_sql);
$count = 0;
foreach ($agents as $agent) {
$modules = db_get_all_rows_filter(
'tplanned_downtime_modules',
[
'id_agent' => $agent['id_agent'],
'id_downtime' => $id_downtime,
]
);
if (empty($modules)) {
$modules = [];
}
$count = '';
foreach ($modules as $module) {
$result = db_process_sql_update(
'tagente_modulo',
[
'disabled' => 0,
'disabled_by_downtime' => 0,
],
[
'disabled_by_downtime' => 1,
'id_agente_modulo' => $module['id_agent_module'],
]
);
if ($result !== false) {
$count++;
}
}
}
break;
case 'disable_agents_alerts':
@ -722,13 +762,17 @@ function planned_downtimes_stop($downtime)
foreach ($modules as $module) {
$result = db_process_sql_update(
'talert_template_modules',
['disabled' => 0],
[
'id_agent_module' => $module['id_agente_modulo'],
'disabled' => 0,
'disabled_by_downtime' => 0,
],
[
'disabled_by_downtime' => 1,
'id_agent_module' => $module['id_agente_modulo'],
]
);
if ($result) {
if ($result !== false) {
$count++;
}
}

View File

@ -782,7 +782,6 @@ function snmp_browser_print_container(
html_print_select(
[
'1' => 'v. 1',
'2' => 'v. 2',
'2c' => 'v. 2c',
'3' => 'v. 3',
],

View File

@ -4066,7 +4066,7 @@ function ui_print_datatable(array $parameters)
'',
'',
$parameters['toggle_collapsed'],
false,
(isset($parameters['form']['return_filter']) === false) ? false : $parameters['form']['return_filter'],
'',
'no-border filter-datatable-submain',
'filter-datatable-main '.$parameters['filter_main_class']
@ -4193,6 +4193,7 @@ function ui_print_datatable(array $parameters)
$spinner = '<div id="'.$table_id.'-spinner" class="spinner-fixed"><span></span><span></span><span></span><span></span></div>';
// TODO This widget should take a return: ui_print_info_message($info_msg_arr, '', true)
$info_msg = '<div>'.ui_print_info_message($info_msg_arr).'</div>';
$err_msg = '<div id="error-'.$table_id.'"></div>';

View File

@ -486,6 +486,40 @@ function ring_graph(
}
/**
* Radar graph RADAR.
*
* @param array $chart_data Data.
* @param array $options Options.
*
* @return string Output html charts
*/
function radar_graph(
$chart_data,
$options
) {
$chart = get_build_setup_charts('RADAR', $options, $chart_data);
return $chart->render(true, true);
}
/**
* Line graph LINE.
*
* @param array $chart_data Data.
* @param array $options Options.
*
* @return string Output html charts
*/
function line_graph(
$chart_data,
$options
) {
$chart = get_build_setup_charts('LINE', $options, $chart_data);
return $chart->render(true, true);
}
function get_build_setup_charts($type, $options, $data)
{
global $config;
@ -505,6 +539,14 @@ function get_build_setup_charts($type, $options, $data)
$chart = $factory->create($factory::BAR);
break;
case 'RADAR':
$chart = $factory->create($factory::RADAR);
break;
case 'LINE':
$chart = $factory->create($factory::LINE);
break;
default:
// code...
break;
@ -649,6 +691,17 @@ function get_build_setup_charts($type, $options, $data)
}
$chart->options()->setMaintainAspectRatio($maintainAspectRatio);
if (isset($options['elements']) === true) {
if (isset($options['elements']['center']) === true) {
if (isset($options['elements']['center']['text']) === true) {
$chart->options()->getElements()->center()->setText($options['elements']['center']['text']);
}
if (isset($options['elements']['center']['color']) === true) {
$chart->options()->getElements()->center()->setColor($options['elements']['center']['color']);
}
}
}
// Set Responsive for responsive charts.
$responsive = true;
@ -942,19 +995,31 @@ function get_build_setup_charts($type, $options, $data)
) {
$scales = $chart->options()->getScales();
// Defaults scalesFont X.
$scalesXFonts = $scales->getX()->ticks()->getFonts();
$scalesXFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$scalesXFonts->setStyle('normal');
$scalesXFonts->setWeight(600);
$scalesXFonts->setSize(((int) $config['font_size'] + 2));
if ($options['scales']['x'] !== false) {
// Defaults scalesFont X.
$scalesXFonts = $scales->getX()->ticks()->getFonts();
$scalesXFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$scalesXFonts->setStyle('normal');
$scalesXFonts->setWeight(600);
$scalesXFonts->setSize(((int) $config['font_size'] + 2));
}
// Defaults scalesFont Y.
$scalesYFonts = $scales->getY()->ticks()->getFonts();
$scalesYFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$scalesYFonts->setStyle('normal');
$scalesYFonts->setWeight(600);
$scalesYFonts->setSize(((int) $config['font_size'] + 2));
if ($options['scales']['y'] !== false) {
// Defaults scalesFont Y.
$scalesYFonts = $scales->getY()->ticks()->getFonts();
$scalesYFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$scalesYFonts->setStyle('normal');
$scalesYFonts->setWeight(600);
$scalesYFonts->setSize(((int) $config['font_size'] + 2));
}
if ($options['scales']['r'] !== false) {
// Defaults scalesFont R.
$scalesRFonts = $scales->getR()->pointLabels()->getFonts();
$scalesRFonts->setStyle('normal');
$scalesRFonts->setWeight(600);
$scalesRFonts->setSize(((int) $config['font_size'] + 2));
}
if (isset($options['scales']['x']) === true
&& empty($options['scales']['x']) === false
@ -1045,6 +1110,50 @@ function get_build_setup_charts($type, $options, $data)
}
}
}
if (isset($options['scales']['r']) === true
&& empty($options['scales']['r']) === false
&& is_array($options['scales']['r']) === true
) {
if (isset($options['scales']['r']['pointLabels']) === true
&& empty($options['scales']['r']['pointLabels']) === false
&& is_array($options['scales']['r']['pointLabels']) === true
) {
if (isset($options['scales']['r']['pointLabels']['color']) === true) {
$scales->getR()->pointLabels()->setColor($options['scales']['r']['pointLabels']['color']);
}
if (isset($options['scales']['r']['grid']['display']) === true) {
$scales->getR()->grid()->setDrawOnChartArea($options['scales']['r']['grid']['display']);
}
if (isset($options['scales']['r']['grid']['color']) === true) {
$scales->getR()->grid()->setColor($options['scales']['r']['grid']['color']);
}
if (isset($options['scales']['r']['angleLines']['color']) === true) {
$scales->getR()->angleLines()->setColor($options['scales']['r']['angleLines']['color']);
}
if (isset($options['scales']['r']['pointLabels']['fonts']) === true
&& empty($options['scales']['r']['pointLabels']['fonts']) === false
&& is_array($options['scales']['r']['pointLabels']['fonts']) === true
) {
$scaleRpointLabelsFonts = $scales->getR()->pointLabels()->getFonts();
if (isset($options['scales']['r']['pointLabels']['fonts']['size']) === true) {
$scaleRpointLabelsFonts->setSize($options['scales']['r']['pointLabels']['fonts']['size']);
}
if (isset($options['scales']['r']['pointLabels']['fonts']['style']) === true) {
$scaleRpointLabelsFonts->setStyle($options['scales']['r']['pointLabels']['fonts']['style']);
}
if (isset($options['scales']['r']['pointLabels']['fonts']['weight']) === true) {
$scaleRpointLabelsFonts->setWeight($options['scales']['r']['pointLabels']['fonts']['weight']);
}
}
}
}
}
// Color.
@ -1102,12 +1211,45 @@ function get_build_setup_charts($type, $options, $data)
}
break;
case 'RADAR':
foreach ($data as $key => $dataset) {
$dataSet1 = $chart->createDataSet();
$dataSet1->setBackgroundColor($dataset['backgroundColor']);
$dataSet1->setBorderColor($dataset['borderColor']);
$dataSet1->setPointBackgroundColor($dataset['pointBackgroundColor']);
$dataSet1->setPointBorderColor($dataset['pointBorderColor']);
$dataSet1->setPointHoverBackgroundColor($dataset['pointHoverBackgroundColor']);
$dataSet1->setPointHoverBorderColor($dataset['pointHoverBorderColor']);
$dataSet1->data()->exchangeArray($dataset['data']);
$chart->addDataSet($dataSet1);
}
break;
case 'LINE':
$chart->labels()->exchangeArray($options['labels']);
foreach ($data as $key => $dataset) {
$dataSet1 = $chart->createDataSet();
$dataSet1->setLabel($dataset['label']);
$dataSet1->setBackgroundColor($dataset['backgroundColor']);
$dataSet1->setBorderColor($dataset['borderColor']);
$dataSet1->setPointBackgroundColor($dataset['pointBackgroundColor']);
$dataSet1->setPointBorderColor($dataset['pointBorderColor']);
$dataSet1->setPointHoverBackgroundColor($dataset['pointHoverBackgroundColor']);
$dataSet1->setPointHoverBorderColor($dataset['pointHoverBorderColor']);
$dataSet1->data()->exchangeArray($dataset['data']);
$chart->addDataSet($dataSet1);
}
break;
default:
// Not possible.
break;
}
$chart->addDataSet($setData);
if ($type !== 'RADAR' && $type !== 'LINE') {
$chart->addDataSet($setData);
}
return $chart;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -226,6 +226,10 @@ class TopNEventByGroupWidget extends Widget
$values['legendPosition'] = $decoder['legendPosition'];
}
if (isset($decoder['show_total_data']) === true) {
$values['show_total_data'] = $decoder['show_total_data'];
}
return $values;
}
@ -329,6 +333,16 @@ class TopNEventByGroupWidget extends Widget
],
];
$inputs[] = [
'label' => __('Show total data'),
'arguments' => [
'type' => 'switch',
'name' => 'show_total_data',
'value' => $values['show_total_data'],
'return' => true,
],
];
return $inputs;
}
@ -347,6 +361,7 @@ class TopNEventByGroupWidget extends Widget
$values['maxHours'] = \get_parameter('maxHours', 0);
$values['groupId'] = \get_parameter('groupId', []);
$values['legendPosition'] = \get_parameter('legendPosition', 0);
$values['show_total_data'] = \get_parameter_switch('show_total_data', 0);
return $values;
}
@ -364,7 +379,7 @@ class TopNEventByGroupWidget extends Widget
$output = '';
$size = parent::getSize();
$show_total_data = (bool) $this->values['show_total_data'];
$this->values['groupId'] = explode(',', $this->values['groupId'][0]);
if (empty($this->values['groupId']) === true) {
@ -473,6 +488,7 @@ class TopNEventByGroupWidget extends Widget
} else {
$data_pie = [];
$labels = [];
$sum = 0;
foreach ($result as $row) {
if ($row['id_agente'] == 0) {
$name = __('System');
@ -494,7 +510,7 @@ class TopNEventByGroupWidget extends Widget
}
$name .= ' ('.$row['count'].')';
$sum += $row['count'];
$labels[] = io_safe_output($name);
$data_pie[] = $row['count'];
}
@ -524,17 +540,37 @@ class TopNEventByGroupWidget extends Widget
break;
}
$output .= pie_graph(
$data_pie,
[
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'labels' => $labels,
]
);
if ($show_total_data === true) {
$output .= ring_graph(
$data_pie,
[
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'elements' => [
'center' => [
'text' => $sum,
'color' => '#2c3e50',
],
],
'labels' => $labels,
]
);
} else {
$output .= pie_graph(
$data_pie,
[
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'labels' => $labels,
]
);
}
}
return $output;

View File

@ -78,6 +78,17 @@ class SpecialDay extends Entity
// Update.
$updates = $this->fields;
$exist_special_days = $this->specialDays(
[ '`talert_special_days`.*' ],
['date_match' => $updates['date']]
);
if (count($exist_special_days) > 0) {
throw new \Exception(
__('Already exist special day in this day.'),
);
}
$rs = \db_process_sql_update(
$this->table,
$updates,
@ -94,6 +105,17 @@ class SpecialDay extends Entity
// Creation.
$inserts = $this->fields;
$exist_special_days = $this->specialDays(
[ '`talert_special_days`.*' ],
['date_match' => $inserts['date']]
);
if (count($exist_special_days) > 0) {
throw new \Exception(
__('Already exist special day in this day.'),
);
}
// Clean null fields.
foreach ($inserts as $k => $v) {
if ($v === null) {

View File

@ -1281,6 +1281,11 @@ p.center {
margin-right: 10px;
}
.margin-lr-5 {
margin-left: 5px;
margin-right: 5px;
}
.img_help {
cursor: help;
margin: 0 5px;

View File

@ -0,0 +1,135 @@
.details_table b {
font-size: 12px;
}
.details_table {
width: 99% !important;
}
.dataTables_length {
margin: 10px 0px 20px 20px;
}
.dataTables_paginate.paging_simple_numbers {
margin: 10px 20px 20px 0px;
margin-right: 20px !important;
}
.row-graphs {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: center;
}
.col-md-3 {
width: 30%;
margin: 10px;
}
.col-md-6 {
width: 35%;
margin: 10px;
}
.text-fail {
font-size: 18px;
color: #e63c52;
display: flex;
align-items: center;
font-weight: 800;
}
.text-passed {
font-size: 18px;
color: #82b92e;
display: flex;
align-items: center;
font-weight: 800;
}
.text-passed img {
margin: 0px 5px 0px 11px;
}
.text-fail img {
margin: 0px 5px 0px 11px;
}
.text-calendar {
margin-left: 20px;
display: flex;
font-size: 13px;
align-items: center;
}
.text-scored b {
margin-left: 5px;
font-size: 13px;
align-items: center;
}
.text-calendar b {
font-size: 13px;
}
.text-calendar img {
margin-right: 10px;
}
.issues-audit {
margin: 11px 12px 0px 18px;
}
.pdd_b_40px {
padding-bottom: 40px !important;
}
.custom-filter {
width: 95%;
margin: 21px auto;
}
.time-line {
max-height: 300px;
}
.summary_categories {
width: 80%;
margin: 20px;
}
#list_total_resume .sorting_asc {
background-image: none;
}
#form_list_resume {
display: flex;
align-items: flex-end;
}
#form_list_total_resume {
display: flex;
align-items: flex-end;
}
.dt-buttons {
display: flex;
margin-top: 10px;
}
#date-result {
padding-left: 4px !important;
}
@media (max-width: 1500px) {
.col-md-3 {
width: 40%;
}
.col-md-6 {
width: 88%;
}
.issues-audit {
justify-content: center;
}
.time-line {
max-height: 230px;
}
}

View File

@ -1042,6 +1042,33 @@ if (isset($config['id_user']) === false) {
}
}
if ((bool) ($config['maintenance_mode'] ?? false) === true
&& is_user_admin($config['id_user']) === false
) {
// Show maintenance web-page. For non-admin users only.
include $config['homedir'].'/general/maintenance.php';
while (ob_get_length() > 0) {
ob_end_flush();
}
exit('</html>');
}
if ((bool) ($config['maintenance_mode'] ?? false) === true
&& $page !== 'advanced/command_center'
&& is_user_admin($config['id_user']) === true
) {
// Prevent access to metaconsole if not merged.
include 'general/admin_maintenance_mode.php';
while (ob_get_length() > 0) {
ob_end_flush();
}
exit('</html>');
}
// Enterprise support.
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
include_once ENTERPRISE_DIR.'/load_enterprise.php';

View File

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

View File

@ -223,6 +223,14 @@ if ($loaded_filter['id_filter'] > 0) {
if (is_array($policies) === false) {
$policies = json_decode(io_safe_output($policies), true);
}
// Fav menu.
$fav_menu = [
'id_element' => $loaded_filter['id_filter'],
'url' => 'operation/agentes/estado_agente&pure=&load_filter=1&filter_id='.$loaded_filter['id_filter'],
'label' => $loaded_filter['id_name'],
'section' => 'Agente',
];
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
@ -267,7 +275,8 @@ ui_print_standard_header(
'link' => '',
'label' => __('Views'),
],
]
],
(empty($fav_menu) === true) ? [] : $fav_menu
);
if ((bool) $strict_user === false) {

View File

@ -42,6 +42,7 @@ ui_require_javascript_file('openlayers.pandora');
ui_require_css_file('agent_view');
enterprise_include_once('operation/agentes/ver_agente.php');
enterprise_include_once('include/functions_security_hardening.php');
check_login();
if (is_ajax()) {
@ -1744,6 +1745,20 @@ $external_tools['text'] = html_print_menu_button(
$external_tools['active'] = ($tab === 'external_tools');
if (enterprise_installed() === true && security_hardening_installed() === true) {
// External Tools tab.
$security_hardening['text'] = html_print_menu_button(
[
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=security_hardening&id_agente='.$id_agente,
'image' => 'images/security_scan@svg.svg',
'title' => __('Security hardening'),
],
true
);
$security_hardening['active'] = ($tab === 'security_hardening');
}
$onheader = [
'manage' => ($managetab ?? null),
'main' => ($maintab ?? null),
@ -1761,6 +1776,7 @@ $onheader = [
'sap_view' => ($saptab ?? null),
'ncm_view' => ($ncm_tab ?? null),
'external_tools' => ($external_tools ?? null),
'security_hardening' => ($security_hardening ?? null),
'incident' => ($incidenttab ?? null),
'omnishell' => ($omnishellTab ?? null),
];
@ -1941,6 +1957,10 @@ switch ($tab) {
$tab_name = __('External Tools');
break;
case 'security_hardening':
$tab_name = __('Security hardening');
break;
default:
$tab_name = '';
$help_header = '';
@ -2086,6 +2106,10 @@ switch ($tab) {
include 'external_tools.php';
break;
case 'security_hardening':
enterprise_include('operation/agentes/security_hardening.php');
break;
case 'extension':
$found = false;
foreach ($config['extensions'] as $extension) {

View File

@ -250,6 +250,17 @@ try {
echo csv_format_delimiter(io_safe_output($custom_data));
break;
case 'timestamp':
$target_timezone = date_default_timezone_get();
$utimestamp = $row['utimestamp'];
$datetime = new DateTime("@{$utimestamp}");
$new_datetime_zone = new DateTimeZone($target_timezone);
$datetime->setTimezone($new_datetime_zone);
$formatted_date = $datetime->format('Y-m-d H:i:s');
echo csv_format_delimiter($formatted_date);
break;
default:
echo csv_format_delimiter(io_safe_output($row[$key]));
break;

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.772
%define release 230807
%define version 7.0NG.773
%define release 230818
# User and Group under which Apache is running
%define httpd_name httpd
@ -86,6 +86,16 @@ else
echo "Please, now, point your browser to http://your_IP_address/pandora_console/install.php and follow all the steps described on it."
fi
# Delete old dprecated files
if [ -f %{prefix}/pandora_console/extras/delete_files/delete_files.txt ] ; then
echo "Deleting old deprecated files"
cd %{prefix}/pandora_console/
rm -rf `cat extras/delete_files/delete_files.txt`
cd - > /dev/null
echo "Done deleting deprecated files"
fi
%preun
# Upgrading

View File

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

View File

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

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.772"
PI_VERSION="7.0NG.773"
FORCE=0
DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

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