This commit is contained in:
José González 2022-06-21 09:32:57 +02:00
commit 346ac640e4
33 changed files with 525 additions and 395 deletions

View File

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

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.762'; use constant AGENT_VERSION => '7.0NG.762';
use constant AGENT_BUILD => '220616'; use constant AGENT_BUILD => '220620';
# 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,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.762 %define version 7.0NG.762
%define release 220616 %define release 220620
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

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

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.762" PI_VERSION="7.0NG.762"
PI_BUILD="220616" PI_BUILD="220620"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

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

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.762(Build 220616))" VALUE "ProductVersion", "(7.0NG.762(Build 220620))"
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.762-220616 Version: 7.0NG.762-220620
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.762-220616" pandora_version="7.0NG.762-220620"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -38,14 +38,14 @@ ALTER TABLE `tbackup` MODIFY COLUMN `id_user` VARCHAR(255) DEFAULT '';
ALTER TABLE `tservice` ADD COLUMN `enable_sunburst` tinyint(1) NOT NULL default 0; ALTER TABLE `tservice` ADD COLUMN `enable_sunburst` tinyint(1) NOT NULL default 0;
ALTER TABLE `tdashboard` MODIFY `name` TEXT NOT NULL DEFAULT ''; ALTER TABLE `tdashboard` MODIFY `name` TEXT NOT NULL DEFAULT '';
ALTER TABLE `tevent_alert` ADD COLUMN `field1_recovery` TEXT AFTER `recovery_notify`; ALTER TABLE `tevent_alert` ADD COLUMN `field1_recovery` text DEFAULT '' AFTER `recovery_notify`;
ALTER TABLE `tevent_alert` ADD COLUMN `field4_recovery` TEXT AFTER `field3_recovery`; ALTER TABLE `tevent_alert` ADD COLUMN `field4_recovery` text DEFAULT '' AFTER `field3_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field5_recovery` TEXT AFTER `field4_recovery`; ALTER TABLE `tevent_alert` ADD COLUMN `field5_recovery` text DEFAULT '' AFTER `field4_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field6_recovery` TEXT AFTER `field5_recovery`; ALTER TABLE `tevent_alert` ADD COLUMN `field6_recovery` text DEFAULT '' AFTER `field5_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field7_recovery` TEXT AFTER `field6_recovery`; ALTER TABLE `tevent_alert` ADD COLUMN `field7_recovery` text DEFAULT '' AFTER `field6_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field8_recovery` TEXT AFTER `field7_recovery`; ALTER TABLE `tevent_alert` ADD COLUMN `field8_recovery` text DEFAULT '' AFTER `field7_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field9_recovery` TEXT AFTER `field8_recovery`; ALTER TABLE `tevent_alert` ADD COLUMN `field9_recovery` text DEFAULT '' AFTER `field8_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field10_recovery` TEXT AFTER `field9_recovery`; ALTER TABLE `tevent_alert` ADD COLUMN `field10_recovery` text DEFAULT '' AFTER `field9_recovery`;
SET @st_oum763 = (SELECT IF( SET @st_oum763 = (SELECT IF(
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tautoconfig' AND table_schema = DATABASE() AND column_name = 'disabled') > 0, (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tautoconfig' AND table_schema = DATABASE() AND column_name = 'disabled') > 0,

View File

@ -178,6 +178,7 @@ switch ($type) {
break; break;
} }
$query_filter = [];
if (empty($query_filter) === false) { if (empty($query_filter) === false) {
$query_filter = json_decode($query_filter, true); $query_filter = json_decode($query_filter, true);
} }

File diff suppressed because it is too large Load Diff

View File

@ -3559,7 +3559,8 @@ class AgentWizard extends HTML
$this->targetPort, $this->targetPort,
$this->server, $this->server,
$this->extraArguments, $this->extraArguments,
(($full_output === false) ? '-Oa -On' : '-Oa') (($full_output === false) ? '-On' : '-Oa'),
''
); );
if ($pure === true) { if ($pure === true) {
@ -3572,7 +3573,12 @@ class AgentWizard extends HTML
if ($full_output === true) { if ($full_output === true) {
$output[] = $key.' = '.$oid_unit; $output[] = $key.' = '.$oid_unit;
} else { } else {
preg_match('/\.\d+$/', $key, $index); $index = [];
$index[] = preg_replace('/^'.$oid.'/', '', $key);
if (empty($index) === true) {
preg_match('/\.\d+$/', $key, $index);
}
$tmp = explode(': ', $oid_unit); $tmp = explode(': ', $oid_unit);
$output[$index[0]] = str_replace('"', '', ($tmp[1] ?? '')); $output[$index[0]] = str_replace('"', '', ($tmp[1] ?? ''));
} }

View File

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

View File

@ -1993,7 +1993,8 @@ function get_snmpwalk(
$snmp_port='', $snmp_port='',
$server_to_exec=0, $server_to_exec=0,
$extra_arguments='', $extra_arguments='',
$format='-Oa' $format='-Oa',
$load_mibs='-m ALL'
) { ) {
global $config; global $config;
@ -2057,15 +2058,15 @@ function get_snmpwalk(
case '3': case '3':
switch ($snmp3_security_level) { switch ($snmp3_security_level) {
case 'authNoPriv': case 'authNoPriv':
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir; $command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break; break;
case 'noAuthNoPriv': case 'noAuthNoPriv':
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir; $command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break; break;
default: default:
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir; $command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break; break;
} }
break; break;
@ -2074,7 +2075,7 @@ function get_snmpwalk(
case '2c': case '2c':
case '1': case '1':
default: default:
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir; $command_str = $snmpwalk_bin.' '.$load_mibs.' '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break; break;
} }

View File

@ -814,6 +814,13 @@ select:-internal-list-box {
.margin-left-2 { .margin-left-2 {
margin-left: 2em; margin-left: 2em;
} }
.margin-right-05 {
margin-right: 0.5em;
}
.margin-left-05 {
margin-left: 0.5em;
}
.no-border { .no-border {
border: none; border: none;
} }

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.762 %define version 7.0NG.762
%define release 220616 %define release 220620
# 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

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.762 %define version 7.0NG.762
%define release 220616 %define release 220620
# 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

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.762 %define version 7.0NG.762
%define release 220616 %define release 220620
%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

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

View File

@ -46,7 +46,7 @@ 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.762"; my $pandora_version = "7.0NG.762";
my $pandora_build = "220616"; my $pandora_build = "220620";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -506,7 +506,7 @@ B<Returns>:
########################################################################## ##########################################################################
sub pandora_evaluate_alert ($$$$$$$;$$$$) { sub pandora_evaluate_alert ($$$$$$$;$$$$) {
my ($pa_config, $agent, $data, $last_status, $alert, $utimestamp, $dbh, my ($pa_config, $agent, $data, $last_status, $alert, $utimestamp, $dbh,
$last_data_value, $correlatedItems, $event, $log) = @_; $last_data_value, $correlated_items, $event, $log) = @_;
if (defined ($agent)) { if (defined ($agent)) {
logger ($pa_config, "Evaluating alert '" . safe_output($alert->{'name'}) . "' for agent '" . safe_output ($agent->{'nombre'}) . "'.", 10); logger ($pa_config, "Evaluating alert '" . safe_output($alert->{'name'}) . "' for agent '" . safe_output ($agent->{'nombre'}) . "'.", 10);
@ -604,13 +604,16 @@ sub pandora_evaluate_alert ($$$$$$$;$$$$) {
# Cease on valid data # Cease on valid data
$status = 3; $status = 3;
# Unlike module alerts, correlated alerts recover when they cease!
$status = 4 if ($alert->{'recovery_notify'} == 1 && !defined($alert->{'id_template_module'}));
# Always reset # Always reset
($alert->{'internal_counter'}, $alert->{'times_fired'}) = (0, 0); ($alert->{'internal_counter'}, $alert->{'times_fired'}) = (0, 0);
} }
# Recover takes precedence over cease # Recover takes precedence over cease
$status = 4 if ($alert->{'recovery_notify'} == 1); $status = 4 if ($alert->{'recovery_notify'} == 1 && defined ($alert->{'id_template_module'}));
} }
elsif ($utimestamp > $limit_utimestamp && $alert->{'internal_counter'} > 0) { elsif ($utimestamp > $limit_utimestamp && $alert->{'internal_counter'} > 0) {
@ -691,7 +694,7 @@ sub pandora_evaluate_alert ($$$$$$$;$$$$) {
$pa_config, $pa_config,
$dbh, $dbh,
$alert, $alert,
$correlatedItems, $correlated_items,
$event, $event,
$log $log
] ]

View File

@ -34,7 +34,7 @@ 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.762"; my $pandora_version = "7.0NG.762";
my $pandora_build = "220616"; my $pandora_build = "220620";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );
@ -609,15 +609,14 @@ sub print_module {
$data->{critical_instructions} = $conf->{critical_instructions} unless (defined($data->{critical_instructions}) || (!defined($conf->{critical_instructions}))); $data->{critical_instructions} = $conf->{critical_instructions} unless (defined($data->{critical_instructions}) || (!defined($conf->{critical_instructions})));
# Translation compatibility # Translation compatibility
$data->{'min_warning'} = $data->{'wmin'} if empty($data->{'min_warning'}); $data->{min_warning} = $data->{'wmin'} if empty($data->{min_warning});
$data->{'max_warning'} = $data->{'wmax'} if empty($data->{'max_warning'}); $data->{max_warning} = $data->{'wmax'} if empty($data->{max_warning});
$data->{'min_critical'} = $data->{'cmin'} if empty($data->{'min_critical'}); $data->{min_critical} = $data->{'cmin'} if empty($data->{min_critical});
$data->{'max_critical'} = $data->{'cmax'} if empty($data->{'max_critical'}); $data->{max_critical} = $data->{'cmax'} if empty($data->{max_critical});
$data->{'warning_inverse'} = $data->{'winv'} if empty($data->{'warning_inverse'}); $data->{warning_inverse} = $data->{'winv'} if empty($data->{warning_inverse});
$data->{'critical_inverse'} = $data->{'cinv'} if empty($data->{'critical_inverse'}); $data->{critical_inverse} = $data->{'cinv'} if empty($data->{critical_inverse});
$data->{'str_warning'} = $data->{'wstr'} if empty($data->{'str_warning'}); $data->{str_warning} = $data->{'wstr'} if empty($data->{str_warning});
$data->{'str_critical'} = $data->{'cstr'} if empty($data->{'str_critical'}); $data->{str_critical} = $data->{'cstr'} if empty($data->{str_critical});
$xml_module .= "<module>\n"; $xml_module .= "<module>\n";
$xml_module .= "\t<name><![CDATA[" . $data->{name} . "]]></name>\n"; $xml_module .= "\t<name><![CDATA[" . $data->{name} . "]]></name>\n";

View File

@ -1628,9 +1628,14 @@ sub database_scan($$$) {
$self->{'summary'}->{'discovered'} += 1; $self->{'summary'}->{'discovered'} += 1;
$self->{'summary'}->{'alive'} += 1; $self->{'summary'}->{'alive'} += 1;
my $name = $type . ' connection';
if (defined $obj->{'prefix_module_name'} && $obj->{'prefix_module_name'} ne '') {
$name = $obj->{'prefix_module_name'} . $type . ' connection';
}
push @modules, push @modules,
{ {
name => $type . ' connection', name => $name,
type => 'generic_proc', type => 'generic_proc',
data => 1, data => 1,
description => $type . ' availability' description => $type . ' availability'
@ -1778,8 +1783,14 @@ sub app_scan($) {
# Update progress # Update progress
$self->call('update_progress', $global_percent + (90 / (scalar @targets))); $self->call('update_progress', $global_percent + (90 / (scalar @targets)));
$self->{'summary'}->{'not_alive'} += 1; $self->{'summary'}->{'not_alive'} += 1;
my $name = $type . ' connection';
if (defined $obj->{'prefix_module_name'} && $obj->{'prefix_module_name'} ne '') {
$name = $obj->{'prefix_module_name'} . $type . ' connection';
}
push @modules, { push @modules, {
name => $type . ' connection', name => $name,
type => 'generic_proc', type => 'generic_proc',
data => 0, data => 0,
description => $type . ' availability' description => $type . ' availability'

View File

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

View File

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

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.762" PI_VERSION="7.0NG.762"
PI_BUILD="220616" PI_BUILD="220620"
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.762 Build 220616"; my $version = "7.0NG.762 Build 220620";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

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.762 Build 220616"; my $version = "7.0NG.762 Build 220620";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);