Merge branch 'develop' into ent-12101-cambiar-script-de-instalacion-para-apuntar-al-paquete-x64-de-la-consola-open

This commit is contained in:
rafael 2023-10-18 09:57:43 +02:00
commit ecabec8c46
66 changed files with 2562 additions and 220 deletions

View File

@ -1 +1 @@
To create the .deb and .rpm package need to hace docker installed on main system and execit `build_all_docker.sh`
To create the .deb and .rpm package need to hace docker installed on main system and execit `build_all_docker.sh`

View File

@ -300,3 +300,7 @@ module_plugin grep_log /var/log/syslog Syslog ssh
#module_exec echo 5
#module_description Postcondition test module
#module_end
# This plugin runs several security checks in a Linux system
#module_plugin pandora_security_check

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.773.3-231011
Version: 7.0NG.773.3-231018
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231011
%define release 231018
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231011
%define release 231018
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231011
%define release 231018
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.773.3"
PI_BUILD="231011"
PI_BUILD="231018"
OS_NAME=`uname -s`
FORCE=0

View File

@ -0,0 +1,631 @@
#!/usr/bin/perl
################################################################################
# Author: Enrique Martin Garcia
# Copyright: 2023, PandoraFMS
# Maintainer: Operations department
# Version: 1.0
################################################################################
use strict;
use warnings;
use Getopt::Long;
use File::Basename;
use File::Spec;
use Digest::MD5 qw(md5_hex);
use Scalar::Util 'looks_like_number';
use Socket;
# Define signal handlers
sub sigint_handler {
print STDERR "\nInterrupted by user\n";
exit 0;
}
sub sigterm_handler {
print STDERR "Received SIGTERM signal.\n";
exit 0;
}
$SIG{INT} = \&sigint_handler;
$SIG{TERM} = \&sigterm_handler;
# Add lib dir path
my $lib_dir = File::Spec->catdir(dirname($0), 'lib');
unshift @INC, $lib_dir;
###
# GLOBALS
##################
my %options = ();
my $modules_group = 'Security';
my $b_ports = 'PORTS';
my $b_files = 'FILES';
my $b_passwords = 'PASSWORDS';
my @blocks = ($b_ports, $b_files, $b_passwords);
my $configuration_block;
my $integrity_file = '/tmp/' . md5_hex(File::Spec->rel2abs($0)) . '.integrity';
# Enable all checks by default
my $check_selinux = 1;
my $check_ssh_root_access = 1;
my $check_ssh_root_keys = 1;
my $check_ports = 1;
my $check_files = 1;
my $check_passwords = 1;
# Include all values for checks by default
my $include_defaults = 1;
# Initialize check lists
my @l_ports = (
80,
22
);
my @l_files = (
'/etc/shadow',
'/etc/passwd',
'/etc/hosts',
'/etc/resolv.conf',
'/etc/ssh/sshd_config',
'/etc/rsyslog.conf'
);
my @l_passwords = (
'123456',
'12345678',
'123456789',
'12345',
'1234567',
'password',
'1password',
'abc123',
'qwerty',
'111111',
'1234',
'iloveyou',
'sunshine',
'monkey',
'1234567890',
'123123',
'princess',
'baseball',
'dragon',
'football',
'shadow',
'soccer',
'unknown',
'000000',
'myspace1',
'purple',
'fuckyou',
'superman',
'Tigger',
'buster',
'pepper',
'ginger',
'qwerty123',
'qwerty1',
'peanut',
'summer',
'654321',
'michael1',
'cookie',
'LinkedIn',
'whatever',
'mustang',
'qwertyuiop',
'123456a',
'123abc',
'letmein',
'freedom',
'basketball',
'babygirl',
'hello',
'qwe123',
'fuckyou1',
'love',
'family',
'yellow',
'trustno1',
'jesus1',
'chicken',
'diamond',
'scooter',
'booboo',
'welcome',
'smokey',
'cheese',
'computer',
'butterfly',
'696969',
'midnight',
'princess1',
'orange',
'monkey1',
'killer',
'snoopy ',
'qwerty12 ',
'1qaz2wsx ',
'bandit',
'sparky',
'666666',
'football1',
'master',
'asshole',
'batman',
'sunshine1',
'bubbles',
'friends',
'1q2w3e4r',
'chocolate',
'Yankees',
'Tinkerbell',
'iloveyou1',
'abcd1234',
'flower',
'121212',
'passw0rd',
'pokemon',
'StarWars',
'iloveyou2',
'123qwe',
'Pussy',
'angel1'
);
###
# ARGS PARSER
##################
my $HELP = <<EO_HELP;
Run several security checks in a Linux system
Usage: $0
[-h,--help]
[--check_selinux {0,1}]
[--check_ssh_root_access {0,1}]
[--check_ssh_root_keys {0,1}]
[--check_ports {0,1}]
[--check_files {0,1}]
[--check_passwords {0,1}]
[--include_defaults {0,1}]
[--integrity_file <integrity_file>]
[--conf <conf_file>]
Optional arguments:
-h, --help Show this help message and exit
--check_selinux {0,1} Enable/Disable check SElinux module
--check_ssh_root_access {0,1} Enable/Disable check SSH root access module
--check_ssh_root_keys {0,1} Enable/Disable check SSH root keys module
--check_ports {0,1} Enable/Disable check ports module
--check_files {0,1} Enable/Disable check files module
--check_passwords {0,1} Enable/Disable check passwords module
--include_defaults {0,1} Enable/Disable default plugin checks for ports, files and passwords
--integrity_file <integrity_file> Path to integrity check file
Default: $integrity_file
--conf <conf_file> Path to plugin configuration file
Available configuration blocks:
[$b_ports], [$b_files] and [$b_passwords]
Content example:
[$b_ports]
3306
443
[$b_files]
/etc/httpd/httpd.conf
/etc/my.cnf
[$b_passwords]
pandora
PANDORA
P4nd0r4
EO_HELP
sub help {
my ($extra_message) = @_;
print $HELP;
print $extra_message if defined($extra_message);
exit 0;
}
sub parse_bool_arg {
my ($arg, $default) = @_;
if (defined $options{$arg}) {
if (looks_like_number($options{$arg}) && ($options{$arg} == 1 || $options{$arg} == 0)) {
return $options{$arg};
} else {
help("Invalid value for argument: $arg\n");
}
} else {
return $default;
}
}
# Parse arguments
GetOptions(
"help|h" => \$options{help},
"check_selinux=s" => \$options{check_selinux},
"check_ssh_root_access=s" => \$options{check_ssh_root_access},
"check_ssh_root_keys=s" => \$options{check_ssh_root_keys},
"check_ports=s" => \$options{check_ports},
"check_files=s" => \$options{check_files},
"check_passwords=s" => \$options{check_passwords},
"include_defaults=s" => \$options{include_defaults},
"integrity_file=s" => \$options{integrity_file},
"conf=s" => \$options{conf}
);
help() if ($options{help});
$check_selinux = parse_bool_arg('check_selinux', $check_selinux);
$check_ssh_root_access = parse_bool_arg('check_ssh_root_access', $check_ssh_root_access);
$check_ssh_root_keys = parse_bool_arg('check_ssh_root_keys', $check_ssh_root_keys);
$check_ports = parse_bool_arg('check_ports', $check_ports);
$check_files = parse_bool_arg('check_files', $check_files);
$check_passwords = parse_bool_arg('check_passwords', $check_passwords);
$include_defaults = parse_bool_arg('include_defaults', $include_defaults);
if (!$include_defaults) {
@l_ports = ();
@l_files = ();
@l_passwords = ();
}
$integrity_file = $options{integrity_file} if defined $options{integrity_file};
parse_configuration($options{conf}) if defined $options{conf};
###
# FUNCTIONS
##################
# Function to parse configuration file
sub parse_configuration {
my ($conf_file) = @_;
open my $conf_fh, '<', $conf_file or die "Error opening configuration file [$conf_file]: $!\n";
while (my $line = <$conf_fh>) {
chomp $line;
$line =~ s/^\s+//;
$line =~ s/\s+$//;
if ($line =~ /^\[($b_ports|$b_files|$b_passwords)\]$/) {
$configuration_block = $1;
}
elsif ($configuration_block) {
if ($configuration_block eq $b_ports) {
push @l_ports, $line;
}
elsif ($configuration_block eq $b_files) {
push @l_files, $line;
}
elsif ($configuration_block eq $b_passwords) {
push @l_passwords, $line;
}
}
}
close $conf_fh;
}
# Function to print module XML to STDOUT
sub print_xml_module {
my ($m_name, $m_type, $m_desc, $m_value) = @_;
print "<module>\n";
print "\t<name><![CDATA[$m_name]]></name>\n";
print "\t<type>$m_type</type>\n";
print "\t<data><![CDATA[$m_value]]></data>\n";
print "\t<description><![CDATA[$m_desc]]></description>\n";
print "\t<module_group>$modules_group</module_group>\n";
print "</module>\n";
}
# Make unique array
sub uniq {
my %seen;
return grep { !$seen{$_}++ } @_;
}
###
# MAIN
##################
# Check SELinux status
if ($check_selinux) {
my $value = 0;
my $desc = 'SELinux is disabled.';
my $output = `sestatus 2> /dev/null`;
if ($? == 0) {
if ($output =~ /SELinux status: enabled/) {
$value = 1;
$desc = 'SELinux is enabled.';
}
} else {
$value = 0;
$desc = 'Can not determine if SELinux is enabled.';
}
print_xml_module('SELinux status', 'generic_proc', $desc, $value);
}
# Check if SSH allows root access
if ($check_ssh_root_access) {
my $value = 1;
my $desc = 'SSH does not allow root access.';
my $ssh_config_file = '/etc/ssh/sshd_config';
if (-e $ssh_config_file && open my $ssh_fh, '<', $ssh_config_file) {
while (my $line = <$ssh_fh>) {
chomp $line;
$line =~ s/^\s+//;
$line =~ s/\s+$//;
next if $line =~ /^$/ or $line =~ /^#/;
my ($option, $val) = split /\s+/, $line, 2;
if ($option eq 'PermitRootLogin' && lc($val) ne 'no') {
$value = 0;
$desc = 'SSH config allows root access.';
last;
}
}
close $ssh_fh;
} else {
$value = 0;
$desc = 'Can not read '.$ssh_config_file.' to check if root access allowed.';
}
print_xml_module('SSH root access status', 'generic_proc', $desc, $value);
}
# Specific function for recursive directory check
sub find_files {
my ($dir) = @_;
my @files = ();
opendir my $dh, $dir or return;
while (my $file = readdir $dh) {
next if $file eq '.' or $file eq '..';
my $file_path = File::Spec->catfile($dir, $file);
if (-f $file_path) {
push @files, $file_path;
} elsif (-d $file_path) {
push @files, find_files($file_path);
}
}
closedir $dh;
return @files;
}
# Check if /root has SSH keys
if ($check_ssh_root_keys) {
my $value = 1;
my $desc = 'SSH root keys not found.';
my $ssh_keys = {'private' => [], 'public' => []};
my $ssh_dir = '/root/.ssh';
my @all_files = find_files($ssh_dir);
foreach my $file (@all_files) {
if (open my $fh, '<:raw', $file) {
my $content = '';
while(my $l = <$fh>) {
$content .= $l;
}
if ($content) {
my ($filename, $directories) = fileparse($file);
if ($content =~ /-----BEGIN RSA PRIVATE KEY-----.*?-----END RSA PRIVATE KEY-----/s) {
push @{$ssh_keys->{'private'}}, $file;
} elsif ($content =~ /ssh-rsa/ && $filename ne 'known_hosts' && $filename ne 'authorized_keys') {
push @{$ssh_keys->{'public'}}, $file;
}
}
}
}
if (@{$ssh_keys->{'private'}} > 0 || @{$ssh_keys->{'public'}} > 0) {
$value = 0;
$desc = "SSH root keys found:\n" . join("\n", @{$ssh_keys->{'private'}}, @{$ssh_keys->{'public'}});
}
print_xml_module('SSH root keys status', 'generic_proc', $desc, $value);
}
# Check authorized ports
if ($check_ports) {
my $value = 1;
my $desc = 'No unauthorized ports found.';
my @open_ports;
my @not_allowed_ports;
my @net_tcp_files = ('/proc/net/tcp', '/proc/net/tcp6');
foreach my $net_tcp_file (@net_tcp_files) {
if (-e $net_tcp_file && open my $tcp_fh, '<', $net_tcp_file) {
while (my $line = <$tcp_fh>) {
chomp $line;
my @parts = split /\s+/, $line;
if (scalar @parts >= 12) {
my $local_addr_hex = (split /:/, $parts[2])[0];
my $local_port_hex = (split /:/, $parts[2])[1];
my $state = $parts[4];
# Check if the connection is in state 0A (listening)
if ($state eq "0A") {
my $local_addr_4 = join('.', reverse split(/\./, inet_ntoa(pack("N", hex($local_addr_hex)))));
my $local_addr_6 = join(':', map { hex($_) } unpack("(A4)*", $local_addr_hex));
# Skip localhost listening ports
if ($local_addr_4 eq "127.0.0.1" || $local_addr_6 eq "0:0:0:0:0:0:0:1") {
next;
}
my $local_port = hex($local_port_hex);
push @open_ports, $local_port;
}
}
}
close $tcp_fh;
}
}
@open_ports = uniq(@open_ports);
my %allowed_ports;
foreach my $port (@l_ports) {
$allowed_ports{$port} = 1;
}
foreach my $port (@open_ports) {
if (!exists $allowed_ports{$port}) {
push @not_allowed_ports, $port;
}
}
if (@not_allowed_ports) {
$value = 0;
$desc = "Unauthorized ports found:\n" . join("\n", @not_allowed_ports);
}
print_xml_module('Authorized ports status', 'generic_proc', $desc, $value);
}
# Check files integrity
if ($check_files) {
my $value = 1;
my $desc = 'No changed files found.';
my %integrity;
my $can_check_files = 0;
if (-e $integrity_file) {
if (-r $integrity_file && -w $integrity_file) {
# Read integrity file content
open my $integrity_fh, '<', $integrity_file;
while (my $line = <$integrity_fh>) {
chomp $line;
if ($line =~ /^\s*(.*?)=(.*?)\s*$/) {
$integrity{$1} = $2;
}
}
close $integrity_fh;
$can_check_files = 1;
} else {
$value = 0;
$desc = 'Integrity check file can not be read or written: ' . $integrity_file;
}
} else {
if (open my $integrity_fh, '>', $integrity_file) {
close $integrity_fh;
$can_check_files = 1;
} else {
$value = 0;
$desc = 'Integrity check file can not be created: ' . $integrity_file;
}
}
if ($can_check_files) {
# Check each file integrity
my @errored_files;
my @no_integrity_files;
# Create unique check files list
@l_files = uniq(@l_files);
foreach my $file (@l_files) {
my $file_key = md5_hex($file);
if (open my $fh, '<:raw', $file) {
my $md5 = Digest::MD5->new;
$md5->addfile($fh);
my $file_md5 = $md5->hexdigest;
chomp $file_md5;
close $fh;
if (exists $integrity{$file_key} && $integrity{$file_key} ne $file_md5) {
push @no_integrity_files, $file;
}
$integrity{$file_key} = $file_md5;
} else {
push @errored_files, $file;
}
}
# Overwrite integrity file content
open my $file_handle, '>', $integrity_file;
print $file_handle map { "$_=$integrity{$_}\n" } keys %integrity;
close $file_handle;
# Check module status
if (@no_integrity_files) {
$value = 0;
$desc = "Changed files found:\n" . join("\n", @no_integrity_files);
}
if (@errored_files) {
$value = 0;
$desc .= "\nUnable to check integrity of some files:\n" . join("\n", @errored_files);
}
}
print_xml_module('Files check status', 'generic_proc', $desc, $value);
}
# Check weak passwords
if ($check_passwords) {
my $value = 1;
my $desc = 'No insecure passwords found.';
# Create unique check passwords list
@l_passwords = uniq(@l_passwords);
my @insecure_users;
my $shadow_file = '/etc/shadow';
if (-e $shadow_file && -r $shadow_file) {
open my $shadow_fh, '<', $shadow_file;
while (my $line = <$shadow_fh>) {
chomp $line;
my ($username, $password_hash, @rest) = split /:/, $line;
# Skip users with no password hash
if ($password_hash ne "*" && $password_hash ne "!!" && $password_hash ne "!locked") {
my $salt = substr($password_hash, 0, rindex($password_hash, '$') + 1);
my $user_hash = crypt($username, $salt);
if ($user_hash eq $password_hash) {
push @insecure_users, $username;
} else {
foreach my $weak_password (@l_passwords) {
my $weak_password_hash = crypt($weak_password, $salt);
if ($weak_password_hash eq $password_hash) {
push @insecure_users, $username;
last;
}
}
}
}
}
close $shadow_fh;
} else {
$value = 0;
$desc = 'Can not read '.$shadow_file.' to check passwords.';
}
if (@insecure_users) {
$value = 0;
$desc = "Users with insecure passwords found:\n" . join("\n", @insecure_users);
}
print_xml_module('Insecure passwords status', 'generic_proc', $desc, $value);
}

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{231011}
{231018}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.773.3 Build 231011")
#define PANDORA_VERSION ("7.0NG.773.3 Build 231018")
string pandora_path;
string pandora_dir;

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.773.3-231011
Version: 7.0NG.773.3-231018
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -192,7 +192,7 @@ function quickShell()
'name' => 'form-sent',
'value' => true,
],
]
],
],
],
false,
@ -292,7 +292,6 @@ function quickShellSettings()
ui_require_css_file('discovery');
// Gotty settings. Internal communication (WS).
if (isset($config['gotty_ssh_enabled']) === false) {
config_update_value('gotty_ssh_enabled', 1);
}

View File

@ -218,5 +218,5 @@ ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT
ALTER TABLE `treport_content` ADD COLUMN `status_of_check` TINYTEXT;
ALTER TABLE `tservice` ADD COLUMN `enable_horizontal_tree` TINYINT NOT NULL DEFAULT 0;
INSERT INTO tmodule_group (name) SELECT ('Security') WHERE NOT EXISTS (SELECT name FROM tmodule_group WHERE LOWER(name) = 'security');
COMMIT;

View File

@ -1668,6 +1668,12 @@ ui_require_jquery_file('json');
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
// Set close on select for module group.
$("#id_module_group").select2({
closeOnSelect: true
});
var disabledBecauseInPolicy = <?php echo '\''.((empty($disabledBecauseInPolicy) === true) ? '0' : '1').'\''; ?>;
var idModuleType = '<?php echo $type_names_hash[$id_module_type]; ?>';
if (idModuleType != '') {

View File

@ -1284,7 +1284,7 @@ $class = 'databox filters';
?>
</td>
<td>
<?php
<?php
html_print_input_text(
'text_os_version',
$text_os_version,
@ -6625,7 +6625,7 @@ function addGeneralRow() {
function loadGeneralAgents(agent_group) {
var params = [];
var group = <?php echo $group ?? -1; ?>;
var group = <?php echo ($group ?? -1); ?>;
if (group < 0) {
return;
}

View File

@ -290,6 +290,7 @@ html_print_action_buttons(
echo '</form>';
function get_list_os_icons_dir()
{
global $config;

View File

@ -98,7 +98,10 @@ try {
'ajax_url' => 'include/ajax/os',
'ajax_data' => ['method' => 'drawOSTable'],
'ajax_postprocess' => 'process_datatables_item(item)',
'no_sortable_columns' => [-1, 1],
'no_sortable_columns' => [
-1,
1,
],
'order' => [
'field' => 'id',
'direction' => 'asc',

View File

@ -53,7 +53,7 @@ if ($idOS > 0) {
} else {
$product = io_safe_input(strip_tags(io_safe_output((string) get_parameter('product'))));
$version = io_safe_input(strip_tags(io_safe_output((string) get_parameter('version'))));
$end_of_life_date = get_parameter('end_of_life_date', date("Y/m/d"));
$end_of_life_date = get_parameter('end_of_life_date', date('Y/m/d'));
}
$message = '';

View File

@ -220,7 +220,7 @@ switch ($tab) {
break;
default:
// Default.
// Default.
break;
}
@ -282,4 +282,4 @@ if (empty($id_message) === false) {
}
}
include_once $config['homedir'].'/godmode/setup/os_version.list.php';
require_once $config['homedir'].'/godmode/setup/os_version.list.php';

View File

@ -1268,7 +1268,7 @@ class DiscoveryTaskList extends HTML
$status = db_get_value('status', 'trecon_task', 'id_rt', $id_task);
if ($status < 0) {
$status = 100;
$status = '100';
}
echo json_encode($status);
@ -1287,7 +1287,6 @@ class DiscoveryTaskList extends HTML
$result = '<div class="flex">';
$result .= '<div class="subtitle">';
$result .= '<span>'._('Overall Progress').'</span>';
$result .= '<div class="mrgn_top_25px">';
$result .= progress_circular_bar(
$task['id_rt'],
@ -1973,7 +1972,6 @@ class DiscoveryTaskList extends HTML
{
$status = '';
$can_be_reviewed = false;
if (empty($task['summary']) === false
&& $task['summary'] == 'cancelled'
) {
@ -1991,11 +1989,9 @@ class DiscoveryTaskList extends HTML
$status = __('Done');
}
} else if ($task['utimestamp'] == 0
&& empty($task['summary'])
&& (bool) empty($task['summary']) === true
) {
$status = __('Not started');
} else if ($task['utimestamp'] > 0) {
$status = __('Done');
} else {
$status = __('Pending');
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

View File

@ -65,6 +65,7 @@ if (check_login()) {
}
}
if ($get_custom_fields_data) {
$name_custom_fields = get_parameter('name_custom_fields', 0);
$array_custom_fields_data = get_custom_fields_data($name_custom_fields);
@ -110,30 +111,51 @@ if (check_login()) {
// Table temporary for save array in table
// by order and search custom_field data.
$table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields (
id_server int(10),
id_agent int(10),
name_custom_fields varchar(2048),
critical_count int,
warning_count int,
unknown_count int,
notinit_count int,
normal_count int,
total_count int,
`status` int(2),
KEY `data_index_temp_1` (`id_server`, `id_agent`)
)';
db_process_sql($table_temporary);
if (is_metaconsole() === true) {
$table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields (
id_server int(10),
id_agent int(10),
name_custom_fields varchar(2048),
critical_count int,
warning_count int,
unknown_count int,
notinit_count int,
normal_count int,
total_count int,
`status` int(2),
KEY `data_index_temp_1` (`id_server`, `id_agent`)
)';
} else {
$table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields (
id_agent int(10),
name_custom_fields varchar(2048),
critical_count int,
warning_count int,
unknown_count int,
notinit_count int,
normal_count int,
total_count int,
`status` int(2),
KEY `data_index_temp_1` ( `id_agent`)
)';
}
$resul_tab_temp = db_process_sql($table_temporary);
// Insert values array in table temporary.
$values_insert = [];
foreach ($indexed_descriptions as $key => $value) {
$values_insert[] = '('.$value['id_server'].', '.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')';
if (is_metaconsole() === true) {
$values_insert[] = '('.$value['id_server'].', '.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')';
} else {
$values_insert[] = '('.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')';
}
}
$values_insert_implode = implode(',', $values_insert);
$query_insert = 'INSERT INTO temp_custom_fields VALUES '.$values_insert_implode;
db_process_sql($query_insert);
$result_temp = db_process_sql($query_insert);
// Search table for alias, custom field data, server_name, direction.
$search_query = '';
@ -199,41 +221,17 @@ if (check_login()) {
}
// Query all fields result.
$query = sprintf(
'SELECT
tma.id_agente,
tma.id_tagente,
tma.id_tmetaconsole_setup,
tma.alias,
tma.direccion,
tma.server_name,
temp.name_custom_fields,
temp.status
FROM tmetaconsole_agent tma
INNER JOIN temp_custom_fields temp
ON temp.id_agent = tma.id_tagente
AND temp.id_server = tma.id_tmetaconsole_setup
WHERE tma.disabled = 0
%s
%s
%s
%s
LIMIT %d OFFSET %d
',
$search_query,
$status_agent_search,
$status_module_search,
$order_by,
$length,
$start
);
$result = db_get_all_rows_sql($query);
// Query count.
$query_count = sprintf(
'SELECT
COUNT(tma.id_agente) AS `count`
if (is_metaconsole() === true) {
$query = sprintf(
'SELECT
tma.id_agente,
tma.id_tagente,
tma.id_tmetaconsole_setup,
tma.alias,
tma.direccion,
tma.server_name,
temp.name_custom_fields,
temp.status
FROM tmetaconsole_agent tma
INNER JOIN temp_custom_fields temp
ON temp.id_agent = tma.id_tagente
@ -242,16 +240,87 @@ if (check_login()) {
%s
%s
%s
%s
LIMIT %d OFFSET %d
',
$search_query,
$status_agent_search,
$status_module_search
);
$search_query,
$status_agent_search,
$status_module_search,
$order_by,
$length,
$start
);
} else {
$query = sprintf(
'SELECT
tma.id_agente,
tma.alias,
tma.direccion,
tma.server_name,
temp.name_custom_fields,
temp.status
FROM tagente as tma
INNER JOIN temp_custom_fields temp
ON temp.id_agent = tma.id_agente
WHERE tma.disabled = 0
%s
%s
%s
%s
LIMIT %d OFFSET %d
',
$search_query,
$status_agent_search,
$status_module_search,
$order_by,
$length,
$start
);
}
$result = db_get_all_rows_sql($query);
// Query count.
if (is_metaconsole() === true) {
$query_count = sprintf(
'SELECT
COUNT(tma.id_agente) AS `count`
FROM tmetaconsole_agent tma
INNER JOIN temp_custom_fields temp
ON temp.id_agent = tma.id_tagente
AND temp.id_server = tma.id_tmetaconsole_setup
WHERE tma.disabled = 0
%s
%s
%s
',
$search_query,
$status_agent_search,
$status_module_search
);
} else {
$query_count = sprintf(
'SELECT
COUNT(tma.id_agente) AS `count`
FROM tagente tma
INNER JOIN temp_custom_fields temp
ON temp.id_agent = tma.id_agente
WHERE tma.disabled = 0
%s
%s
%s
',
$search_query,
$status_agent_search,
$status_module_search
);
}
$count = db_get_sql($query_count);
// For link nodes.
$array_nodes = metaconsole_get_connections();
if (is_metaconsole() === true) {
$array_nodes = metaconsole_get_connections();
}
if (isset($array_nodes) && is_array($array_nodes)) {
$hash_array_nodes = [];
foreach ($array_nodes as $key => $server) {
@ -280,19 +349,24 @@ if (check_login()) {
$data = [];
foreach ($result as $values) {
$image_status = agents_get_image_status($values['status']);
// Link nodes.
$agent_link = '<a href="'.$hash_array_nodes[$values['id_tmetaconsole_setup']]['server_url'].'/index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$values['id_tagente'].$hash_array_nodes[$values['id_tmetaconsole_setup']]['hashurl'].'">';
if (is_metaconsole() === true) {
$agent_link = '<a href="'.$hash_array_nodes[$values['id_tmetaconsole_setup']]['server_url'].'/index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$values['id_tagente'].$hash_array_nodes[$values['id_tmetaconsole_setup']]['hashurl'].'">';
$agent_alias = ui_print_truncate_text(
$values['alias'],
'agent_small',
false,
true,
true,
'[&hellip;]',
'font-size:7.5pt;'
);
} else {
$agent_link = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$values['id_agente'].'"/>';
$agent_alias = $values['alias'];
}
$agent_alias = ui_print_truncate_text(
$values['alias'],
'agent_small',
false,
true,
true,
'[&hellip;]',
'font-size:7.5pt;'
);
if (can_user_access_node()) {
$agent = $agent_link.'<b>'.$agent_alias.'</b></a>';
@ -300,6 +374,11 @@ if (check_login()) {
$agent = $agent_alias;
}
if (is_metaconsole() === false) {
$values['id_tagente'] = $values['id_agente'];
$values['id_tmetaconsole_setup'] = 1;
}
$data[] = [
'ref' => $referencia,
'data_custom_field' => ui_bbcode_to_html($values['name_custom_fields']),
@ -405,7 +484,7 @@ if (check_login()) {
$table_modules = new stdClass();
$table_modules->width = '100%';
$table_modules->class = 'databox data';
$table_modules->class = 'databox data custom_field_data';
$table_modules->head = [];
$table_modules->head[0] = __('Module name');
@ -589,7 +668,11 @@ if (check_login()) {
__('Load filter'),
'load_filter',
false,
'class="sub upd"',
[
'icon' => 'search',
'class' => 'sub upd',
'onclick' => 'load_filter()',
],
true
);
@ -608,12 +691,14 @@ if (check_login()) {
),
true
);
$table = new StdClass;
$table->id = 'save_filter_form';
$table->width = '100%';
$table->class = 'databox';
$table->rowspan = [];
$table->style = [];
$table->cellstyle[0][0] = 'display: grid';
$table->cellstyle[0][1] = 'display: grid';
if ($filters['id'] == 'extended_create_filter') {
echo "<div id='msg_error_create'></div>";
@ -624,7 +709,7 @@ if (check_login()) {
'',
15,
255,
true
true,
);
$table->data[1][0] = __('Group');
@ -650,11 +735,16 @@ if (check_login()) {
);
$table->rowspan[0][2] = 2;
$table->data[0][2] = html_print_submit_button(
__('Create filter'),
'create_filter',
false,
'class="sub upd"',
[
'icon' => 'search',
'class' => 'sub upd',
'onclick' => 'create_filter()',
],
true
);
} else {
@ -702,14 +792,23 @@ if (check_login()) {
__('Delete filter'),
'delete_filter',
false,
'class="sub upd"',
[
'icon' => 'delete',
'class' => 'sub upd',
'onclick' => 'delete_filter()',
],
true
);
$table->data[1][2] = html_print_submit_button(
__('Update filter'),
'update_filter',
false,
'class="sub upd"',
[
'icon' => 'update',
'class' => 'sub upd',
'onclick' => 'update_filter()',
],
true
);
}

View File

@ -124,18 +124,22 @@ if (empty($apiPassword) === true
) {
// Allow internal direct node -> metaconsole connection
// or node -> own console connection.
$server_uid = get_parameter(('server_auth'));
$config['__internal_call'] = true;
$config['id_usuario'] = 'admin';
$config['id_usuario'] = $server_uid;
// Compat.
$config['id_user'] = 'admin';
$config['id_user'] = $server_uid;
$correctLogin = true;
$config['is_admin'][$server_uid] = true;
// Bypass credentials if server-auth and api-pass are correct.
} else if (($config['server_unique_identifier'] === get_parameter('server_auth'))
&& ($api_password === $apiPassword)
&& ((bool) isInACL($ipOrigin) === true)
) {
$config['id_usuario'] = 'admin';
$config['id_user'] = 'admin';
$server_uid = get_parameter(('server_auth'));
$config['id_usuario'] = $server_uid;
$config['id_user'] = $server_uid;
$config['is_admin'][$server_uid] = true;
$correctLogin = true;
} else if ((bool) isInACL($ipOrigin) === true) {
// External access.

View File

@ -66,13 +66,34 @@ global $config;
// Care whit this!!! check_login not working if you remove this.
$config['id_user'] = $id_user;
$_SESSION['id_usuario'] = $id_user;
// Checks for server api req.
$bypassLogin = false;
if ($data_decoded['apipass'] !== null
&& ($config['server_unique_identifier'] === $_SESSION['id_usuario'])
) {
$apiPassword = io_output_password(
db_get_value_filter(
'value',
'tconfig',
['token' => 'api_password']
)
);
if ($apiPassword === $data_decoded['apipass']) {
$bypassLogin = true;
}
}
if (!isset($config[$slicebar])) {
$config[$slicebar] = $slicebar_value;
}
// Try to initialize session using existing php session id.
$user = new PandoraFMS\User(['phpsessionid' => $session_id]);
if (check_login(false) === false) {
if (check_login(false) === false && $bypassLogin !== true) {
// Error handler.
?>
<!DOCTYPE html>

View File

@ -1590,6 +1590,8 @@ class NetworkMap
{
global $config;
include_once 'include/functions_os.php';
$return = [];
$count_item_holding_area = 0;
foreach ($nodes as $node) {

View File

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

View File

@ -4336,6 +4336,8 @@ function generator_chart_to_pdf(
'id_user' => $config['id_user'],
'slicebar' => $_SESSION['slicebar'],
'slicebar_value' => $config[$_SESSION['slicebar']],
'apipass' => get_parameter('apipass', null),
];
} else {
$data = [
@ -4345,6 +4347,7 @@ function generator_chart_to_pdf(
'id_user' => $config['id_user'],
'slicebar' => $_SESSION['slicebar'],
'slicebar_value' => $config[$_SESSION['slicebar']],
'apipass' => get_parameter('apipass', null),
];
}

View File

@ -116,6 +116,7 @@ function cron_task_lock()
return cron_lock('cron.lock');
}
/**
* Release CRON.task lock
*
@ -130,6 +131,7 @@ function cron_task_release_lock()
unlink($config['attachment_store'].'/cron.lock');
}
/**
* Calculates target schedule time
*
@ -184,6 +186,7 @@ function cron_get_scheduled_time(
return 0;
}
/**
* Run scheduled task.
*
@ -506,7 +509,7 @@ function cron_task_start_gotty(bool $restart_mode=true)
$startTime = time();
// Workaround to wait until process inputs data in the log.
while (time() - $startTime < $maxWaitTime) {
while ((time() - $startTime) < $maxWaitTime) {
if ($start_proc === true) {
// Read command output.
$log_content = file_get_contents($logFilePath);

View File

@ -613,8 +613,198 @@ function agent_counters_custom_fields($filters)
$final_result['indexed_descriptions'] = $data;
} else {
// TODO.
$final_result = false;
$result_meta = [];
$data = [];
$query = sprintf(
"SELECT tcd.description AS name_data,
SUM(IF($agent_state_total, 1, 0)) AS a_agents,
SUM(IF($agent_state_critical, 1, 0)) AS a_critical,
SUM(IF($agent_state_warning, 1, 0)) AS a_warning,
SUM(IF($agent_state_unknown, 1, 0)) AS a_unknown,
SUM(IF($agent_state_normal, 1, 0)) AS a_normal,
SUM(IF($agent_state_notinit, 1, 0)) AS a_not_init,
SUM(tagent_counters.mm_normal) AS m_normal,
SUM(tagent_counters.mm_critical) AS m_critical,
SUM(tagent_counters.mm_warning) AS m_warning,
SUM(tagent_counters.mm_unknown) AS m_unknown,
SUM(tagent_counters.mm_not_init) AS m_not_init,
SUM(tagent_counters.mm_total) AS m_total
FROM tagent_custom_data tcd
INNER JOIN tagent_custom_fields tcf
ON tcd.id_field = tcf.id_field
INNER JOIN (
SELECT ta.id_agente,
ta.total_count AS c_m_total,
SUM( IF(tae.estado = 0, 1, 0) ) AS mm_normal,
SUM( IF(tae.estado = 1, 1, 0) ) AS mm_critical,
SUM( IF(tae.estado = 2, 1, 0) ) AS mm_warning,
SUM( IF(tae.estado = 3, 1, 0) ) AS mm_unknown,
SUM( IF(tae.estado = 4 OR tae.estado = 5, 1, 0) ) AS mm_not_init,
COUNT(tam.id_agente_modulo) AS mm_total
FROM tagente ta
LEFT JOIN tagent_secondary_group tasg
ON ta.id_agente = tasg.id_agent
INNER JOIN tagente_modulo tam
ON ta.id_agente = tam.id_agente
INNER JOIN tagente_estado tae
ON tam.id_agente = tae.id_agente
AND tam.id_agente_modulo = tae.id_agente_modulo
WHERE ta.disabled = 0
AND tam.disabled = 0
%s
%s
%s
%s
GROUP by ta.id_agente
%s
) AS tagent_counters
ON tcd.id_agent = tagent_counters.id_agente
INNER JOIN tagente ta
ON ta.id_agente = tagent_counters.id_agente
WHERE tcf.name = '%s'
AND tcd.description <> ''
%s
GROUP BY tcd.description",
$groups_and,
$and_status,
$and_module_search,
$and_module_status,
$empty_agents_count,
$custom_field_name,
$custom_data_and
);
$result_meta[] = db_get_all_rows_sql($query);
$query_data = sprintf(
"SELECT
tcd.description,
ta.id_agente,
%d AS id_server,
(CASE
WHEN ta.critical_count > 0
THEN 1
WHEN ta.critical_count = 0
AND ta.warning_count > 0
THEN 2
WHEN ta.critical_count = 0
AND ta.warning_count = 0
AND ta.unknown_count > 0
THEN 3
WHEN ta.critical_count = 0
AND ta.warning_count = 0
AND ta.unknown_count = 0
AND ta.notinit_count <> ta.total_count
THEN 0
WHEN ta.total_count = ta.notinit_count
THEN 5
ELSE 0
END) AS `status`,
ta.critical_count,
ta.warning_count,
ta.unknown_count,
ta.notinit_count,
ta.normal_count,
ta.total_count
FROM tagente ta
LEFT JOIN tagent_secondary_group tasg
ON ta.id_agente = tasg.id_agent
INNER JOIN tagente_modulo tam
ON ta.id_agente = tam.id_agente
INNER JOIN tagente_estado tae
ON tam.id_agente = tae.id_agente
AND tam.id_agente_modulo = tae.id_agente_modulo
INNER JOIN tagent_custom_data tcd
ON tcd.id_agent = ta.id_agente
INNER JOIN tagent_custom_fields tcf
ON tcd.id_field = tcf.id_field
WHERE ta.disabled = 0
AND tcf.name = '%s'
AND tcd.description <> ''
AND tam.disabled = 0
%s
%s
%s
%s
%s
GROUP BY ta.id_agente
",
$server_data['id'],
$custom_field_name,
$custom_data_and,
$groups_and,
$and_status,
$and_module_search,
$and_module_status
);
$node_result = db_get_all_rows_sql($query_data);
;
if (empty($node_result)) {
$node_result = [];
}
$data = array_merge($data, $node_result);
$final_result = [];
$array_data = [];
if (isset($result_meta) && is_array($result_meta)) {
// Initialize counters.
$final_result['counters_total'] = [
't_m_normal' => 0,
't_m_critical' => 0,
't_m_warning' => 0,
't_m_unknown' => 0,
't_m_not_init' => 0,
't_m_alerts' => 0,
't_m_total' => 0,
't_a_critical' => 0,
't_a_warning' => 0,
't_a_unknown' => 0,
't_a_normal' => 0,
't_a_not_init' => 0,
't_a_agents' => 0,
];
foreach ($result_meta as $k => $nodo) {
if (isset($nodo) && is_array($nodo)) {
foreach ($nodo as $key => $value) {
// Sum counters total.
$final_result['counters_total']['t_m_normal'] += $value['m_normal'];
$final_result['counters_total']['t_m_critical'] += $value['m_critical'];
$final_result['counters_total']['t_m_warning'] += $value['m_warning'];
$final_result['counters_total']['t_m_unknown'] += $value['m_unknown'];
$final_result['counters_total']['t_m_not_init'] += $value['m_not_init'];
$final_result['counters_total']['t_m_alerts'] += $value['m_alerts'];
$final_result['counters_total']['t_m_total'] += $value['m_total'];
$final_result['counters_total']['t_a_critical'] += $value['a_critical'];
$final_result['counters_total']['t_a_warning'] += $value['a_warning'];
$final_result['counters_total']['t_a_unknown'] += $value['a_unknown'];
$final_result['counters_total']['t_a_normal'] += $value['a_normal'];
$final_result['counters_total']['t_a_not_init'] += $value['a_not_init'];
$final_result['counters_total']['t_a_agents'] += $value['a_agents'];
// Sum counters for data.
$array_data[$value['name_data']]['m_normal'] += $value['m_normal'];
$array_data[$value['name_data']]['m_critical'] += $value['m_critical'];
$array_data[$value['name_data']]['m_warning'] += $value['m_warning'];
$array_data[$value['name_data']]['m_unknown'] += $value['m_unknown'];
$array_data[$value['name_data']]['m_not_init'] += $value['m_not_init'];
$array_data[$value['name_data']]['m_alerts'] += $value['m_alerts'];
$array_data[$value['name_data']]['m_total'] += $value['m_total'];
$array_data[$value['name_data']]['a_critical'] += $value['a_critical'];
$array_data[$value['name_data']]['a_warning'] += $value['a_warning'];
$array_data[$value['name_data']]['a_unknown'] += $value['a_unknown'];
$array_data[$value['name_data']]['a_normal'] += $value['a_normal'];
$array_data[$value['name_data']]['a_not_init'] += $value['a_not_init'];
$array_data[$value['name_data']]['a_agents'] += $value['a_agents'];
}
}
}
$final_result['counters_name'] = $array_data;
}
$final_result['indexed_descriptions'] = $data;
}
return $final_result;

View File

@ -4466,7 +4466,7 @@ function networkmap_get_new_nodes_and_links($networkmap, $x, $y)
'id_child' => $child_node,
'id_parent_source_data' => $parent,
'id_child_source_data' => $node['source_data'],
'parent_type' => 0,
'parent_type' => 2,
'child_type' => 0,
]
);

View File

@ -3612,10 +3612,20 @@ function ui_progress(
page: "'.$ajax['page'].'"
},
success: function(data) {
let data_text = data;
if (data.includes("script")) {
const data_array = data_text.split("/script>");
data = data_array[1];
}
try {
val = JSON.parse(data);
$("#'.$id.'").attr("data-label", val + " %");
$("#'.$id.'_progress").width(val+"%");';
$("#'.$id.'_progress").width(val+"%");
let parent_id = $("#'.$id.'").parent().parent().attr("id");
if (val == 100) {
$("#"+parent_id+"-5").html("'.__('Finish').'");
}';
if (isset($ajax['oncomplete'])) {
$output .= '
if (val == 100) {

View File

@ -1,5 +1,10 @@
/* global $, interval */
$(document).ready(() => {
// Set close on select.
$("#_credentials_").select2({
closeOnSelect: true
});
if (interval === "0") {
setTimeout(() => {
$("#mode_interval")

View File

@ -2520,80 +2520,10 @@ function refresh_holding_area() {
function refresh() {
$("#spinner_networkmap").css("display", "flex");
var holding_pos_x = d3_nm.select("#holding_area_" + networkmap_id).attr("x");
var holding_pos_y = d3_nm.select("#holding_area_" + networkmap_id).attr("y");
var pos_x = parseInt(holding_pos_x) + parseInt(node_radius);
var pos_y = parseInt(holding_pos_y) + parseInt(node_radius);
var params = [];
params.push("refresh_holding_area=1");
params.push("id=" + networkmap_id);
params.push("x=" + pos_x);
params.push("y=" + pos_y);
params.push("page=operation/agentes/pandora_networkmap.view");
$.ajax({
data: {
page: "operation/agentes/pandora_networkmap.view",
refresh_holding_area: 1,
id: networkmap_id,
x: pos_x,
y: pos_y
},
dataType: "json",
type: "POST",
url: window.base_url_homedir + "/ajax.php",
success: function(data) {
if (data["correct"]) {
const array_nodes = data["holding_area"]["nodes"];
let array_links = data["holding_area"]["links"];
jQuery.each(graph.links, function(j, g_link) {
for (var i = 0; i < array_links.length; i++) {
if (g_link["id_db"] == array_links[i]["id_db"]) {
array_links.splice(i, 1);
}
}
});
let location = "";
if ($("#main").height()) {
location = `index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap=${networkmap_id}`;
} else {
location = `index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&pure=1&id_networkmap=${networkmap_id}`;
}
if (array_nodes.length === 0 && array_links.length === 0) {
update_networkmap();
$("#spinner_networkmap").css("display", "none");
window.location = location;
} else {
if (array_nodes.length > 0) {
$.ajax({
data: {
page: "operation/agentes/pandora_networkmap.view",
refresh_map: 1,
id: networkmap_id
},
dataType: "json",
type: "POST",
url: window.base_url_homedir + "/ajax.php",
success: function(data) {
$("#spinner_networkmap").css("display", "none");
window.location = location;
}
});
} else if (array_links.length > 0) {
$("#spinner_networkmap").css("display", "none");
window.location = location;
}
}
}
},
error: function(e) {
$("#spinner_networkmap").css("display", "none");
window.location = location;
}
});
refresh_holding_area();
update_networkmap();
$("#spinner_networkmap").css("display", "none");
window.location = location;
}
function startCountDown(duration) {

View File

@ -1822,10 +1822,7 @@ table.dataTable td {
.dataTables_wrapper .dataTables_length {
float: left;
}
.dataTables_wrapper .dataTables_filter {
float: right;
text-align: right;
}
.dataTables_wrapper .dataTables_filter input {
margin-left: 0.5em;
}
@ -1875,8 +1872,8 @@ table.dataTable td {
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
cursor: default;
color: #666 !important;
border: 1px solid transparent;
color: #fff !important;
border: 1px solid #fff !important;
background: transparent;
box-shadow: none;
}

View File

@ -520,7 +520,6 @@ ul li {
font-size: 14px;
font-weight: normal;
letter-spacing: -0.3px;
height: 18px;
}
.menu_icon_collapsed {
background-position: 50% 50%;

View File

@ -6781,7 +6781,7 @@ form#modal_form_feedback ul.wizard li > textarea {
/* Generic classes to reuse and facilitate the creation of custom themes */
.pandora_green_text {
color: #1d7873;
color: #82b92e;
}
.pandora_green_bg {
@ -10323,7 +10323,7 @@ select:focus {
}
.dataTables_length > label {
font-size: 0px;
color: #fff;
}
input[type="button"],
@ -12436,6 +12436,43 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
width: 350px !important;
}
form.cfv_status_agent {
margin: 0 auto;
display: flex;
justify-content: space-around;
}
form.cfv_status_agent label {
display: block;
line-height: 35px;
height: 40px;
width: 19%;
-webkit-font-smoothing: antialiased;
margin-top: 10px;
color: #ffffff;
text-align: center;
cursor: pointer;
opacity: 0.3;
font-size: 13pt;
}
form.cfv_status_agent label img {
vertical-align: middle;
margin-right: 8px;
}
form.cfv_status_agent input[type="checkbox"] {
display: none;
}
form.cfv_status_agent input:checked + label {
opacity: 1;
}
form.cfv_status_agent input:checked + label:before {
content: "✓ ";
}
.notificaion_menu_container {
display: flex;
padding-top: 10px;
@ -12489,6 +12526,37 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
vertical-align: middle;
}
/* --- Custom fields view --- */
.custom_fields_view_layout {
margin-top: 15px;
}
.custom_fields_view {
width: 30%;
float: left;
margin-left: 10px;
padding-right: 10px;
max-height: 890px;
overflow: auto;
background-color: #f9f9f9;
}
.agents_custom_fields {
width: 100%;
margin-bottom: 15px;
padding: 25px 5px;
}
div.agents_custom_fields #datatables_wrapper div.top,
div.agents_custom_fields #datatables_wrapper div.bottom {
background-color: #414141;
color: #ffffff;
border: none;
padding: 5px;
height: 38px;
width: 99%;
}
/*Horizontal tree*/
.horizontal_tree-icon {
@ -12518,6 +12586,36 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
margin-top: 15px;
}
.custom_fields_view {
width: 30%;
float: left;
margin-left: 10px;
padding-right: 10px;
max-height: 890px;
overflow: auto;
background-color: #f9f9f9;
}
.agents_custom_fields {
width: 100%;
margin-bottom: 15px;
padding: 25px 5px;
}
div.agents_custom_fields #datatables_wrapper div.top,
div.agents_custom_fields #datatables_wrapper div.bottom {
background-color: #414141;
color: #ffffff;
border: none;
padding: 5px;
height: 38px;
width: 99%;
}
.label_agent_service > label {
margin-top: 15px;
}
.animation-blink {
-webkit-animation: glowing 1500ms infinite;
-moz-animation: glowing 1500ms infinite;
@ -12632,6 +12730,38 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
justify-content: flex-start !important;
}
.dt-buttons {
width: auto;
position: absolute;
margin-left: 90px;
}
.title_tactical {
padding: 10px 0px 10px 0px;
text-align: center;
font-size: 12px;
line-height: 23px;
color: #000;
letter-spacing: 0.3pt;
font-family: "lato-bolder";
font-style: normal;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
font-weight: bold;
}
td.details-control {
background: url("../../images/darrowdown.png") no-repeat center center;
cursor: pointer;
}
tr.shown td.details-control {
background: url("../../images/darrowup.png") no-repeat center center;
}
.custom_field_data > tbody > tr > td:not(:first-child) {
text-align: center;
}
.ui-date-range-in > a {
background-color: #81b92e3b !important;
}

View File

@ -364,13 +364,12 @@ a.pandora_pagination.current:hover {
background-size: 22px;
background-position: 48px center;
background-repeat: no-repeat;
background-color: transparent;
background-color: #fff;
color: var(--primary-color);
font-size: 20px;
height: 38px;
/* height: 32px; */
width: 80px;
margin-left: 10px;
margin-left: 90px;
display: flex;
justify-content: space-between;
@ -893,3 +892,19 @@ td.w75p#rightcolumn {
#pending_alerts_paginate {
margin-bottom: 15px;
}
.dataTables_filter > label {
color: #fff;
}
.dataTables_wrapper .dataTables_filter {
float: left;
text-align: right;
margin-left: 8%;
padding-left: 0px;
margin-top: -5px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
background: #bcbcbc;
}

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.773.3';
$build = '231011';
$build = '231018';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -473,7 +473,7 @@ if ($not_found) {
);
$table->data['source_data_group'][] = html_print_label_input_block(
__('Don\'t show subgroups:'),
__('Don&#39;t show subgroups:'),
html_print_checkbox(
'dont_show_subgroups',
'1',

File diff suppressed because it is too large Load Diff

View File

@ -32,6 +32,7 @@ require_once '../../include/config.php';
require_once '../../include/functions.php';
require_once '../../include/functions_db.php';
require_once '../../include/functions_events.php';
require_once '../../include/functions_ui.php';
require_once '../../include/auth/mysql.php';
require_once $config['homedir'].'/include/class/HTML.class.php';
@ -127,7 +128,7 @@ $output = '<div id="tabs-sound-modal">';
// Content tabs.
$output .= '<div id="tabs-sound-modal-1">';
$output .= '<h3 class="title-discovered-alerts">';
$output .= __('Console configuration');
$output .= __('Console configuration').ui_print_help_tip(__('Warning: Minimizing this window will cause the Acoustic Console to not work as expected'), true);
$output .= '</h3>';
$inputs = [];
@ -334,6 +335,7 @@ $output = '<div id="tabs-sound-modal">';
);
$output .= '</div>';
$output .= '</div>';
$output .= html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]);
echo $output;
?>

View File

@ -205,6 +205,10 @@ if ($access_console_node === true) {
$sub['operation/inventory/inventory']['refr'] = 0;
}
$sub['operation/custom_fields/custom_fields_view']['text'] = __('Custom fields view');
$sub['operation/custom_fields/custom_fields_view']['id'] = 'Custom fields view';
$sub['operation/custom_fields/custom_fields_view']['refr'] = 0;
if ($config['activate_netflow'] || $config['activate_sflow']) {
$sub['network_traffic'] = [
'text' => __('Network'),

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.773.3
%define release 231011
%define release 231018
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -1,9 +1,12 @@
#
# Pandora FMS Console
#
%global _missing_build_ids_terminate_build 0
%define __strip /bin/true
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.773.3
%define release 231011
%define release 231018
# User and Group under which Apache is running
%define httpd_name httpd

View File

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

View File

@ -246,7 +246,8 @@ INSERT INTO `tmodule_group` VALUES
(6,'Performance'),
(7,'Database'),
(8,'Enviromental'),
(9,'Users');
(9,'Users'),
(10,'Security');
UNLOCK TABLES;

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.773.3-231011
Version: 7.0NG.773.3-231018
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -153,6 +153,9 @@ dataserver_smart_queue 1
discoveryserver 1
# discovery_threads. Each thread will scan a different scantask.
discovery_threads 1
# Discovery SAP (PANDORA FMS ENTERPRISE ONLY)
# java /usr/bin/java

View File

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

View File

@ -7689,6 +7689,9 @@ sub safe_mode($$$$$$) {
elsif ($known_status == MODULE_CRITICAL) {
logger($pa_config, "Disabling safe mode for agent " . $agent->{'nombre'}, 10);
db_do($dbh, 'UPDATE tagente_modulo SET disabled=0 WHERE id_agente=? AND id_agente_modulo!=?', $agent->{'id_agente'}, $module->{'id_agente_modulo'});
# Prevent the modules from becoming unknown!
db_do ($dbh, 'UPDATE tagente_estado SET utimestamp = ? WHERE id_agente = ? AND id_agente_modulo!=?', time(), $agent->{'id_agente'}, $module->{'id_agente_modulo'});
}
}

View File

@ -814,14 +814,21 @@ sub get_plugin_id ($$) {
##########################################################################
## Return module group ID given the module group name.
##########################################################################
sub get_module_group_id ($$) {
my ($dbh, $module_group_name) = @_;
sub get_module_group_id ($$;$) {
my ($dbh, $module_group_name, $case_insensitve) = @_;
$case_insensitve = 0 unless defined($case_insensitve);
if (!defined($module_group_name) || $module_group_name eq '') {
return 0;
}
my $rc = get_db_value ($dbh, "SELECT id_mg FROM tmodule_group WHERE name = ?", safe_input($module_group_name));
my $rc;
if($case_insensitve == 0) {
$rc = get_db_value ($dbh, "SELECT id_mg FROM tmodule_group WHERE name = ?", safe_input($module_group_name));
} else {
$rc = get_db_value ($dbh, "SELECT id_mg FROM tmodule_group WHERE LOWER(name) = ?", lc(safe_input($module_group_name)));
}
return defined ($rc) ? $rc : -1;
}

View File

@ -812,7 +812,7 @@ sub process_module_data ($$$$$$$$$$) {
# The group name has to be translated to a group ID
if (defined $module_conf->{'module_group'}) {
my $id_group_module = get_module_group_id ($dbh, $module_conf->{'module_group'});
my $id_group_module = get_module_group_id ($dbh, $module_conf->{'module_group'}, 1);
if ( $id_group_module >= 0) {
$module_conf->{'id_module_group'} = $id_group_module;
}

View File

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

View File

@ -7,7 +7,7 @@
%define debug_package %{nil}
%define name pandorafms_server
%define version 7.0NG.773.3
%define release 231011
%define release 231018
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.773.3
%define release 231011
%define release 231018
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

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

View File

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