Merge branch 'develop' into ent-12082-error-al-copiar-widget-de-inventario
This commit is contained in:
commit
fd290f814f
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, AIX version
|
||||
# Version 7.0NG.774, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, FreeBSD Version
|
||||
# Version 7.0NG.774, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, HP-UX Version
|
||||
# Version 7.0NG.774, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Version 7.0NG.774, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Version 7.0NG.774, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, Solaris Version
|
||||
# Version 7.0NG.774, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2023 Pandora FMS
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -54,7 +54,6 @@ if (!$@) {
|
|||
|
||||
use constant AGENT_VERSION => '4.0.1';
|
||||
use constant AGENT_BUILD => '111213';
|
||||
|
||||
# Commands to retrieve total memory information in kB
|
||||
use constant TOTALMEMORY_CMDS => {
|
||||
linux => 'cat /proc/meminfo | grep MemTotal: | awk \'{ print $2 }\'',
|
||||
|
@ -117,7 +116,6 @@ my $ConfDir = '';
|
|||
|
||||
# Pandora FMS agent configuration file
|
||||
my $ConfFile = 'pandora_agent.conf';
|
||||
|
||||
# Broker agent configuration files
|
||||
my @BrokerPid;
|
||||
|
||||
|
@ -264,7 +262,6 @@ sub valid_regexp ($) {
|
|||
sub rmrf {
|
||||
my $path = shift;
|
||||
local *DIR;
|
||||
|
||||
if (-d $path) {
|
||||
opendir (DIR, $path) || return;
|
||||
while (defined (my $file_name = readdir(DIR))) {
|
||||
|
@ -348,7 +345,6 @@ sub log_message ($$;$) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Add the given directory to the PATH.
|
||||
################################################################################
|
||||
|
@ -582,7 +578,6 @@ sub write_broker_conf($){
|
|||
}
|
||||
|
||||
while (my $line = <CONF_FILE>){
|
||||
|
||||
# Skip broker definitions
|
||||
if ($line =~ m/^\s*broker_agent/) {
|
||||
next;
|
||||
|
@ -1810,7 +1805,6 @@ sub exec_plugin ($) {
|
|||
$Sem->down () if (defined ($Sem));
|
||||
$Xml .= $output;
|
||||
$Sem->up () if (defined ($Sem));
|
||||
|
||||
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
|
||||
}
|
||||
|
||||
|
@ -2287,4 +2281,4 @@ This is released under the GNU Lesser General Public License.
|
|||
|
||||
Copyright (c) 2005-2023 Pandora FMS
|
||||
|
||||
=cut
|
||||
=cut
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773.3, AIX version
|
||||
# Version 7.0NG.774, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773.3, HPUX Version
|
||||
# Version 7.0NG.774, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773.3, Solaris version
|
||||
# Version 7.0NG.774, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, AIX version
|
||||
# Version 7.0NG.774, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.773.3-231030
|
||||
Version: 7.0NG.774-231106
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -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-231030"
|
||||
pandora_version="7.0NG.774-231106"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.773.3"
|
||||
VERSION="7.0NG.774"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773.3" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.774" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773.3" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.774" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.773.3</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.773.3 Pandora FMS on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.773.3</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.774</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.774 Pandora FMS on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.774</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Version 7.0NG.774, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, FreeBSD Version
|
||||
# Version 7.0NG.774, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, HP-UX Version
|
||||
# Version 7.0NG.774, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2004-2023 Pandora FMS
|
||||
# https://pandorafms.com
|
||||
|
@ -313,6 +313,15 @@ module_plugin autodiscover --default
|
|||
|
||||
#Hardening plugin for security compliance analysis. Enable to use it.
|
||||
#module_begin
|
||||
#module_plugin /usr/share/pandora_agent/plugins/pandora_sca -t 150
|
||||
#module_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150
|
||||
#module_absoluteinterval 7d
|
||||
#module_end
|
||||
|
||||
# Logs extraction
|
||||
#module_begin
|
||||
#module_name Syslog
|
||||
#module_description Logs extraction module
|
||||
#module_type log
|
||||
#module_regexp /var/log/logfile.log
|
||||
#module_pattern .*
|
||||
#module_end
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Version 7.0NG.774, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, NetBSD Version
|
||||
# Version 7.0NG.774, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, Solaris Version
|
||||
# Version 7.0NG.774, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -39,6 +39,14 @@ BEGIN {
|
|||
|
||||
use File::Copy;
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use File::Basename;
|
||||
|
||||
BEGIN {
|
||||
eval {
|
||||
require MIME::Base64;
|
||||
};
|
||||
}
|
||||
|
||||
BEGIN { push @INC, '/usr/lib/perl5'; }
|
||||
|
||||
################################################################################
|
||||
|
@ -1030,8 +1038,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.773.3';
|
||||
use constant AGENT_BUILD => '231030';
|
||||
use constant AGENT_VERSION => '7.0NG.774';
|
||||
use constant AGENT_BUILD => '231106';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -1562,6 +1570,9 @@ sub parse_conf_modules($) {
|
|||
} elsif ($line =~ /^\s*module_occupiedpercentdisk\s+(.*)$/) {
|
||||
$module->{'func'} = \&module_occupiedpercentdisk;
|
||||
$module->{'params'} = $1;
|
||||
}elsif ($line =~ /^\s*module_regexp\s+(.*)$/) {
|
||||
$module->{'func'} = \&module_logger;
|
||||
$module->{'params'} = $1;
|
||||
} elsif ($line =~ /^\s*module_max\s+(.*)\s*$/) {
|
||||
$module->{'max'} = $1;
|
||||
} elsif ($line =~ /^\s*module_min\s+(.*)\s*$/) {
|
||||
|
@ -1817,7 +1828,11 @@ sub parse_conf_modules($) {
|
|||
# Macros
|
||||
} elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) {
|
||||
$module->{'macros'}{$1} = $2;
|
||||
# Regexp
|
||||
}
|
||||
elsif ($line =~ /^\s*module_pattern(\S+)\s+(.*)\s*$/) {
|
||||
$module->{'filter'} = $1;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -3663,6 +3678,11 @@ sub write_module_xml ($@) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($module->{'func'} == \&module_logger) {
|
||||
$Xml .= $data[0];
|
||||
return
|
||||
}
|
||||
|
||||
# Critical section
|
||||
$Sem->down () if (defined ($Sem));
|
||||
|
||||
|
@ -3860,6 +3880,237 @@ sub module_plugin ($) {
|
|||
return ($output);
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Read the logs
|
||||
################################################################################
|
||||
sub module_logger ($) {
|
||||
my $module = shift;
|
||||
|
||||
my $status = grep_logs(
|
||||
$module->{'name'},
|
||||
$module->{'params'},
|
||||
$module->{'filter'}
|
||||
);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub {
|
||||
my ($str, $endl) = @_;
|
||||
|
||||
my @ALPHABET = ('A'..'Z', 'a'..'z', 0..9, '+', '/');
|
||||
my $str_len = length($str);
|
||||
my $str_base64 = '';
|
||||
|
||||
for (my $i = 0; $i < $str_len; $i += 3) {
|
||||
my $chunk = substr($str, $i, 3);
|
||||
my $chunk_len = length($chunk);
|
||||
|
||||
my $num = 0;
|
||||
$num |= ord(substr($chunk, 0, 1)) << 16 if ($chunk_len >= 1);
|
||||
$num |= ord(substr($chunk, 1, 1)) << 8 if ($chunk_len >= 2);
|
||||
$num |= ord(substr($chunk, 2, 1)) if ($chunk_len == 3);
|
||||
|
||||
my $enc_1 = ($num & 0xfc0000) >> 18;
|
||||
my $enc_2 = ($num & 0x03f000) >> 12;
|
||||
my $enc_3 = ($num & 0x000fc0) >> 6;
|
||||
my $enc_4 = ($num & 0x00003f);
|
||||
|
||||
$str_base64 .= $ALPHABET[$enc_1];
|
||||
$str_base64 .= $ALPHABET[$enc_2];
|
||||
$str_base64 .= $chunk_len >= 2 ? $ALPHABET[$enc_3] : '=';
|
||||
$str_base64 .= $chunk_len == 3 ? $ALPHABET[$enc_4] : '=';
|
||||
}
|
||||
|
||||
return $str_base64;
|
||||
};
|
||||
|
||||
sub grep_logs {
|
||||
my ($str_name, $str_file, $str_regex) = @_;
|
||||
|
||||
if(!$str_name){
|
||||
log_message("module_logger", "Missing module name");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$str_file){
|
||||
log_message("module_logger", "Missing file name");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$str_regex){
|
||||
$str_regex = '.*';
|
||||
}
|
||||
|
||||
my $idx_dir = '/tmp/';
|
||||
my $idx_file = '';
|
||||
my $idx_pos = 0;
|
||||
my $idx_size = 0;
|
||||
my $idx_ino = '';
|
||||
my $module_name = $str_name;
|
||||
my $log_file = $str_file;
|
||||
my $reg_exp = $str_regex;
|
||||
|
||||
# Check that log file exists
|
||||
if (! -e $log_file) {
|
||||
log_message("module_logger", "File $log_file does not exist");
|
||||
return;
|
||||
}
|
||||
|
||||
# Create index file storage directory
|
||||
if (! -d $idx_dir) {
|
||||
if (!mkdir($idx_dir)){
|
||||
log_message("module_logger", "Error creating directory $idx_dir: " . $!);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# Create index file if it does not exist
|
||||
$idx_file = $idx_dir.$module_name."_".basename($log_file).".idx";
|
||||
if (! -e $idx_file) {
|
||||
return if create_idx(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$idx_size) == 1;
|
||||
return
|
||||
} else{
|
||||
|
||||
return if load_idx(\$idx_pos, \$idx_ino, \$idx_file, \$idx_size) == 1;
|
||||
my @data = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp, \$idx_size);
|
||||
|
||||
my $output = create_log($module_name, @data);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
# Start the function definition
|
||||
|
||||
sub create_idx {
|
||||
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $idx_size_ref) = @_;
|
||||
my $first_line;
|
||||
|
||||
log_message("module_logger", "Creating index file $$idx_file_ref");
|
||||
|
||||
if (!open(LOGFILE, $$log_file_ref)){
|
||||
log_message("module_logger", "Error opening file $$log_file_ref: ".$!);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Go to EOF and save the position
|
||||
seek(LOGFILE, 0, 2);
|
||||
$$idx_pos_ref = tell(LOGFILE);
|
||||
|
||||
close(LOGFILE);
|
||||
|
||||
# Save the file inode number
|
||||
$$idx_ino_ref = (stat($$log_file_ref))[1];
|
||||
|
||||
return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub save_idx {
|
||||
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_;
|
||||
|
||||
log_message("module_logger", "Saving index file $$idx_file_ref");
|
||||
|
||||
if (!open(IDXFILE, "> $$idx_file_ref")){
|
||||
log_message("module_logger", "Error opening file $$idx_file_ref: ". $!);
|
||||
return 1;
|
||||
}
|
||||
|
||||
print (IDXFILE $$idx_pos_ref . " " . $$idx_ino_ref . " " . $$idx_size_ref);
|
||||
close(IDXFILE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub load_idx {
|
||||
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_;
|
||||
my $line;
|
||||
my $current_ino;
|
||||
my $current_size;
|
||||
|
||||
log_message("module_logger", "Loading index file $$idx_file_ref");
|
||||
|
||||
if (!open(IDXFILE, $$idx_file_ref)){
|
||||
log_message("module_logger", "Error opening file $$idx_file_ref: " .$!);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Read position and date
|
||||
$line = <IDXFILE>;
|
||||
($$idx_pos_ref, $$idx_ino_ref, $$idx_size_ref) = split(' ', $line);
|
||||
|
||||
close(IDXFILE);
|
||||
|
||||
# Reset the file index if the file has changed
|
||||
$current_ino = (stat($$idx_file_ref))[1];
|
||||
$current_size = -s "$$idx_file_ref";
|
||||
if ($current_ino != $$idx_ino_ref || $current_size < $$idx_size_ref) {
|
||||
log_message("module_logger", "File changed, resetting index");
|
||||
|
||||
$$idx_pos_ref = 0;
|
||||
$$idx_ino_ref = $current_ino;
|
||||
}
|
||||
$$idx_size_ref = $current_size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub parse_log {
|
||||
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $module_name_ref, $reg_exp_ref, $idx_size_ref) = @_;
|
||||
|
||||
my $line;
|
||||
|
||||
log_message("module_logger", "Parsing log file $$log_file_ref");
|
||||
|
||||
# Open log file for reading
|
||||
if (!open(LOGFILE, $$log_file_ref)){
|
||||
log_message("module_logger", "Error opening file $$log_file_ref: " . $!);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Go to starting position.
|
||||
seek(LOGFILE, $$idx_pos_ref, 0);
|
||||
|
||||
# Parse log file
|
||||
my @data;
|
||||
while ($line = <LOGFILE>) {
|
||||
if ($line =~ m/$$reg_exp_ref/i) {
|
||||
push (@data, $line);
|
||||
}
|
||||
}
|
||||
|
||||
$$idx_pos_ref = tell(LOGFILE);
|
||||
close(LOGFILE);
|
||||
|
||||
# Save the index file
|
||||
return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1;
|
||||
|
||||
return @data;
|
||||
}
|
||||
|
||||
sub create_log {
|
||||
my ($module_name, @data) = @_;
|
||||
|
||||
# No data
|
||||
if ($#data < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Log module
|
||||
my $output = "<log_module>\n";
|
||||
$output .= "<source><![CDATA[" . $module_name . "]]></source>\n";
|
||||
$output .= "<encoding>base64</encoding>\n";
|
||||
$output .= "<data><![CDATA[";
|
||||
$output .= &$encode_sub(join('', @data), '');
|
||||
$output .= "]]></data>\n";
|
||||
$output .= "</log_module>\n";
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# TERM Handler
|
||||
################################################################################
|
||||
|
@ -4030,6 +4281,8 @@ sub init_module ($) {
|
|||
$module->{'module_ff_interval'} = undef;
|
||||
$module->{'macros'} = {};
|
||||
$module->{'alert_template'} = undef;
|
||||
$module->{'filter'} = undef;
|
||||
$module->{'absoluteinterval'} = undef;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231030
|
||||
%define version 7.0NG.774
|
||||
%define release 231106
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231030
|
||||
%define version 7.0NG.774
|
||||
%define release 231106
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231030
|
||||
%define version 7.0NG.774
|
||||
%define release 231106
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773.3"
|
||||
PI_BUILD="231030"
|
||||
PI_VERSION="7.0NG.774"
|
||||
PI_BUILD="231106"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2023 Pandora FMS
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
@ -526,7 +526,15 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default
|
|||
|
||||
# Hardening plugin for security compliance analysis.
|
||||
#module_begin
|
||||
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_sca.exe -t 150"
|
||||
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_hardening.exe -t 150"
|
||||
#module_absoluteinterval 7d
|
||||
#module_end
|
||||
|
||||
# Logs extraction
|
||||
#module_begin
|
||||
#module_name X_Server_log
|
||||
#module_description Logs extraction module
|
||||
#module_type log
|
||||
#module_regexp C:\server\logs\xserver.log
|
||||
#module_pattern .*
|
||||
#module_end
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.773.3}
|
||||
{Pandora FMS Windows Agent v7.0NG.774}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{231030}
|
||||
{231106}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -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 231030")
|
||||
#define PANDORA_VERSION ("7.0NG.774 Build 231106")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -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 231030))"
|
||||
VALUE "ProductVersion", "(7.0NG.774(Build 231106))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.773.3-231030
|
||||
Version: 7.0NG.774-231106
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -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-231030"
|
||||
pandora_version="7.0NG.774-231106"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -223,6 +223,8 @@ function quickShell()
|
|||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
@ -541,6 +543,9 @@ if (is_ajax() === true) {
|
|||
// Maximum time to establish a connection.
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
|
||||
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
curl_exec($ch);
|
||||
$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
|
|
@ -371,4 +371,81 @@ UPDATE `tevent_alert` ea INNER JOIN `tevent_rule` er ON ea.id = er.id_event_aler
|
|||
ALTER TABLE `tnetwork_explorer_filter`
|
||||
MODIFY COLUMN `id` INT NOT NULL AUTO_INCREMENT;
|
||||
|
||||
-- Add messaging alerts
|
||||
|
||||
SET @command_name = 'Pandora Google chat';
|
||||
SET @action_name = 'Pandora Google chat';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-gchat-cli -u "_field1_" -d "_field2_" -t "_field3_" -D "_field4_"', 'Send messages using Google chat API', 0, '["Google chat webhook URL","Data in coma separate keypairs","Title","Description"]', '["","","",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "data=_data_", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "", "data=_data_", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
|
||||
|
||||
SET @command_name = 'Pandora Slack';
|
||||
SET @action_name = 'Pandora Slack';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-slack-cli -t "TOKEN" -d "_field1_" -c "_field2_" -e "_field3_" -T "_field4_" -D "_field5_"', 'Send messages using Slack API', 0, '["Data in coma separate keypairs","Slack channel id/name","Title emoji","Title","Description"]', '["","",":red_circle:,Red circle;:green_circle:,Green circle","",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "data=_data_", "", ":red_circle:", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", 0, 0, "data=_data_", "", ":green_circle:", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "");
|
||||
|
||||
SET @command_name = 'Pandora Telegram';
|
||||
SET @action_name = 'Pandora Telegram';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-telegram-cli -t "TOKEN" -c "_field1_" -m "_field2_"', 'Send messages using Telegram API', 0, '["Chat ID","Message"]', '["",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "");
|
||||
|
||||
SET @command_name = 'Pandora ilert';
|
||||
SET @action_name = 'Pandora ilert';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora_ilert -a "API_KEY" -t "_field1_" -k "_field2_" -T "_field3_" -d "_field4_" -A "_agentname_" -m "_module_" -p "_alert_text_severity_" -D "_data_" -C "_timestamp_"', 'Send SMS using ilert API: https://docs.ilert.com/integrations/pandorafms/', 0, '["Event type","Event title","Title","Description"]', '["alert,Alert;resolved,Resolved","","",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "alert", "", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "resolved", "", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
|
||||
|
||||
SET @command_name = 'Pandora Vonage';
|
||||
SET @action_name = 'Pandora Vonage';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora_vonage -a "API_KEY" -s "SECRET" -f "FROM_ALIAS" -n "_field1_" -m "_field2_"', 'Send SMS using Vonage API: https://www.vonage.com/communications-apis/sms/', 0, '["Phone number","Message"]', '["",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "");
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -1932,33 +1932,8 @@ if (is_metaconsole() === true) {
|
|||
<td class="bolder"><?php echo __('Source'); ?></td>
|
||||
<td >
|
||||
<?php
|
||||
$agents = agents_get_group_agents($group);
|
||||
if ((empty($agents)) || $agents == -1) {
|
||||
$agents = [];
|
||||
}
|
||||
|
||||
$sql_log = 'SELECT source AS k, source AS v
|
||||
FROM tagente,tagent_module_log
|
||||
WHERE tagente.id_agente = tagent_module_log.id_agent
|
||||
AND tagente.disabled = 0';
|
||||
|
||||
if (!empty($agents)) {
|
||||
$index = 0;
|
||||
foreach ($agents as $key => $a) {
|
||||
if ($index == 0) {
|
||||
$sql_log .= ' AND (id_agente = '.$key;
|
||||
} else {
|
||||
$sql_log .= ' OR id_agente = '.$key;
|
||||
}
|
||||
|
||||
$index++;
|
||||
}
|
||||
|
||||
$sql_log .= ')';
|
||||
}
|
||||
|
||||
html_print_select_from_sql(
|
||||
$sql_log,
|
||||
html_print_select(
|
||||
[],
|
||||
'source',
|
||||
$source,
|
||||
'onselect=source_change_agents();',
|
||||
|
@ -1966,7 +1941,7 @@ if (is_metaconsole() === true) {
|
|||
'',
|
||||
false,
|
||||
false,
|
||||
false
|
||||
false,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
|
@ -6702,68 +6677,41 @@ function loadGeneralAgents(agent_group) {
|
|||
function loadLogAgents() {
|
||||
var params = [];
|
||||
|
||||
params.push("get_log_agents=1");
|
||||
params.push("source=<?php echo $source; ?>");
|
||||
params.push('id_agents=<?php echo json_encode($id_agents); ?>');
|
||||
params.push("page=include/ajax/reporting.ajax");
|
||||
let source = '<?php echo $source; ?>';
|
||||
let agent = '<?php echo json_encode($id_agents); ?>';
|
||||
agent = JSON.parse(agent);
|
||||
|
||||
$('#id_agents3')
|
||||
.find('option')
|
||||
.remove();
|
||||
var params = {};
|
||||
params["get_agent_source"] = 1;
|
||||
params["log_alert"] = 1;
|
||||
params["page"] = "enterprise/include/ajax/log_viewer.ajax";
|
||||
|
||||
$('#id_agents3')
|
||||
.append('<option>Loading agents...</option>');
|
||||
|
||||
jQuery.ajax ({
|
||||
data: params.join ("&"),
|
||||
type: 'POST',
|
||||
url: action=
|
||||
<?php
|
||||
echo '"'.ui_get_full_url(
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
).'"';
|
||||
?>
|
||||
+ "/ajax.php",
|
||||
timeout: 300000,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data['correct']) {
|
||||
$('#id_agents3')
|
||||
.find('option')
|
||||
.remove();
|
||||
|
||||
var selectElements = [];
|
||||
var selectedStr = 'selected="selected"';
|
||||
|
||||
if (data['select_agents'] === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Array.isArray(data['select_agents'])) {
|
||||
data['select_agents'].forEach(function(agentAlias, agentID) {
|
||||
var optionAttr = '';
|
||||
if (typeof data['agents_selected'][agentID] !== 'undefined') {
|
||||
optionAttr = ' selected="selected"';
|
||||
}
|
||||
|
||||
$('#id_agents3')
|
||||
.append('<option value="'+agentID+'" '+optionAttr+'>'+agentAlias+'</option>');
|
||||
});
|
||||
jQuery.ajax({
|
||||
data: params,
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
async: true,
|
||||
success: function(data) {
|
||||
$('#id_agents3')
|
||||
.find('option')
|
||||
.remove();
|
||||
$.each(data['source'],function(key,value) {
|
||||
if (value === source) {
|
||||
$('#source').append( `<option selected='selected' value='${key}'>${value}</option>`);
|
||||
} else {
|
||||
for (const [agentID, agentAlias] of Object.entries(data['select_agents'])) {
|
||||
var optionAttr = '';
|
||||
if (typeof data['agents_selected'][agentID] !== 'undefined') {
|
||||
optionAttr = ' selected="selected"';
|
||||
}
|
||||
|
||||
$('#id_agents3')
|
||||
.append('<option value="'+agentID+'" '+optionAttr+'>'+agentAlias+'</option>');
|
||||
}
|
||||
$('#source').append( `<option value='${key}'>${value}</option>`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.each(data['agent'],function(key,value) {
|
||||
const result = agent.includes(key);
|
||||
if (result === true) {
|
||||
$('#id_agents3').append( `<option selected='selected' value='${key}'>${value}</option>`);
|
||||
} else {
|
||||
$('#id_agents3').append( `<option value='${key}'>${value}</option>`);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -7948,23 +7896,46 @@ function set_last_value_period() {
|
|||
}
|
||||
|
||||
function source_change_agents() {
|
||||
$("#id_agents3").empty();
|
||||
$("#spinner_hack").show();
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_source_json" : 1,
|
||||
"source" : $("#source").val()
|
||||
},
|
||||
function (data, status) {
|
||||
for (var clave in data) {
|
||||
$("#id_agents3").append(
|
||||
'<option value="'+clave+'">'+data[clave]+'</option>'
|
||||
);
|
||||
const source = $("#source").val();
|
||||
if (source === '') {
|
||||
$("#id_agents3 option[value!=0]").attr("style","display:");
|
||||
} else {
|
||||
$("#spinner_hack").show();
|
||||
$("#id_agents3 option").attr("style","display:none");
|
||||
|
||||
var params = {};
|
||||
params["get_agent_source"] = 1;
|
||||
params["page"] = "enterprise/include/ajax/log_viewer.ajax";
|
||||
|
||||
jQuery.ajax({
|
||||
data: params,
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
async: true,
|
||||
success: function(data) {
|
||||
let source_array = [];
|
||||
$.each(data['source'],function(key,value) {
|
||||
if (value === source) {
|
||||
const split = key.split('-');
|
||||
source_array.push(split[1]);
|
||||
}
|
||||
});
|
||||
|
||||
$.each(data['agent'],function(key,value) {
|
||||
const result = source_array.includes(key);
|
||||
if (result === true) {
|
||||
$(`#id_agents3 option[value*='${key}']`).attr("style","display:");
|
||||
}
|
||||
});
|
||||
|
||||
$("#spinner_hack").hide();
|
||||
},
|
||||
error: function(error){
|
||||
$("#spinner_hack").hide();
|
||||
}
|
||||
$("#spinner_hack").hide();
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function dialog_message(message_id) {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
|
||||
<title>Dark / 20 / alert@svg</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Dark-/-20-/-alert" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M10,20 C11.4190985,20 12.5702076,18.8808594 12.5702076,17.5 L7.42979244,17.5 C7.42979244,18.8808594 8.5809015,20 10,20 Z M18.6540098,14.1519531 C17.8777645,13.3410156 16.425318,12.1210937 16.425318,8.125 C16.425318,5.08984375 14.2364028,2.66015625 11.2849029,2.0640625 L11.2849029,1.25 C11.2849029,0.559765625 10.7095493,0 10,0 C9.29045075,0 8.71509711,0.559765625 8.71509711,1.25 L8.71509711,2.0640625 C5.76359722,2.66015625 3.57468198,5.08984375 3.57468198,8.125 C3.57468198,12.1210938 2.12223547,13.3410156 1.3459902,14.1519531 C1.10492023,14.4039062 0.998045886,14.7050781 1.00002702,15 C1.00447442,15.640625 1.52156948,16.25 2.28977909,16.25 L17.7102209,16.25 C18.4784305,16.25 18.9959274,15.640625 18.999973,15 C19.0019541,14.7050781 18.8950798,14.4035156 18.6540098,14.1519531 L18.6540098,14.1519531 Z" id="Shape" fill="#82b92e"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
|
@ -2065,14 +2065,6 @@ if ($table_events) {
|
|||
// (propagate ACL funct!).
|
||||
$groups = users_get_groups($config['id_user']);
|
||||
|
||||
$tags_condition = tags_get_acl_tags(
|
||||
$config['id_user'],
|
||||
array_keys($groups),
|
||||
'ER',
|
||||
'event_condition',
|
||||
'AND'
|
||||
);
|
||||
|
||||
$tableEvents24h = new stdClass();
|
||||
$tableEvents24h->class = 'filter_table';
|
||||
$tableEvents24h->styleTable = 'border: 0;padding: 0;margin: 0 0 10px;';
|
||||
|
@ -2107,7 +2099,7 @@ if ($table_events) {
|
|||
);
|
||||
} else {
|
||||
events_print_event_table(
|
||||
'estado <> 1 '.$tags_condition,
|
||||
'estado <> 1',
|
||||
200,
|
||||
'100%',
|
||||
false,
|
||||
|
|
|
@ -738,7 +738,7 @@ class SnmpConsole extends HTML
|
|||
$sql_count = sprintf($sql_count, $whereSubquery);
|
||||
|
||||
$traps = db_get_all_rows_sql($sql, true);
|
||||
$total = (int) db_get_value_sql($sql_count, false, true);
|
||||
$total = (int) db_get_value_sql($sql_count, false, false);
|
||||
|
||||
if (empty($traps) === false) {
|
||||
$data = $traps;
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC231030';
|
||||
$pandora_version = 'v7.0NG.773.3';
|
||||
$build_version = 'PC231106';
|
||||
$pandora_version = 'v7.0NG.774';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
|
|
@ -2593,7 +2593,7 @@ function events_print_type_img(
|
|||
|
||||
switch ($type) {
|
||||
case 'alert_recovered':
|
||||
$style .= ' alert_module_background_state icon_background_normal ';
|
||||
$icon = 'images/alert_recovered@svg.svg';
|
||||
break;
|
||||
|
||||
case 'alert_manual_validation':
|
||||
|
@ -2609,20 +2609,16 @@ function events_print_type_img(
|
|||
case 'going_up_normal':
|
||||
case 'going_down_normal':
|
||||
// This is to be backwards compatible.
|
||||
// $style .= ' event_module_background_state icon_background_normal';
|
||||
$icon = 'images/module_ok.png';
|
||||
break;
|
||||
|
||||
case 'going_up_warning':
|
||||
$icon = 'images/module_warning.png';
|
||||
// $style .= ' event_module_background_state icon_background_warning';
|
||||
case 'going_down_warning':
|
||||
$icon = 'images/module_warning.png';
|
||||
// $style .= ' event_module_background_state icon_background_warning';
|
||||
break;
|
||||
|
||||
case 'going_unknown':
|
||||
// $style .= ' event_module_background_state icon_background_unknown';
|
||||
$icon = 'images/module_unknown.png';
|
||||
break;
|
||||
|
||||
|
|
|
@ -470,37 +470,6 @@ div.multi-response-buttons {
|
|||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
.main_menu_icon_event {
|
||||
height: 20px;
|
||||
}
|
||||
*/
|
||||
.event_module_background_state {
|
||||
mask: url(../../images/modules@svg.svg) no-repeat center / contain;
|
||||
-webkit-mask: url(../../images/modules@svg.svg) no-repeat center / contain;
|
||||
}
|
||||
|
||||
.alert_module_background_state {
|
||||
mask: url(../../images/alert@svg.svg) no-repeat center / contain;
|
||||
-webkit-mask: url(../../images/alert@svg.svg) no-repeat center / contain;
|
||||
}
|
||||
|
||||
.icon_background_critical {
|
||||
background-color: #e63c52;
|
||||
}
|
||||
|
||||
.icon_background_warning {
|
||||
background-color: #fcab10;
|
||||
}
|
||||
|
||||
.icon_background_normal {
|
||||
background-color: #82b92e;
|
||||
}
|
||||
|
||||
.icon_background_unknown {
|
||||
background-color: gray;
|
||||
}
|
||||
|
||||
.events-refr {
|
||||
width: 300px;
|
||||
display: flex;
|
||||
|
|
|
@ -130,8 +130,8 @@
|
|||
</div>
|
||||
<div style='padding-bottom: 50px'>
|
||||
<?php
|
||||
$version = '7.0NG.773.3';
|
||||
$build = '231030';
|
||||
$version = '7.0NG.774';
|
||||
$build = '231106';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
%define __strip /bin/true
|
||||
%define debug_package %{nil}
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231030
|
||||
%define version 7.0NG.774
|
||||
%define release 231106
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
%define __strip /bin/true
|
||||
%define debug_package %{nil}
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231030
|
||||
%define version 7.0NG.774
|
||||
%define release 231106
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231030
|
||||
%define version 7.0NG.774
|
||||
%define release 231106
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773.3"
|
||||
PI_VERSION="7.0NG.774"
|
||||
FORCE=0
|
||||
DESTDIR=""
|
||||
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.773.3-231030
|
||||
Version: 7.0NG.774-231106
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -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-231030"
|
||||
pandora_version="7.0NG.774-231106"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#############################################################################
|
||||
# Pandora FMS Server Parameters
|
||||
# Pandora FMS, the Flexible Monitoring System.
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -45,8 +45,8 @@ our @EXPORT = qw(
|
|||
);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.773.3";
|
||||
my $pandora_build = "231030";
|
||||
my $pandora_version = "7.0NG.774";
|
||||
my $pandora_build = "231106";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -33,8 +33,8 @@ use base 'Exporter';
|
|||
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 = "231030";
|
||||
my $pandora_version = "7.0NG.774";
|
||||
my $pandora_build = "231106";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
%define __strip /bin/true
|
||||
%define debug_package %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231030
|
||||
%define version 7.0NG.774
|
||||
%define release 231106
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231030
|
||||
%define version 7.0NG.774
|
||||
%define release 231106
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773.3"
|
||||
PI_BUILD="231030"
|
||||
PI_VERSION="7.0NG.774"
|
||||
PI_BUILD="231106"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -38,7 +38,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.773.3 Build 231030";
|
||||
my $version = "7.0NG.774 Build 231106";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.773.3 Build 231030";
|
||||
my $version = "7.0NG.774 Build 231106";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue