Merge remote-tracking branch 'origin/develop' into ent-7074-Command-Center

This commit is contained in:
Daniel Barbero Martin 2021-05-26 08:28:42 +02:00
commit d91e7f6aba
39 changed files with 405 additions and 40 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.754-210525
Version: 7.0NG.754-210526
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.754-210525"
pandora_version="7.0NG.754-210526"
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

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.754';
use constant AGENT_BUILD => '210525';
use constant AGENT_BUILD => '210526';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.754
%define release 210525
%define release 210526
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.754
%define release 210525
%define release 210526
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.754"
PI_BUILD="210525"
PI_BUILD="210526"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{210525}
{210526}
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.754 Build 210525")
#define PANDORA_VERSION ("7.0NG.754 Build 210526")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.754(Build 210525))"
VALUE "ProductVersion", "(7.0NG.754(Build 210526))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.754-210525
Version: 7.0NG.754-210526
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.754-210525"
pandora_version="7.0NG.754-210526"
package_pear=0
package_pandora=1

View File

@ -11,4 +11,14 @@ ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field18` TEXT NOT NULL AFTER `al
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field19` TEXT NOT NULL AFTER `al_field18`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field20` TEXT NOT NULL AFTER `al_field19`;
SET @st_oum755 = (SELECT IF(
(SELECT COUNT(*) FROM tconfig WHERE token LIKE 'meta_custom_logo' AND value like 'logo_pandora_metaconsola.png') > 0,
"UPDATE `tconfig` set value = 'pandoraFMS_metaconsole_full.svg' WHERE token LIKE 'meta_custom_logo'",
"SELECT 1"
));
PREPARE pr_oum755 FROM @st_oum755;
EXECUTE pr_oum755;
DEALLOCATE PREPARE pr_oum755;
COMMIT;

View File

@ -319,7 +319,7 @@ if ($edit_graph) {
'view' => [
'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$id_graph.'">'.html_print_image(
'images/operation.png',
'images/eye.png',
true,
[
'title' => __('View graph'),

View File

@ -3209,7 +3209,7 @@ if ($enterpriseEnable) {
$buttons['view'] = [
'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$idReport.'&pure='.$pure.'">'.html_print_image(
'images/operation.png',
'images/eye.png',
true,
[
'title' => __('View report'),

View File

@ -439,6 +439,12 @@ if ($create_user) {
if ($result) {
$res = save_pass_history($id, $password_new);
} else {
$is_err = true;
$user_info = $values;
$password_new = '';
$password_confirm = '';
$new_user = true;
}
db_pandora_audit(

View File

@ -488,7 +488,7 @@ class AgentsAlerts extends HTML
$nagents = count(agents_get_agents($filter_count));
if ($agents == false) {
if ($agents === false || empty($agents_with_alerts) === true) {
ui_print_info_message(
[
'no_close' => true,

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC210525';
$build_version = 'PC210526';
$pandora_version = 'v7.0NG.754';
// Do not overwrite default timezone set if defined.

View File

@ -7611,6 +7611,305 @@ function api_set_planned_downtimes_additem($id, $thrash1, $other, $thrash3)
}
/**
* Edit planned Downtime.
* e.g.: api.php?op=set&op2=planned_downtimes_edit&apipass=1234&user=admin&pass=pandora&id=2&other=testing2|test2|2021/05/10|2021/06/12|19:03:03|19:55:00|0|0|0|0|0|0|0|0|1|31|quiet|once|weekly&other_mode=url_encode_separator_|
*
* @param $id id of planned downtime.
* @param $thrash1 Don't use.
* @param array $other
* The first index contains a list of agent Ids.
* The second index contains a list of module names.
* The list separator is the character ';'.
* @param $thrash3 Don't use.
*/
function api_set_planned_downtimes_edit($id, $thrash1, $other, $thrash3)
{
global $config;
if (defined('METACONSOLE')) {
return;
}
if (!check_acl($config['id_user'], 0, 'PM')) {
returnError('forbidden', 'string');
return;
}
if ($id == '') {
returnError(
'id cannot be left blank.'
);
return;
}
if (db_get_value('id', 'tplanned_downtime', 'id', $id) === false) {
returnError(
'id does not exist'
);
return;
}
if ($other['data'] == '') {
returnError(
'data cannot be left blank.'
);
return;
}
$values = [];
if (!empty($other['data'][0])) {
$values['name'] = io_safe_input($other['data'][0]);
}
if (!empty($other['data'][1])) {
$values['description'] = io_safe_input($other['data'][1]);
}
if (!empty($other['data'][2]) && !empty($other['data'][4])) {
$date_from = strtotime(html_entity_decode($other['data'][2].' '.$other['data'][4]));
$values['date_from'] = io_safe_input($date_from);
}
if (!empty($other['data'][4])) {
$values['periodically_time_from'] = io_safe_input($other['data'][4]);
}
if (!empty($other['data'][3]) && !empty($other['data'][5])) {
$date_to = strtotime(html_entity_decode($other['data'][3].' '.$other['data'][5]));
$values['date_to'] = io_safe_input($date_to);
}
if (!empty($other['data'][5])) {
$values['periodically_time_to'] = io_safe_input($other['data'][5]);
}
if ($other['data'][6] != '') {
$values['id_group'] = io_safe_input($other['data'][6]);
}
if ($other['data'][7] != '') {
$values['monday'] = io_safe_input($other['data'][7]);
}
if ($other['data'][8] != '') {
$values['tuesday'] = io_safe_input($other['data'][8]);
}
if ($other['data'][9] != '') {
$values['wednesday'] = io_safe_input($other['data'][9]);
}
if ($other['data'][10] != '') {
$values['thursday'] = io_safe_input($other['data'][10]);
}
if ($other['data'][11] != '') {
$values['friday'] = io_safe_input($other['data'][11]);
}
if ($other['data'][12] != '') {
$values['saturday'] = io_safe_input($other['data'][12]);
}
if ($other['data'][13] != '') {
$values['sunday'] = io_safe_input($other['data'][13]);
}
if (!empty($other['data'][14])) {
$values['periodically_day_from'] = io_safe_input($other['data'][14]);
}
if (!empty($other['data'][15])) {
$values['periodically_day_to'] = io_safe_input($other['data'][15]);
}
if (!empty($other['data'][16])) {
$values['type_downtime'] = io_safe_input($other['data'][16]);
}
if (!empty($other['data'][17])) {
$values['type_execution'] = io_safe_input($other['data'][17]);
}
if (!empty($other['data'][18])) {
$values['type_periodicity'] = io_safe_input($other['data'][18]);
}
$res = db_process_sql_update('tplanned_downtime', $values, ['id' => $id]);
if ($res === false) {
returnError('Planned downtime could not be updated');
} else {
returnData(
'string',
[
'type' => 'string',
'data' => __('Planned downtime updated'),
]
);
}
}
/**
* Delete agents in planned Downtime.
* e.g.: pi.php?op=set&op2=planned_downtimes_delete_agents&apipass=1234&user=admin&pass=pandora&id=4&other=1;2;3&other_mode=url_encode_separator_|
*
* @param $id id of planned downtime.
* @param $thrash1 Don't use.
* @param array $other
* The first index contains a list of agent Ids.
* The list separator is the character ';'.
* @param $thrash3 Don't use.
*/
function api_set_planned_downtimes_delete_agents($id, $thrash1, $other, $thrash3)
{
global $config;
if (defined('METACONSOLE')) {
return;
}
if (!check_acl($config['id_user'], 0, 'PM')) {
returnError('forbidden', 'string');
return;
}
if ($id == '') {
returnError(
'id cannot be left blank.'
);
return;
}
if (db_get_value('id', 'tplanned_downtime', 'id', $id) === false) {
returnError(
'id does not exist'
);
return;
}
if ($other['data'] == '') {
returnError(
'data cannot be left blank.'
);
return;
}
if (!empty($other['data'][0])) {
$agents = io_safe_input($other['data']);
$agents = explode(';', $agents);
$results = false;
foreach ($agents as $agent) {
if (db_get_value_sql(sprintf('SELECT id from tplanned_downtime_agents WHERE id_agent = %d AND id_downtime = %d', $agent, $id)) !== false) {
$result = db_process_sql_delete('tplanned_downtime_agents', ['id_agent' => $agent]);
db_process_sql_delete('tplanned_downtime_modules', ['id_agent' => $agent]);
if ($result == false) {
returnError(" Agent $agent could not be deleted.");
} else {
$results = true;
}
} else {
returnError(" Agent $agent is not in planned downtime.");
}
}
if ($results) {
returnData(
'string',
[
'type' => 'string',
'data' => __(' Agents deleted'),
]
);
}
}
}
/**
* Add agents planned Downtime.
* e.g.: api.php?op=set&op2=planned_downtimes_add_agents&apipass=1234&user=admin&pass=pandora&id=4&other=1;2;3&other_mode=url_encode_separator_|
*
* @param $id id of planned downtime.
* @param $thrash1 Don't use.
* @param array $other
* The first index contains a list of agent Ids.
* The list separator is the character ';'.
* @param $thrash3 Don't use.
*/
function api_set_planned_downtimes_add_agents($id, $thrash1, $other, $thrash3)
{
global $config;
if (defined('METACONSOLE')) {
return;
}
if (!check_acl($config['id_user'], 0, 'PM')) {
returnError('forbidden', 'string');
return;
}
if ($id == '') {
returnError(
'id cannot be left blank.'
);
return;
}
if (db_get_value('id', 'tplanned_downtime', 'id', $id) === false) {
returnError(
'id does not exist'
);
return;
}
if ($other['data'] == '') {
returnError(
'data cannot be left blank.'
);
return;
}
if (!empty($other['data'][0])) {
$agents = io_safe_input($other['data']);
$agents = explode(';', $agents);
$results = false;
foreach ($agents as $agent) {
if (db_get_value_sql(sprintf('SELECT id from tplanned_downtime_agents tpd WHERE tpd.id_agent = %d AND id_downtime = %d', $agent, $id)) === false) {
$res = db_process_sql_insert(
'tplanned_downtime_agents',
[
'id_agent' => $agent,
'id_downtime' => $id,
'all_modules' => 0,
'manually_disabled' => 0,
]
);
if ($res) {
$results = true;
}
} else {
returnError(" Agent $agent is already at the planned downtime.");
}
}
if ($results) {
returnData(
'string',
[
'type' => 'string',
'data' => __(' Agents added'),
]
);
}
}
}
/**
* Update data module in policy. And return id from new module.
*

View File

@ -1032,6 +1032,14 @@ function config_update_config()
$error_update[] = __('Custom subtitle header');
}
if (!config_update_value('meta_custom_title_header', (string) get_parameter('meta_custom_title_header'))) {
$error_update[] = __('Meta custom title header');
}
if (!config_update_value('meta_custom_subtitle_header', (string) get_parameter('meta_custom_subtitle_header'))) {
$error_update[] = __('Meta custom subtitle header');
}
if (!config_update_value('custom_title1_login', (string) get_parameter('custom_title1_login'))) {
$error_update[] = __('Custom title1 login');
}
@ -1060,10 +1068,6 @@ function config_update_config()
$error_update[] = __('Copyright notice');
}
if (!config_update_value('meta_custom_logo', (string) get_parameter('meta_custom_logo'))) {
$error_update[] = __('Custom logo metaconsole');
}
if (!config_update_value('meta_custom_logo_white_bg', (string) get_parameter('meta_custom_logo_white_bg'))) {
$error_update[] = __('Custom logo metaconsole (white background)');
}
@ -2291,6 +2295,20 @@ function config_process_config()
config_update_value('custom_logo_collapsed', 'pandora_logo_green_collapsed.png');
}
if (is_metaconsole()) {
if (!isset($config['meta_custom_logo'])) {
config_update_value('meta_custom_logo', 'pandoraFMS_metaconsole_full.svg');
}
if (!isset($config['meta_custom_logo_collapsed'])) {
config_update_value('meta_custom_logo_collapsed', 'pandoraFMS_metaconsole_collapse.svg');
}
if (!isset($config['meta_menu_type'])) {
config_update_value('meta_menu_type', 'classic');
}
}
if (!isset($config['custom_logo_white_bg'])) {
config_update_value('custom_logo_white_bg', 'pandora_logo_head_white_bg.png');
}
@ -2327,6 +2345,14 @@ function config_process_config()
config_update_value('custom_subtitle_header', __('the Flexible Monitoring System'));
}
if (!isset($config['meta_custom_title_header'])) {
config_update_value('meta_custom_title_header', __('PandoraFMS Metaconsole'));
}
if (!isset($config['meta_custom_subtitle_header'])) {
config_update_value('meta_custom_subtitle_header', __('Centralized operation console'));
}
if (!isset($config['custom_title1_login'])) {
config_update_value('custom_title1_login', __('PANDORA FMS'));
}
@ -2359,10 +2385,6 @@ function config_process_config()
config_update_value('meta_custom_support_url', 'https://support.pandorafms.com');
}
if (!isset($config['meta_custom_logo'])) {
config_update_value('meta_custom_logo', 'logo_pandora_metaconsola.png');
}
if (!isset($config['meta_custom_logo_white_bg'])) {
config_update_value('pandora_logo_head_white_bg', 'pandora_logo_head_white_bg.png');
}

View File

@ -706,6 +706,13 @@ class Module extends Entity
$updates = $this->fields;
$updates['id_tipo_modulo'] = $this->moduleType()->id_tipo();
// In the case of the webserver modules, debug_content special characters must be handled.
if ($updates['id_tipo_modulo'] >= MODULE_TYPE_WEB_ANALYSIS
&& $updates['id_tipo_modulo'] <= MODULE_TYPE_WEB_CONTENT_STRING
) {
$updates['debug_content'] = io_safe_input($updates['debug_content']);
}
if ($this->fields['id_agente_modulo'] > 0) {
// Update.
$rs = \db_process_sql_update(

View File

@ -26,6 +26,10 @@
justify-content: center;
}
#img-full-screen {
width: 12em;
}
#full_screen_refresh_box,
#slc-refresh-rate,
#img-full-screen {
@ -45,6 +49,7 @@
.agent_alerts_header_pure {
position: absolute;
z-index: 500;
}
.agents_alerts_header form > ul > li {

View File

@ -1,5 +1,5 @@
div#page {
width: 90% !important;
width: auto;
margin: 0 auto;
}
@ -22,3 +22,11 @@ div#page {
right: 50px;
top: 20px;
}
.select-dashboard-width {
width: 110%;
}
#menu_tab li.nomn form#form-select-dashboard {
margin-top: 0px !important;
}

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.754';
$build = '210525';
$build = '210526';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -70,6 +70,14 @@ if (is_ajax() === true) {
}
}
} else {
if ((bool) is_metaconsole() === true) {
echo '<div class="meta_container_dashboard">';
}
// Run.
$cs->run();
if ((bool) is_metaconsole() === true) {
echo '</div>';
}
}

View File

@ -196,7 +196,7 @@ if ($view_graph) {
}
$options['view']['text'] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$id_graph.'">'.html_print_image(
'images/operation.png',
'images/eye.png',
true,
[
'title' => __('View graph'),

View File

@ -125,7 +125,7 @@ if (check_acl_restricted_all($config['id_user'], $report_group, 'RW')) {
$options['view'] = [
'active' => true,
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$id_report.'&pure='.$pure.'">'.html_print_image(
'images/operation.png',
'images/eye.png',
true,
[
'title' => __('View report'),

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.754
%define release 210525
%define release 210526
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.754
%define release 210525
%define release 210526
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.754
%define release 210525
%define release 210526
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -189,7 +189,7 @@ $combo_dashboard['text'] .= html_print_select(
true,
false,
true,
'',
'select-dashboard-width',
false,
''
);

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.754-210525
Version: 7.0NG.754-210526
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.754-210525"
pandora_version="7.0NG.754-210526"
package_cpan=0
package_pandora=1

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.754";
my $pandora_build = "210525";
my $pandora_build = "210526";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.754";
my $pandora_build = "210525";
my $pandora_build = "210526";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.754
%define release 210525
%define release 210526
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.754
%define release 210525
%define release 210526
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.754"
PI_BUILD="210525"
PI_BUILD="210526"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.754 Build 210525";
my $version = "7.0NG.754 Build 210526";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.754 Build 210525";
my $version = "7.0NG.754 Build 210526";
# save program name for logging
my $progname = basename($0);