Merge remote-tracking branch 'origin/develop' into ent-11471-integracion-pandora-integria

This commit is contained in:
daniel 2023-08-22 09:22:11 +02:00
commit 5a61f074d7
78 changed files with 21744 additions and 198 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS # (c) 2006-2023 Pandora FMS
# Version 7.0NG.773 # Version 7.0NG.773.1
# This program is Free Software, you can redistribute it and/or modify it # 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 # 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 # 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 # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.773, AIX version # Version 7.0NG.773.1, AIX version
# General Parameters # General Parameters
# ================== # ==================

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.773-230821 Version: 7.0NG.773.1-230822
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,9 +26,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
Requires: coreutils unzip Requires: coreutils unzip
Requires: util-linux procps grep Requires: util-linux procps grep
Requires: /sbin/ip /bin/awk Requires: /sbin/ip /bin/awk
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip) #Requires: libnsl
# Required by plugins
#Requires: sh-utils sed passwd net-tools rpm
AutoReq: 0 AutoReq: 0
Provides: %{name}-%{version} Provides: %{name}-%{version}

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS # (c) 2006-2023 Pandora FMS
# Version 7.0NG.773 # Version 7.0NG.773.1
# This program is Free Software, you can redistribute it and/or modify it # 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 # 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 # Foundation; either version 2 of the Licence or any later version

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.773-230821 Version: 7.0NG.773.1-230822
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2904,6 +2904,8 @@ function html_print_anchor(
$output .= '>'; $output .= '>';
$output .= (isset($options['text']) === true) ? $options['text'] : '';
$output .= (isset($options['content']) === true) ? io_safe_input_html($options['content']) : ''; $output .= (isset($options['content']) === true) ? io_safe_input_html($options['content']) : '';
$output .= '</a>'; $output .= '</a>';
@ -7136,6 +7138,7 @@ function html_print_menu_button(array $options, bool $return=false)
'class' => ($options['class'] ?? ''), 'class' => ($options['class'] ?? ''),
'style' => ($options['style'] ?? ''), 'style' => ($options['style'] ?? ''),
'onClick' => ($options['onClick'] ?? ''), 'onClick' => ($options['onClick'] ?? ''),
'text' => ($options['text'] ?? ''),
'content' => $content, 'content' => $content,
], ],
$return $return

View File

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

View File

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

View File

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

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

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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

View File

@ -1535,7 +1535,45 @@ div#head {
input.datos { input.datos {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
#modal_help {
position: absolute;
top: -2px;
right: 32px;
background: white;
display: flex;
min-width: 160px;
flex-direction: column;
filter: drop-shadow(1px 2px 2px #0000005e);
padding: 10px 0px;
}
#modal-help-content {
position: relative;
cursor: pointer;
}
#modal_help a {
margin: 3px 0px;
padding: 0px 15px;
}
#modal_help a:hover {
color: var(--primary-color);
}
#modal_help .separator {
width: 100%;
opacity: 0.4;
}
#modal_help::before {
content: "";
border: 8px solid #0000;
border-bottom: 8px solid white;
left: auto;
right: -16px;
top: 5px;
position: absolute;
transform: rotate(90deg);
}
#modal_help.invisible {
display: none;
}
/* /*
* --------------------------------------------------------------------- * ---------------------------------------------------------------------
* - REPORTS - * - REPORTS -
@ -12320,6 +12358,84 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
width: 100% !important; width: 100% !important;
} }
.notificaion_menu_container {
display: flex;
padding-top: 10px;
padding-left: 15px;
}
.notification_menu {
width: 100px;
}
.filter_notification {
width: auto;
min-width: 50px;
}
#menu-filter_notification * {
list-style: none;
}
#menu-filter_notification li {
line-height: 180%;
}
#menu-filter_notification input[name="filter_menu"] {
position: absolute;
left: -1000em;
}
#menu-filter_notification label[id="filter_menu_label"]:before {
content: "\025b8";
margin-right: 4px;
}
#menu-filter_notification
input[name="filter_menu"]:checked
~ label[id="filter_menu_label"]:before {
content: "\025be";
}
#menu-filter_notification .sublevel-filter_notification {
display: none;
}
#menu-filter_notification input[name="filter_menu"]:checked ~ ul {
display: block;
}
.item-filter > label {
display: inline-block;
width: auto;
vertical-align: middle;
}
.item-filter > input[type="checkbox"] {
display: inline-block;
width: 40px;
height: 100%;
vertical-align: middle;
}
/*Horizontal tree*/
.horizontal_tree-icon {
position: absolute;
background: #f4f4f4;
margin-top: 140px;
margin-left: 15px;
transform: rotate(-90deg);
}
.horizontal_tree-icon-sunburst {
position: absolute;
background: #f4f4f4;
margin-top: 40px;
/*margin-left: 15px;*/
transform: rotate(-90deg);
}
.tree-icon {
position: absolute;
background: #f4f4f4;
margin-top: 140px;
margin-left: 15px;
}
.label_agent_service > label { .label_agent_service > label {
margin-top: 15px; margin-top: 15px;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.773-230821 Version: 7.0NG.773.1-230822
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -733,15 +733,29 @@ sub main() {
my $command = $Config{'plugin_exec'}.' 30 curl --cookie-jar /tmp/cron-session-cookies '.$curl_execution.' 2>/dev/null'; my $command = $Config{'plugin_exec'}.' 30 curl --cookie-jar /tmp/cron-session-cookies '.$curl_execution.' 2>/dev/null';
my $exe_testing_api = `$command`; my $exe_testing_api = `$command`;
my @res_testing_api = split(',', $exe_testing_api); my @res_testing_api = split(',', $exe_testing_api);
my $has_api_access = undef;
if ( $res_testing_api[0] ne 'OK' ) { if ( $res_testing_api[0] ne 'OK' ) {
logger(\%Config, "Warning! The server does not have access to the API, this can trigger problems in the generation of reports and graphs.", 1); logger(\%Config, "Warning! The server does not have access to the API, this can trigger problems in the generation of reports and graphs.", 1);
pandora_event (\%Config, "Server does not have access to the API", 0, 0, 0, 0, 0, 'system', 0, $DBH); pandora_event (\%Config, "The server " . $Config{'servername'} ." cannot access the Pandora FMS API through the supplied credentials. Please check the configuration, some components may fail due to this misconfiguration. Look in the manual for the configuration tokens related to console_api_pass.", 0, 0, 0, 0, 0, 'system', 0, $DBH);
$has_api_access = "0";
} else { } else {
# Test successful. # Test successful.
pandora_set_tconfig_token($DBH, 'internal_user_pass', pandora_set_tconfig_token($DBH, 'internal_user_pass',
pandora_input_password(\%Config, $Config{"console_pass"}) pandora_input_password(\%Config, $Config{"console_pass"})
); );
pandora_set_tconfig_token($DBH, 'internal_user', $Config{"console_user"}); pandora_set_tconfig_token($DBH, 'internal_user', $Config{"console_user"});
$has_api_access = "1";
}
my $token = "has_api_access";
my $prev_access = pandora_get_config_value($DBH, $token);
if(defined($prev_access) && $prev_access ne "") {
db_update ($DBH, 'UPDATE tconfig SET value = ? WHERE token = ?', $has_api_access, $token);
}
else {
db_insert ($DBH, 'id_config', 'INSERT INTO tconfig (token, value) VALUES (?, ?)', $token, $has_api_access);
} }
# Generate 'going up' events # Generate 'going up' events

View File

@ -1,7 +1,7 @@
############################################################################# #############################################################################
# Pandora FMS Server Parameters # Pandora FMS Server Parameters
# Pandora FMS, the Flexible Monitoring System. # Pandora FMS, the Flexible Monitoring System.
# Version 7.0NG.773 # Version 7.0NG.773.1
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2023 Pandora FMS # (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -45,8 +45,8 @@ our @EXPORT = qw(
); );
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.773"; my $pandora_version = "7.0NG.773.1";
my $pandora_build = "230821"; my $pandora_build = "230822";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -2058,6 +2058,8 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist#' 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist#'
); );
$notification->{'subtype'} .= safe_input('NOTIF.DISCOVERYTASK.REVIEW');
$notification->{'mensaje'} = safe_input( $notification->{'mensaje'} = safe_input(
'Discovery task (host&devices) \''.safe_output($self->{'task_data'}{'name'}) 'Discovery task (host&devices) \''.safe_output($self->{'task_data'}{'name'})
.'\' has been completed. Please review the results.' .'\' has been completed. Please review the results.'

View File

@ -33,8 +33,8 @@ use base 'Exporter';
our @ISA = qw(Exporter); our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.773"; my $pandora_version = "7.0NG.773.1";
my $pandora_build = "230821"; my $pandora_build = "230822";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,8 +3,8 @@
# #
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.773 %define version 7.0NG.773.1
%define release 230821 %define release 230822
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -8,8 +8,8 @@
# This code is licensed under GPL 2.0 license. # This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.773" PI_VERSION="7.0NG.773.1"
PI_BUILD="230821" PI_BUILD="230822"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.773 Build 230821"; my $version = "7.0NG.773.1 Build 230822";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;
@ -769,8 +769,8 @@ sub pandora_checkdb_integrity {
# Delete orphan data from visual console. # Delete orphan data from visual console.
log_message ('INTEGRITY', "Deleting orphan visual console items."); log_message ('INTEGRITY', "Deleting orphan visual console items.");
db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agent NOT IN (SELECT id_agente FROM tagente)'); db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agent <> 0 AND id_agent NOT IN (SELECT id_agente FROM tagente)');
db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)'); db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agente_modulo <> 0 AND id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)');
# Delete orphan data form deleted agents. # Delete orphan data form deleted agents.
# Clearl orphan data from dashboards # Clearl orphan data from dashboards

View File

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