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-11-07 15:12:38 +01:00
commit bfd3924e42
208 changed files with 15275 additions and 8504 deletions

View File

@ -1,6 +1,6 @@
Source: pandora_gotty
Section: utils
Version: 1.0.0
Version: 1.1.0
Priority: optional
Maintainer: PandoraFMS
Build-Depends: debhelper (>= 12)

View File

@ -1,5 +1,5 @@
%define name pandora_gotty
%define version 1.0
%define version 1.1
%define release 1%{?dist}
Summary: pandora_gptty for Pandora FMS
Name: %{name}

View File

@ -74,7 +74,7 @@ def exec_ssh (user:str, add:str, port:int):
try:
print("> Starting SSH connection...")
ssh_command = f"ssh {user}@{add} -p {port}"
subprocess.run(ssh_command, shell=True)
subprocess.run(ssh_command, shell=True, encoding='utf-8', text=True)
except subprocess.CalledProcessError as e:
raise SystemExit(e)
@ -88,7 +88,7 @@ def exec_telnet (add:str, port:int):
try:
print("> Starting Telnet connection...")
ssh_command = f"telnet -E {add} {port}"
subprocess.run(ssh_command, shell=True)
subprocess.run(ssh_command, shell=True, encoding='utf-8', text=True)
except subprocess.CalledProcessError as e:
raise SystemExit(e)

View File

@ -22,13 +22,16 @@ else
fi
SPEC_FILES="$CODEHOME/pandora_console/pandora_console.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_server/pandora_server.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec \
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec \
$CODEHOME/pandora_console/pandora_console.redhat.spec \
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
$CODEHOME/pandora_server/pandora_server.redhat.spec \
$PANDHOME_ENT/pandora_agents/pandora_agent.spec \
$PANDHOME_ENT/pandora_server/pandora_server_enterprise.redhat.spec \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
# ==================

View File

@ -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

View File

@ -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
# ==================

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
# ==================

View File

@ -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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.773.3-231018
Version: 7.0NG.774-231107
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-231018"
pandora_version="7.0NG.774-231107"
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

@ -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

View 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[

View File

@ -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>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
#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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 => '231018';
use constant AGENT_VERSION => '7.0NG.774';
use constant AGENT_BUILD => '231107';
# 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;
}
################################################################################

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231018
%define version 7.0NG.774
%define release 231107
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -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 231018
%define version 7.0NG.774
%define release 231107
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231018
%define version 7.0NG.774
%define release 231107
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -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="231018"
PI_VERSION="7.0NG.774"
PI_BUILD="231107"
OS_NAME=`uname -s`
FORCE=0

View File

@ -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"
#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

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db207ef67053764be7e9b42cd04ea5509cc2a023548aab1c037745ca277b68a3
size 4858753

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d93bd9d56c938063045fa2093198d324746f84df2b74567648f3baebd635657
size 5248006

View File

@ -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
{231018}
{231107}
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 231018")
#define PANDORA_VERSION ("7.0NG.774 Build 231107")
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 231018))"
VALUE "ProductVersion", "(7.0NG.774(Build 231107))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.773.3-231018
Version: 7.0NG.774-231107
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-231018"
pandora_version="7.0NG.774-231107"
package_pear=0
package_pandora=1

View File

@ -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);

View File

@ -106,6 +106,7 @@ enterprise/godmode/alerts/alert_events.php
enterprise/godmode/alerts/alert_events_list.php
enterprise/godmode/alerts/alert_events_rules.php
enterprise/godmode/alerts/configure_alert_rule.php
enterprise/godmode/alerts/alert_correlation.php
enterprise/include/functions_networkmap.php
enterprise/operation/agentes/pandora_networkmap.view.php
enterprise/include/ajax/map_enterprise.ajax.php
@ -1717,3 +1718,5 @@ operation/incidents/list_integriaims_incidents.php
include/functions_incidents.php
include/functions_integriaims.php
include/ajax/integria_incidents.ajax.php
enterprise/operation/log/log_source.php
enterprise/include/class/LogSource.class.php

View File

@ -1,4 +1,4 @@
pandorafms.vmware=459175dce8ab811e874ce2e7216f0db4
pandorafms.vmware=9959cc3e5cc6bfcfadd6d05b56d4a11b
pandorafms.mysql=fadb4750d18285c0eca34f47c6aa3cfe
pandorafms.mssql=1cc215409741d19080269ffba112810e
pandorafms.oracle=2d9320a514d1e48a0b2804e1653c31c6

View File

@ -5,6 +5,98 @@ ALTER TABLE `ttrap` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0;
UPDATE ttrap SET utimestamp=UNIX_TIMESTAMP(timestamp);
CREATE TABLE IF NOT EXISTS `tlog_alert` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` TEXT ,
`description` MEDIUMTEXT,
`order` INT UNSIGNED DEFAULT 0,
`mode` ENUM('PASS','DROP'),
`field1` TEXT ,
`field2` TEXT ,
`field3` TEXT ,
`field4` TEXT ,
`field5` TEXT ,
`field6` TEXT ,
`field7` TEXT ,
`field8` TEXT ,
`field9` TEXT ,
`field10` TEXT ,
`time_threshold` INT NOT NULL DEFAULT 86400,
`max_alerts` INT UNSIGNED NOT NULL DEFAULT 1,
`min_alerts` INT UNSIGNED NOT NULL DEFAULT 0,
`time_from` time DEFAULT '00:00:00',
`time_to` time DEFAULT '00:00:00',
`monday` TINYINT DEFAULT 1,
`tuesday` TINYINT DEFAULT 1,
`wednesday` TINYINT DEFAULT 1,
`thursday` TINYINT DEFAULT 1,
`friday` TINYINT DEFAULT 1,
`saturday` TINYINT DEFAULT 1,
`sunday` TINYINT DEFAULT 1,
`recovery_notify` TINYINT DEFAULT 0,
`field1_recovery` TEXT,
`field2_recovery` TEXT,
`field3_recovery` TEXT,
`field4_recovery` TEXT,
`field5_recovery` TEXT,
`field6_recovery` TEXT,
`field7_recovery` TEXT,
`field8_recovery` TEXT,
`field9_recovery` TEXT,
`field10_recovery` TEXT,
`id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0,
`internal_counter` INT DEFAULT 0,
`last_fired` BIGINT NOT NULL DEFAULT 0,
`last_reference` BIGINT NOT NULL DEFAULT 0,
`times_fired` INT NOT NULL DEFAULT 0,
`disabled` TINYINT DEFAULT 0,
`standby` TINYINT DEFAULT 0,
`priority` TINYINT DEFAULT 0,
`force_execution` TINYINT DEFAULT 0,
`group_by` enum ('','id_agente','id_agentmodule','id_alert_am','id_grupo') DEFAULT '',
`special_days` TINYINT DEFAULT 0,
`disable_event` TINYINT DEFAULT 0,
`id_template_conditions` INT UNSIGNED NOT NULL DEFAULT 0,
`id_template_fields` INT UNSIGNED NOT NULL DEFAULT 0,
`last_evaluation` BIGINT NOT NULL DEFAULT 0,
`pool_occurrences` INT UNSIGNED NOT NULL DEFAULT 0,
`schedule` TEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tlog_rule` (
`id_log_rule` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_log_alert` INT UNSIGNED NOT NULL,
`operation` ENUM('NOP', 'AND','OR','XOR','NAND','NOR','NXOR'),
`order` INT UNSIGNED DEFAULT 0,
`window` INT NOT NULL DEFAULT 0,
`count` INT NOT NULL DEFAULT 1,
`name` TEXT,
`log_content` TEXT,
`log_source` TEXT,
`log_agent` TEXT,
`operator_log_content` TEXT COMMENT 'Operator for log_content',
`operator_log_source` TEXT COMMENT 'Operator for log_source',
`operator_log_agent` TEXT COMMENT 'Operator for log_agent',
PRIMARY KEY (`id_log_rule`),
KEY `idx_id_log_alert` (`id_log_alert`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tlog_alert_action` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_log_alert` INT UNSIGNED NOT NULL,
`id_alert_action` INT UNSIGNED NOT NULL,
`fires_min` INT UNSIGNED DEFAULT 0,
`fires_max` INT UNSIGNED DEFAULT 0,
`module_action_threshold` INT NOT NULL DEFAULT 0,
`last_execution` BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_log_alert`) REFERENCES tlog_alert(`id`)
ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`id_alert_action`) REFERENCES talert_actions(`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` (
`id` INT NOT NULL auto_increment,
`filter_name` VARCHAR(45) NULL,
@ -68,6 +160,9 @@ UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
ALTER TABLE tagente_modulo ADD COLUMN `made_enabled` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE tpolicy_modules ADD COLUMN `made_enabled` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE talert_templates
ADD COLUMN `time_window` ENUM ('thirty_days','this_month','seven_days','this_week','one_day','today'),
ADD COLUMN `math_function` ENUM ('avg', 'min', 'max', 'sum'),
@ -219,4 +314,138 @@ 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');
SET @tmodule_name = 'CPU';
SET @tmodule_description = 'CPU';
SET @id_os = 2;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'Brand;Clock;Model' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'RAM';
SET @tmodule_description = 'RAM';
SET @id_os = 2;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'Size' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'NIC';
SET @tmodule_description = 'NIC';
SET @id_os = 2;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'NIC;Mac;Speed' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'Software';
SET @tmodule_description = 'Software';
SET @id_os = 2;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'PKGINST;VERSION;NAME' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'Security';
SET @tmodule_description = 'Hardening&#x20;plugin&#x20;for&#x20;security&#x20;compliance&#x20;analysis';
SET @id_os = 1;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'ID:STATUS' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'Security';
SET @tmodule_description = 'Hardening&#x20;plugin&#x20;for&#x20;security&#x20;compliance&#x20;analysis';
SET @id_os = 9;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'ID:STATUS' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
INSERT INTO tmodule_group (name) SELECT ('Security') WHERE NOT EXISTS (SELECT name FROM tmodule_group WHERE LOWER(name) = 'security');
ALTER TABLE tagente_modulo ADD COLUMN `last_compact` TIMESTAMP NOT NULL DEFAULT 0;
UPDATE `tevent_alert` ea INNER JOIN `tevent_rule` er ON ea.id = er.id_event_alert SET disabled=1 WHERE er.log_agent IS NOT NULL OR er.log_content IS NOT NULL OR er.log_source IS NOT NULL;
ALTER TABLE `tnetwork_explorer_filter`
MODIFY COLUMN `id` INT NOT NULL AUTO_INCREMENT;
-- Add messaging alerts
SET @command_name = 'Pandora&#x20;Google&#x20;chat';
SET @action_name = 'Pandora&#x20;Google&#x20;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&#x20;-u&#x20;&quot;_field1_&quot;&#x20;-d&#x20;&quot;_field2_&quot;&#x20;-t&#x20;&quot;_field3_&quot;&#x20;-D&#x20;&quot;_field4_&quot;', 'Send&#x20;messages&#x20;using&#x20;Google&#x20;chat&#x20;API', 0, '["Google&#x20;chat&#x20;webhook&#x20;URL","Data&#x20;in&#x20;coma&#x20;separate&#x20;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&#x20;Slack';
SET @action_name = 'Pandora&#x20;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&#x20;-t&#x20;&quot;TOKEN&quot;&#x20;-d&#x20;&quot;_field1_&quot;&#x20;-c&#x20;&quot;_field2_&quot;&#x20;-e&#x20;&quot;_field3_&quot;&#x20;-T&#x20;&quot;_field4_&quot;&#x20;-D&#x20;&quot;_field5_&quot;', 'Send&#x20;messages&#x20;using&#x20;Slack&#x20;API', 0, '["Data&#x20;in&#x20;coma&#x20;separate&#x20;keypairs","Slack&#x20;channel&#x20;id/name","Title&#x20;emoji","Title","Description"]', '["","",":red_circle:,Red&#x20;circle;:green_circle:,Green&#x20;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&#x20;Telegram';
SET @action_name = 'Pandora&#x20;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&#x20;-t&#x20;&quot;TOKEN&quot;&#x20;-c&#x20;&quot;_field1_&quot;&#x20;-m&#x20;&quot;_field2_&quot;', 'Send&#x20;messages&#x20;using&#x20;Telegram&#x20;API', 0, '["Chat&#x20;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&#x20;ilert';
SET @action_name = 'Pandora&#x20;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&#x20;-a&#x20;&quot;API_KEY&quot;&#x20;-t&#x20;&quot;_field1_&quot;&#x20;-k&#x20;&quot;_field2_&quot;&#x20;-T&#x20;&quot;_field3_&quot;&#x20;-d&#x20;&quot;_field4_&quot;&#x20;-A&#x20;&quot;_agentname_&quot;&#x20;-m&#x20;&quot;_module_&quot;&#x20;-p&#x20;&quot;_alert_text_severity_&quot;&#x20;-D&#x20;&quot;_data_&quot;&#x20;-C&#x20;&quot;_timestamp_&quot;', 'Send&#x20;SMS&#x20;using&#x20;ilert&#x20;API:&#x20;https://docs.ilert.com/integrations/pandorafms/', 0, '["Event&#x20;type","Event&#x20;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&#x20;Vonage';
SET @action_name = 'Pandora&#x20;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&#x20;-a&#x20;&quot;API_KEY&quot;&#x20;-s&#x20;&quot;SECRET&quot;&#x20;-f&#x20;&quot;FROM_ALIAS&quot;&#x20;-n&#x20;&quot;_field1_&quot;&#x20;-m&#x20;&quot;_field2_&quot;', 'Send&#x20;SMS&#x20;using&#x20;Vonage&#x20;API:&#x20;https://www.vonage.com/communications-apis/sms/', 0, '["Phone&#x20;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;

View File

@ -26,14 +26,16 @@
* ============================================================================
*/
use PandoraFMS\TacticalView\GeneralTacticalView;
// Config functions.
require_once 'include/config.php';
require_once 'include/config.php';
// This solves problems in enterprise load.
global $config;
// This solves problems in enterprise load.
global $config;
check_login();
// ACL Check.
check_login();
// ACL Check.
if (check_acl($config['id_user'], 0, 'AR') === 0) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@ -43,322 +45,5 @@ if (check_acl($config['id_user'], 0, 'AR') === 0) {
exit;
}
require_once 'include/functions_reporting.php';
require_once 'include/functions_tactical.php';
require_once $config['homedir'].'/include/functions_graph.php';
if (tags_has_user_acl_tags()) {
ui_print_tags_warning();
}
$all_data = tactical_status_modules_agents(
$config['id_user'],
false,
'AR'
);
$data = [];
$data['monitor_not_init'] = (int) $all_data['_monitors_not_init_'];
$data['monitor_unknown'] = (int) $all_data['_monitors_unknown_'];
$data['monitor_ok'] = (int) $all_data['_monitors_ok_'];
$data['monitor_warning'] = (int) $all_data['_monitors_warning_'];
$data['monitor_critical'] = (int) $all_data['_monitors_critical_'];
$data['monitor_not_normal'] = (int) $all_data['_monitor_not_normal_'];
$data['monitor_alerts'] = (int) $all_data['_monitors_alerts_'];
$data['monitor_alerts_fired'] = (int) $all_data['_monitors_alerts_fired_'];
$data['monitor_total'] = (int) $all_data['_monitor_total_'];
$data['total_agents'] = (int) $all_data['_total_agents_'];
$data['monitor_checks'] = (int) $all_data['_monitor_checks_'];
if (!empty($all_data)) {
if ($data['monitor_not_normal'] > 0 && $data['monitor_checks'] > 0) {
$data['monitor_health'] = format_numeric((100 - ($data['monitor_not_normal'] / ($data['monitor_checks'] / 100))), 1);
} else {
$data['monitor_health'] = 100;
}
if ($data['monitor_not_init'] > 0 && $data['monitor_checks'] > 0) {
$data['module_sanity'] = format_numeric((100 - ($data['monitor_not_init'] / ($data['monitor_checks'] / 100))), 1);
} else {
$data['module_sanity'] = 100;
}
if (isset($data['alerts'])) {
if ($data['monitor_alerts_fired'] > 0 && $data['alerts'] > 0) {
$data['alert_level'] = format_numeric((100 - ($data['monitor_alerts_fired'] / ($data['alerts'] / 100))), 1);
} else {
$data['alert_level'] = 100;
}
} else {
$data['alert_level'] = 100;
$data['alerts'] = 0;
}
$data['monitor_bad'] = ($data['monitor_critical'] + $data['monitor_warning']);
if ($data['monitor_bad'] > 0 && $data['monitor_checks'] > 0) {
$data['global_health'] = format_numeric((100 - ($data['monitor_bad'] / ($data['monitor_checks'] / 100))), 1);
} else {
$data['global_health'] = 100;
}
$data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1);
}
ui_require_css_file('logon');
echo '<div id="welcome_panel">';
//
// Overview Table.
//
$table = new stdClass();
$table->class = 'no-class';
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->head = [];
$table->data = [];
$table->headstyle[0] = 'text-align:center;';
$table->width = '100%';
$table->head_colspan[0] = 4;
// Indicators.
$tdata = [];
$stats = reporting_get_stats_indicators($data, 120, 10, false);
$status = '<table class="status_tactical">';
foreach ($stats as $stat) {
$status .= '<tr><td><b>'.$stat['title'].'</b></td><td>'.$stat['graph'].'</td></tr>';
}
$status .= '</table>';
$table->rowclass = [];
$table->rowclass[0] = 'w100p';
$table->rowclass[1] = 'w100p';
$table->rowclass[2] = 'w100p';
$table->rowclass[3] = 'w100p';
$table->rowclass[4] = 'w100p';
$table->rowclass[5] = 'w100p';
$table->data[0][0] = $status;
$table->data[] = $tdata;
// Alerts.
$tdata = [];
$tdata[0] = reporting_get_stats_alerts($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Modules by status.
$tdata = [];
$data_agents = [
__('Critical') => $data['monitor_critical'],
__('Warning') => $data['monitor_warning'],
__('Normal') => $data['monitor_ok'],
__('Unknown') => $data['monitor_unknown'],
__('Not init') => $data['monitor_not_init'],
];
$tdata[0] = reporting_get_stats_modules_status($data, 180, 100, false, $data_agents);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Total agents and modules.
$tdata = [];
$tdata[0] = reporting_get_stats_agents_monitors($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Users.
if (users_is_admin() || check_acl($config['id_user'], 0, 'UM')) {
$tdata = [];
$tdata[0] = reporting_get_stats_users($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
}
ui_toggle(
html_print_table($table, true),
__('%s Overview', get_product_name()),
'',
'overview',
false
);
unset($table);
echo '<div id="right">';
// News.
require_once 'general/news_dialog.php';
$options = [];
$options['id_user'] = $config['id_user'];
$options['modal'] = false;
$options['limit'] = 3;
$news = get_news($options);
if (!empty($news)) {
ui_require_css_file('news');
// NEWS BOARD.
if ($config['prominent_time'] == 'timestamp') {
$comparation_suffix = '';
} else {
$comparation_suffix = __('ago');
}
$output_news = '<div id="news_board" class="new">';
foreach ($news as $article) {
$default = false;
if ($article['text'] == '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;') {
$article['subject'] = __('Welcome to Pandora FMS Console');
$default = true;
}
$text_bbdd = io_safe_output($article['text']);
$text = html_entity_decode($text_bbdd);
$output_news .= '<div class="new-board">';
$output_news .= '<div class="new-board-header">';
$output_news .= '<span class="new-board-title">'.$article['subject'].'</span>';
$output_news .= '<span class="new-board-author">'.__('By').' '.$article['author'].' '.ui_print_timestamp($article['timestamp'], true).'</span>';
$output_news .= '</div>';
$output_news .= '<div class="new content">';
if ($default) {
$output_news .= '<div class="default-new">';
$output_news .= '<div class="default-image-new">';
$output_news .= '<img src="./images/welcome_image.svg" alt="img colabora con nosotros - Support">';
$output_news .= '</div><div class="default-text-new">';
$output_news .= '
<p>'.__('Welcome to our monitoring tool so grand,').'
<br>'.__('Where data insights are at your command.').'
<br>'.__('Sales, marketing, operations too,').'
<br>'.__("Customer support, we've got you.").'
</p>
<p>'.__('Our interface is user-friendly,').'
<br>'.__("Customize your dashboard, it's easy.").'
<br>'.__('Set up alerts and gain insights so keen,').'
<br>'.__("Optimize your data, like you've never seen.").'
</p>
<p>'.__('Unleash its power now, and join the pro league,').'
<br>'.__('Unlock the potential of your data to intrigue.').'
<br>'.__('Monitoring made simple, efficient and fun,').'
<br>'.__('Discover a whole new way to get things done.').'
</p>
<p>'.__('And take control of your IT once and for all.').'</p>
<span>'.__('You can replace this message with a personalized one at Admin tools -> Site news.').'</span>
';
$output_news .= '</div></div>';
} else {
$text = str_replace('<script', '&lt;script', $text);
$text = str_replace('</script', '&lt;/script', $text);
$output_news .= nl2br($text);
}
$output_news .= '</div></div>';
}
$output_news .= '</div>';
// News board.
ui_toggle(
$output_news,
__('News board'),
'',
'news',
false
);
// END OF NEWS BOARD.
}
// LAST ACTIVITY.
// Show last activity from this user.
$table = new stdClass();
$table->class = 'no-td-padding info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->width = '100%';
// Don't specify px.
$table->data = [];
$table->size = [];
$table->headstyle = [];
$table->size[0] = '5%';
$table->size[1] = '15%';
$table->headstyle[1] = 'min-width: 12em;';
$table->size[2] = '5%';
$table->headstyle[2] = 'min-width: 65px;';
$table->size[3] = '10%';
$table->size[4] = '25%';
$table->head = [];
$table->head[0] = __('User');
$table->head[1] = __('Action');
$table->head[2] = __('Date');
$table->head[3] = __('Source IP');
$table->head[4] = __('Comments');
$table->align[4] = 'left';
$sql = sprintf(
'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
FROM tsesion
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
$config['id_user']
);
$sessions = db_get_all_rows_sql($sql);
if ($sessions === false) {
$sessions = [];
}
foreach ($sessions as $session) {
$data = [];
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
$data[0] = '<strong>'.$session_id_usuario.'</strong>';
$data[1] = ui_print_session_action_icon($session['accion'], true).' '.$session['accion'];
$data[2] = ui_print_help_tip(
date($config['date_format'], $session['utimestamp']),
true
).human_time_comparation($session['utimestamp'], 'tiny');
$data[3] = $session_ip_origen;
$description = io_safe_output(str_replace([',', ', '], ', ', $session['descripcion']));
if (strlen($description) > 100) {
$data[4] = '<div >'.io_safe_input(substr($description, 0, 150)).'...</div>';
} else {
$data[4] = '<div >'.io_safe_input($description).'</div>';
}
array_push($table->data, $data);
}
$activity = html_print_table($table, true);
unset($table);
ui_toggle(
$activity,
__('Latest activity'),
'',
'activity',
false,
false,
'',
'white-box-content padded'
);
// END OF LAST ACTIVIYY.
// Close right panel.
echo '</div>';
// Close welcome panel.
echo '</div>';
$tacticalView = new GeneralTacticalView();
$tacticalView->render();

View File

@ -1326,6 +1326,12 @@ if ($update_module === true || $create_module === true) {
*/
$post_process = (string) get_parameter('post_process', 0.0);
if (modules_made_compatible($id_module_type) === true) {
$made_enabled = (bool) get_parameter_checkbox('made_enabled', 0);
} else {
$made_enabled = false;
}
$prediction_module = (int) get_parameter('prediction_module');
$max_timeout = (int) get_parameter('max_timeout');
$max_retries = (int) get_parameter('max_retries');
@ -1348,6 +1354,14 @@ if ($update_module === true || $create_module === true) {
}
$configuration_data = (string) get_parameter('configuration_data');
$array_configuration_data = explode(PHP_EOL, io_safe_output($configuration_data));
$configuration_data = '';
foreach ($array_configuration_data as $value) {
$configuration_data .= trim($value).PHP_EOL;
}
$configuration_data = io_safe_input($configuration_data);
$old_configuration_data = (string) get_parameter('old_configuration_data');
$new_configuration_data = '';
@ -1488,6 +1502,14 @@ if ($update_module === true || $create_module === true) {
}
$plugin_parameter = (string) get_parameter('plugin_parameter');
$array_plugin_parameter = explode(PHP_EOL, io_safe_output($plugin_parameter));
$plugin_parameter = '';
foreach ($array_plugin_parameter as $value) {
$plugin_parameter .= trim($value).PHP_EOL;
}
$plugin_parameter = io_safe_input($plugin_parameter);
}
$parent_module_id = (int) get_parameter('parent_module_id');
@ -1704,6 +1726,7 @@ if ($update_module) {
'plugin_parameter' => $plugin_parameter,
'id_plugin' => $id_plugin,
'post_process' => $post_process,
'made_enabled' => $made_enabled,
'prediction_module' => $prediction_module,
'max_timeout' => $max_timeout,
'max_retries' => $max_retries,
@ -1902,6 +1925,7 @@ if ($create_module) {
'plugin_parameter' => $plugin_parameter,
'id_plugin' => $id_plugin,
'post_process' => $post_process,
'made_enabled' => $made_enabled,
'prediction_module' => $prediction_module,
'max_timeout' => $max_timeout,
'max_retries' => $max_retries,

View File

@ -294,6 +294,7 @@ if ($id_agent_module) {
$plugin_parameter = $module['plugin_parameter'];
$id_plugin = $module['id_plugin'];
$post_process = $module['post_process'];
$made_enabled = $module['made_enabled'];
$prediction_module = $module['prediction_module'];
$custom_integer_1 = $module['custom_integer_1'];
$custom_integer_2 = $module['custom_integer_2'];
@ -408,6 +409,7 @@ if ($id_agent_module) {
$id_module_group = 1;
$id_module_type = 1;
$post_process = '';
$made_enabled = false;
$max_timeout = 0;
$max_retries = 0;
$min = '';

View File

@ -318,7 +318,7 @@ foreach ($texts as $code => $text) {
return;
}
$(plugin_parameter).val('task_begin\ncookie 0\nresource 0\ntask_end');
$(plugin_parameter).val('task_begin\nget https://demoweb.com/page/\ncheck_string text string or HTML code to search (regexp)\ntask_end\n');
$('#button-btn_loadbasic').attr('disabled', 'disabled');

View File

@ -484,6 +484,7 @@ echo '</form>';
ui_require_javascript_file('pandora_alerts');
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_javascript_file('alert');
?>
<script type="text/javascript">
@ -500,194 +501,6 @@ $(document).ready (function () {
render_command_description(command_description);
}
function ajax_get_integria_custom_fields(ticket_type_id, values, recovery_values) {
var values = values || [];
var recovery_values = recovery_values || [];
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
if (ticket_type_id === null || ticket_type_id === '' || (Array.isArray(values) && values.length === 0 && Array.isArray(recovery_values) && recovery_values.length === 0)) {
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').val('');
$('[name=field'+i+'_recovery_value\\[\\]').val('');
}
}
// On ticket type change, hide all table rows and inputs corresponding to custom fields, regardless of what its type is.
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').hide();
$('[name=field'+i+'_recovery_value\\[\\]').hide();
$('#table_macros-field'+i).hide();
$('[name=field'+i+'_value_container').hide();
$('[name=field'+i+'_recovery_value_container').hide();
}
jQuery.post(
"ajax.php",
{
page: "godmode/alerts/configure_alert_action",
get_integria_ticket_custom_types: 1,
ticket_type_id: ticket_type_id
},
function(data) {
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
data.forEach(function(custom_field, key) {
var custom_field_key = key+8; // Custom fields start from field 8.
if (custom_field_key > max_macro_fields) {
return;
}
// Display field row for current input.
var custom_field_row = $('#table_macros-field'+custom_field_key);
custom_field_row.show();
// Replace label text of field row for current input.
var label_html = $('#table_macros-field'+custom_field_key+' td').first().html();
var label_name = label_html.split('<br>')[0];
var new_html_content = custom_field_row.html().replace(label_name, custom_field.label);
custom_field_row.html(new_html_content);
switch (custom_field.type) {
case 'CHECKBOX':
var checkbox_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]');
var checkbox_recovery_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]');
checkbox_selector.on('change', function() {
if (checkbox_selector.prop('checked')) {
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.attr('value', "0");
}
});
checkbox_recovery_selector.on('change', function() {
if (checkbox_recovery_selector.prop('checked')) {
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.attr('value', "0");
}
});
if (typeof values[key] !== "undefined") {
if (values[key] == 1) {
checkbox_selector.prop('checked', true);
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.prop('checked', false);
checkbox_selector.attr('value', "0");
}
}
if (typeof recovery_values[key] !== "undefined") {
if (recovery_values[key] == 1) {
checkbox_recovery_selector.prop('checked', true);
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.prop('checked', false);
checkbox_recovery_selector.attr('value', "0");
}
}
$('[name=field'+custom_field_key+'_value_container]').show();
$('[name=field'+custom_field_key+'_recovery_value_container]').show();
$('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'COMBO':
var combo_input = $('select[name=field'+custom_field_key+'_value\\[\\]]');
var combo_input_recovery = $('select[name=field'+custom_field_key+'_recovery_value\\[\\]]');
combo_input.find('option').remove();
combo_input_recovery.find('option').remove();
var combo_values_array = custom_field.comboValue.split(',');
combo_values_array.forEach(function(value) {
combo_input.append($('<option>', {
value: value,
text: value
}));
combo_input_recovery.append($('<option>', {
value: value,
text: value
}));
});
if (typeof values[key] !== "undefined") {
combo_input.val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
combo_input_recovery.val(recovery_values[key]);
}
combo_input.show();
combo_input_recovery.show();
break;
case 'DATE':
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
if (typeof values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
break;
case 'NUMERIC':
if (typeof values[key] !== "undefined") {
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'TEXT':
if (typeof values[key] !== "undefined") {
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'TEXTAREA':
default:
if (typeof values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').show();
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
}
});
},
"json"
);
}
$("#id_command").change (function () {
values = Array ();
// No se envia el valor del commando.
@ -914,12 +727,22 @@ $(document).ready (function () {
}
if ($('#field5_value').val() !== '') {
ajax_get_integria_custom_fields($('#field5_value').val(), integria_custom_fields_values, integria_custom_fields_rvalues);
ajax_get_integria_custom_fields(
$('#field5_value').val(),
integria_custom_fields_values,
integria_custom_fields_rvalues,
max_macro_fields
);
$('#field5_value').trigger('change');
}
$('#field5_value').on('change', function() {
ajax_get_integria_custom_fields($(this).val());
ajax_get_integria_custom_fields(
$(this).val(),
[],
[],
max_macro_fields
);
});
}

View File

@ -916,7 +916,24 @@ $table->data[17][0] = html_print_label_input_block(
)
);
$table->data[17][1] = html_print_label_input_block(
$table->data['made_enabled'][1] = html_print_label_input_block(
__('MADE enabled').ui_print_help_tip(
__('By activating this option, the module data will be processed by the MADE engine (if active), and events will be generated automatically by the IA engine'),
true
),
html_print_checkbox_switch(
'made_enabled',
1,
false,
true,
false,
'',
false,
'wp100 static'
)
);
$table->data[17][2] = html_print_label_input_block(
__('SNMP community'),
html_print_input_text(
'snmp_community',
@ -1653,7 +1670,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
var params = {
@ -1728,7 +1746,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").show ();
switch($('#module_type').val()) {
@ -1838,7 +1857,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide ();
$('input[type=checkbox]').attr('checked', false);
$('input[type=checkbox]').attr('disabled', true);
@ -1877,7 +1897,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").show();
}
else {
@ -1908,7 +1929,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
}
}
@ -1932,6 +1954,9 @@ $(document).ready (function () {
else if (this.id == "checkbox-dynamic_two_tailed") {
return; //Do none
}
else if (this.id == "checkbox-made_enabled") {
return; //Do none
}
else {
if (this.id == "checkbox-force_group") {
$("#checkbox-recursion").prop("checked", false);
@ -1964,7 +1989,7 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-40").show ();
}
else {
@ -1995,7 +2020,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
}
}
@ -2085,7 +2111,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
jQuery.post ("ajax.php",
@ -2315,6 +2342,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
'module_interval',
'disabled',
'post_process',
'made_enabled',
'unit_select',
'snmp_community',
'snmp_oid',
@ -2626,6 +2654,10 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
$values['macros'] = json_encode($module_macros);
}
if (modules_made_compatible($module['id_tipo_modulo']) === false) {
$values['made_enabled'] = 0;
}
$result = modules_update_agent_module(
$module['id_agente_modulo'],
$values,

View File

@ -384,6 +384,7 @@ if ($access_console_node === true) {
$sub['godmode/alerts/alert_special_days']['pages'] = ['godmode/alerts/configure_alert_special_days'];
enterprise_hook('eventalerts_submenu');
enterprise_hook('alert_log_submenu');
$sub['godmode/snmpconsole/snmp_alert']['text'] = __('SNMP alerts');
$sub['godmode/snmpconsole/snmp_alert']['id'] = 'SNMP_alerts';
enterprise_hook('alert_inventory_submenu');

View File

@ -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) {

View File

@ -151,6 +151,10 @@ if (isset($_GET['server']) === true) {
$title .= __('Netflow server').' ID: '.$id_server;
break;
case SERVER_TYPE_MADE:
$title .= __('MADE server').' ID: '.$id_server;
break;
default:
$title = __('Update server').' ID: '.$id_server;
break;

View File

@ -2063,7 +2063,7 @@ if ($create_alert || $update_alert) {
}
// DIALOG ADD MORE ACTIONS.
echo '<div id="add_action_snmp-div" class="invisible left">';
echo '<div id="add_action_snmp-div" class="invisible">';
echo '<form id="add_action_form" method="post">';
echo '<table class="w100p">';
@ -2212,6 +2212,7 @@ if ($create_alert || $update_alert) {
ui_require_javascript_file('pandora', 'include/javascript/', true);
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_javascript_file('alert');
?>
<script language="javascript" type="text/javascript">
@ -2287,6 +2288,7 @@ $(document).ready (function () {
name: "content_type",
value: "<?php echo $al_field4; ?>"
})
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
values,
function (data, status) {
@ -2317,6 +2319,26 @@ $(document).ready (function () {
}
$('#table_macros-field').show();
}
if($("#alert_type option:selected").text() === "Create Pandora ITSM ticket") {
// At start hide all rows and inputs corresponding to custom fields, regardless of what its type is.
if (i>=8) {
$('[name=field'+i+'_value\\[\\]').hide();
$('[name=field'+i+'_recovery_value\\[\\]').hide();
$('#table_macros-field'+i).hide();
$('[name=field'+i+'_value_container').hide();
$('[name=field'+i+'_recovery_value_container').hide();
}
if ($('#field5_value').val() !== '') {
ajax_get_integria_custom_fields($('#field5_value').val(), [], [], max_fields);
$('#field5_value').trigger('change');
}
$('#field5_value').on('change', function() {
ajax_get_integria_custom_fields($(this).val(), [], [], max_fields);
});
}
}
},
"json"
@ -2341,7 +2363,8 @@ $(document).ready (function () {
});
function show_add_action_snmp(id_alert_snmp) {
$("#add_action_snmp-div").hide()
$("#add_action_snmp-div")
.hide()
.dialog ({
resizable: true,
draggable: true,

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Anomaly detection@svg</title>
<g id="Anomaly-detection" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Dark-/-20-/-details">
<g id="Group">
<rect id="Rectangle" x="0" y="0" width="20" height="20"></rect>
<line x1="14" y1="14" x2="18" y2="18" id="Path-9" stroke="#3F3F3F" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></line>
<circle id="Oval" stroke="#3F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" cx="8" cy="8" r="7"></circle>
</g>
<path d="M2,11 C2,11 3.33333333,11 6,11 C7.33333333,7 8,5 8,5 C8,5 8.66666667,7 10,11 L14,11" id="Path" stroke="#3F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1013 B

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="27px" height="27px" viewBox="0 0 27 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>59DFD8E8-D019-4076-8FED-D5B81BE90197</title>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v4" transform="translate(-1185, -1810)" fill="#95A3BF">
<g id="Log-storage" transform="translate(1102, 1739)">
<g id="Card-1/8" transform="translate(15, 71)">
<g id="Groups" transform="translate(68, 0)">
<rect id="Rectangle" x="0" y="0" width="5.4" height="5.4" rx="0.5"></rect>
<rect id="Rectangle-Copy-2" x="0" y="21.6" width="5.4" height="5.4" rx="0.5"></rect>
<rect id="Rectangle-Copy" x="21.6" y="0" width="5.4" height="5.4" rx="0.5"></rect>
<rect id="Rectangle-Copy-3" x="21.6" y="21.6" width="5.4" height="5.4" rx="0.5"></rect>
<path d="M24.3,2.7 L24.3,24.3 L2.7,24.3 L2.7,2.7 L24.3,2.7 Z M19.06875,10.8 L17.55,10.8 L17.55,16.36875 C17.55,17.0211364 17.0211364,17.55 16.36875,17.55 L10.8,17.549 L10.8,19.06875 C10.8,19.7211364 11.3288636,20.25 11.98125,20.25 L19.06875,20.25 C19.7211364,20.25 20.25,19.7211364 20.25,19.06875 L20.25,11.98125 C20.25,11.3288636 19.7211364,10.8 19.06875,10.8 Z M15.01875,6.75 L7.93125,6.75 C7.27886364,6.75 6.75,7.27886364 6.75,7.93125 L6.75,15.01875 C6.75,15.6711364 7.27886364,16.2 7.93125,16.2 L15.01875,16.2 C15.6711364,16.2 16.2,15.6711364 16.2,15.01875 L16.2,7.93125 C16.2,7.27886364 15.6711364,6.75 15.01875,6.75 Z" id="Rectangle-2"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="27px" height="27px" viewBox="0 0 27 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>04A64774-B33A-4338-8092-D83F51BBE8C1</title>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v4" transform="translate(-1218, -1942)" fill="#95A3BF">
<g id="Log-storage" transform="translate(1102, 1739)">
<g id="Card-1/8" transform="translate(49, 203)">
<g id="Module-template" transform="translate(67, 0)">
<path d="M1,0 L26,0 C26.5522847,-1.01453063e-16 27,0.44771525 27,1 L27,8.45 C27,9.00228475 26.5522847,9.45 26,9.45 L1,9.45 C0.44771525,9.45 6.76353751e-17,9.00228475 0,8.45 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 Z M11.8,10.8 L26,10.8 C26.5522847,10.8 27,11.2477153 27,11.8 L27,26 C27,26.5522847 26.5522847,27 26,27 L11.8,27 C11.2477153,27 10.8,26.5522847 10.8,26 L10.8,11.8 C10.8,11.2477153 11.2477153,10.8 11.8,10.8 Z" id="Rectangle-2"></path>
<path d="M8.45,10.8 C9.00228475,10.8 9.45,11.2477153 9.45,11.8 L9.45,26 C9.45,26.5522847 9.00228475,27 8.45,27 L1,27 C0.44771525,27 0,26.5522847 0,26 L0,11.8 C0,11.2477153 0.44771525,10.8 1,10.8 L8.45,10.8 Z M7.45,12.8 L2,12.8 L2,25 L7.45,25 L7.45,12.8 Z" id="Rectangle" fill-rule="nonzero"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="27px" height="27px" viewBox="0 0 27 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>CD5F043F-0CA1-4012-8590-20C64D7E7E0D</title>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v4" transform="translate(-1378, -1810)" fill="#95A3BF">
<g id="Log-storage" transform="translate(1102, 1739)">
<g id="Card-1/8" transform="translate(208, 71)">
<g id="Modules" transform="translate(68, 0)">
<path d="M25.3705078,4.29521484 L14.6865234,0.218847656 C14.3015625,0.0729316406 13.9007813,0 13.5,0 C13.0992187,0 12.6984375,0.0729316406 12.3134766,0.218583984 L1.62896484,4.29521484 C0.648105469,4.66962891 0,5.6109375 0,6.66035156 L0,20.3396484 C0,21.3895898 0.648105469,22.3303711 1.62896484,22.7047852 L12.3129492,26.7811523 C12.6984375,26.9261719 13.0992188,27 13.5,27 C13.9007813,27 14.3031445,26.9270684 14.6849414,26.781416 L25.3689258,22.7050488 C26.3513672,22.3330078 27,21.3890625 27,20.3396484 L27,6.66035156 C27,5.6109375 26.3513672,4.66962891 25.3705078,4.29521484 Z M13.0008122,3 L22,6.5303428 L13.0008122,10 L4,6.5314563 L13.0008122,3 Z M15,23 L15,13.1237485 L23,10 L23,19.8137765 L15,23 Z"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="27px" height="27px" viewBox="0 0 27 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>E1DA8ECF-DB7D-48B5-96B0-3C6199FCC8EB</title>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v4" transform="translate(-1476, -1942)" fill="#95A3BF">
<g id="Log-storage" transform="translate(1102, 1739)">
<g id="Card-1/8" transform="translate(306, 203)">
<g id="Not-init-module" transform="translate(68, 0)">
<path d="M1.51937106,7.28411239 C4.95205428,0.667087472 13.0993581,-1.91380755 19.7156094,1.51964932 C20.0173327,1.67592653 20.3097722,1.84226119 20.5937016,2.017106 L18.0128066,3.66652692 L18.009712,3.66575327 L12.8138814,6.98548365 L12.710986,2.70797508 C11.8669343,2.76986705 11.0344873,2.93078616 10.2322127,3.18531688 C7.59329397,4.02163208 5.27234521,5.86523905 3.8960226,8.51730983 C2.52047363,11.1693806 2.34872342,14.1285903 3.18503863,16.767509 C3.79544815,18.6923492 4.94122319,20.4477601 6.54499878,21.7908158 L4.20161418,23.2878278 C-0.0495902992,19.2532452 -1.31528102,12.7468521 1.51937106,7.28411239 Z M22.8349645,3.74853378 C27.0567703,7.78621097 28.3062144,14.2693945 25.4800724,19.7158876 C22.0473892,26.3329125 13.9008591,28.9138076 7.28383414,25.4803507 C6.99990474,25.3333573 6.72371184,25.17708 6.45448178,25.0122927 L6.50167441,24.9821203 L6.47769127,24.980573 L14.2312074,20.0261211 L14.2025824,24.2982141 C15.0760328,24.240964 15.9378784,24.077724 16.7672308,23.8146831 C19.4069232,22.9783679 21.7270983,21.134761 23.1034209,18.4826902 C24.4797435,15.8306194 24.6507201,12.8714097 23.8144049,10.232491 C23.2101845,8.32389744 22.0783352,6.58241222 20.4954481,5.24399843 Z M19.2403271,12.073777 C19.4297542,12.073777 19.5833153,12.227338 19.5833153,12.4167651 L19.5833153,14.5824612 C19.5833153,14.7718883 19.4297542,14.9254494 19.2403271,14.9254494 L7.75834273,14.9254494 C7.5689156,14.9254494 7.41535457,14.7718883 7.41535457,14.5824612 L7.41535457,12.4167651 C7.41535457,12.227338 7.5689156,12.073777 7.75834273,12.073777 L19.2403271,12.073777 Z"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="27px" height="27px" viewBox="0 0 27 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>E2220716-B06D-4CCD-8005-3668217A51C4</title>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v4" transform="translate(-1764, -1810)" fill="#95A3BF">
<g id="Log-storage" transform="translate(1102, 1739)">
<g id="Card-1/8" transform="translate(594, 71)">
<g id="Plugins" transform="translate(68, 0)">
<path d="M27,18.9 L27,24.3 C27,25.7911688 25.7911688,27 24.3,27 L18.9,27 L18.9,24.3 C18.9,22.8088312 17.6911688,21.6 16.2,21.6 C14.7088312,21.6 13.5,22.8088312 13.5,24.3 L13.5,27 L8.1,27 C6.60883118,27 5.4,25.7911688 5.4,24.3 L5.4,18.9 L2.7,18.9 C1.20883118,18.9 0,17.6911688 0,16.2 C0,14.7088312 1.20883118,13.5 2.7,13.5 L5.4,13.5 L5.4,8.1 C5.4,6.615 6.615,5.4 8.1,5.4 L13.5,5.4 L13.5,2.7 C13.5,1.20883118 14.7088312,0 16.2,0 C17.6911688,0 18.9,1.20883118 18.9,2.7 L18.9,5.4 L24.3,5.4 C25.7911688,5.4 27,6.60883118 27,8.1 L27,13.5 L24.3,13.5 C22.8088312,13.5 21.6,14.7088312 21.6,16.2 C21.6,17.6911688 22.8088312,18.9 24.3,18.9 L27,18.9 Z" id="Path"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="21px" height="27px" viewBox="0 0 21 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>7780B3A6-04AD-41C0-83B2-12DA21E87CFC</title>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v4" transform="translate(-1574, -1810)" fill="#95A3BF">
<g id="Log-storage" transform="translate(1102, 1739)">
<g id="Card-1/8" transform="translate(401, 71)">
<g id="Policies" transform="translate(71, 0)">
<path d="M18,0 C19.6568542,-3.04359188e-16 21,1.34314575 21,3 L21,24 C21,25.6568542 19.6568542,27 18,27 L3,27 C1.34314575,27 2.02906125e-16,25.6568542 0,24 L0,3 C-2.02906125e-16,1.34314575 1.34314575,3.04359188e-16 3,0 L18,0 Z M15.35625,16.605 C14.83125,16.065 14.04375,16.065 13.51875,16.605 L9.1875,21.06 L7.48125,19.305 C7.021875,18.765 6.16875,18.765 5.64375,19.305 C5.11875,19.845 5.11875,20.655 5.64375,21.195 L8.26875,23.895 C8.53125,24.165 8.859375,24.3 9.1875,24.3 C9.515625,24.3 9.84375,24.165 10.10625,23.895 L15.35625,18.495 C15.88125,17.955 15.88125,17.145 15.35625,16.605 Z M16.0625,9.45 L4.9375,9.45 C4.38521525,9.45 3.9375,9.89771525 3.9375,10.45 L3.9375,11.15 C3.9375,11.7022847 4.38521525,12.15 4.9375,12.15 L16.0625,12.15 C16.6147847,12.15 17.0625,11.7022847 17.0625,11.15 L17.0625,10.45 C17.0625,9.89771525 16.6147847,9.45 16.0625,9.45 Z M16.0625,4.05 L4.9375,4.05 C4.38521525,4.05 3.9375,4.49771525 3.9375,5.05 L3.9375,5.75 C3.9375,6.30228475 4.38521525,6.75 4.9375,6.75 L16.0625,6.75 C16.6147847,6.75 17.0625,6.30228475 17.0625,5.75 L17.0625,5.05 C17.0625,4.49771525 16.6147847,4.05 16.0625,4.05 Z" id="Rectangle-2"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="27px" height="27px" viewBox="0 0 27 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>A8855F06-D8BF-417A-841F-4FBE78913DFF</title>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v4" transform="translate(-1734, -1942)" fill="#95A3BF">
<g id="Log-storage" transform="translate(1102, 1739)">
<g id="Card-1/8" transform="translate(564, 203)">
<g id="Unknown-agent" transform="translate(68, 0)">
<path d="M17.4053571,0.0521205975 C18.4487143,-0.201907204 19.5132857,0.496117015 19.7948571,1.67348065 L21.5151429,8.89670596 C21.5252191,8.9391051 21.5342228,8.98182907 21.5421429,9.02482433 C24.8535,9.62786424 27,10.5953788 27,11.6865939 C27,13.5155941 20.9558571,15 13.5,15 C6.04414286,15 0,13.5155941 0,11.6865939 C0,10.5953788 2.1465,9.62786424 5.45785714,9.02482433 L5.48485714,8.89670596 L7.20514286,1.67568959 C7.48671429,0.493908078 8.55128571,-0.201907204 9.59464286,0.0521205975 C10.7787857,0.341491397 12.3042857,0.641906884 13.5,0.641906884 C14.6957143,0.641906884 16.2212143,0.33928246 17.4053571,0.0521205975 Z M7.7625,9.72284855 C7.63511282,9.70805077 7.50781825,9.75189759 7.40868802,9.84471966 C7.30955779,9.93754173 7.24673418,10.0717149 7.23407143,10.2176505 C7.22115184,10.3635566 7.25943347,10.5093566 7.34047424,10.6228979 C7.42151502,10.7364392 7.53865846,10.8083958 7.66607143,10.8228994 C9.4365,11.0283306 11.4152143,11.1431953 13.5,11.1431953 C15.5847857,11.1431953 17.5635,11.0283306 19.3339286,10.8228994 C19.5991436,10.7924003 19.7925566,10.5214212 19.7659286,10.2176505 C19.7393005,9.91387988 19.502715,9.69234949 19.2375,9.72284855 C17.3308445,9.93842752 15.4159177,10.0438538 13.5,10.0387266 C11.4460714,10.0387266 9.49821429,9.92607079 7.7625,9.72284855 Z M1.92582418,20 C1.92582418,19.65 1.98351648,19.312 2.08928571,19 L1.92582418,19 C1.39478115,19 0.964285714,18.5522847 0.964285714,18 C0.964285714,17.4477153 1.39478115,17 1.92582418,17 L8.65659341,17 C10.1098077,17.0001733 11.3359957,18.1245745 11.5181319,19.624 C12.7872537,19.2253356 14.1413177,19.2253356 15.4104396,19.624 C15.5925757,18.1245745 16.8187637,17.0001733 18.271978,17 L25.0027473,17 C25.5337903,17 25.9642857,17.4477153 25.9642857,18 C25.9642857,18.5522847 25.5337903,19 25.0027473,19 L24.8392857,19 C24.9450549,19.312 25.0027473,19.65 25.0027473,20 L25.0027473,22 C25.0027473,24.7614237 22.8502701,27 20.1950549,27 C17.5398398,27 15.3873626,24.7614237 15.3873626,22 L15.3873626,21.72 L14.9835165,21.58 C13.9973271,21.2383946 12.9312443,21.2383946 11.9450549,21.58 L11.5412088,21.72 L11.5412088,22 C11.5412088,24.7614237 9.38873163,27 6.73351648,27 C4.07830134,27 1.92582418,24.7614237 1.92582418,22 L1.92582418,20 L1.92582418,20 Z" id="Shape"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -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

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 28.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
<style type="text/css">
.st0{fill:#3F3F3F;}
</style>
<g>
<path class="st0" d="M4.8,8C4.8,8,4.8,8,4.8,8C4.8,8,4.9,8,4.8,8c0.3,0.1,0.5,0.1,0.7,0.2c0,0,0.1,0,0.1,0c0.3,0,0.5,0.1,0.8,0.1
c0.1,0,0.1,0,0.2,0c0.2,0,0.4,0,0.7,0.1c0.1,0,0.2,0,0.2,0c0.3,0,0.6,0,0.9,0c0.3,0,0.6,0,0.9,0c0.1,0,0.2,0,0.2,0
c0.2,0,0.4,0,0.7-0.1c0.1,0,0.1,0,0.2,0c0.3,0,0.5-0.1,0.8-0.1c0,0,0.1,0,0.1,0c0.2,0,0.4-0.1,0.6-0.1c0,0,0.1,0,0.1,0c0,0,0,0,0,0
c2-0.5,3.3-1.4,3.3-2.4V4.2c0-1.6-3.1-2.8-6.8-2.8S1.6,2.6,1.6,4.2v1.4C1.6,6.6,2.9,7.5,4.8,8z"/>
<path class="st0" d="M13.8,8.8c0.5,0.1,1,0.2,1.4,0.4l0-1.2C14.8,8.4,14.3,8.6,13.8,8.8z"/>
<path class="st0" d="M7.6,17.3c-1.1-0.6-1.9-1.4-2.7-2.3c-0.7-0.1-1.3-0.3-1.9-0.5c-0.5-0.2-1-0.5-1.5-0.8v1.8
c0,0.9,1.1,1.8,2.9,2.3c0,0,0,0,0,0c0,0,0,0,0.1,0c0.2,0.1,0.5,0.1,0.8,0.2c0.1,0,0.1,0,0.2,0C5.6,18,5.9,18,6.2,18.1
c0,0,0.1,0,0.1,0c0.3,0,0.6,0.1,0.9,0.1c0.1,0,0.1,0,0.2,0c0.3,0,0.6,0,1,0c0.3,0,0.7,0,1,0c0,0,0.1,0,0.1,0
C8.9,18,8.2,17.7,7.6,17.3z"/>
<path class="st0" d="M4,13.3c0.1-0.2,0.3-0.4,0.4-0.6c1-1.2,2.1-2.2,3.6-3c-0.4,0-0.8,0-1.2-0.1c-0.2,0-0.3,0-0.5-0.1
c-0.3,0-0.7-0.1-1-0.2C4.4,9.3,3.7,9.1,3,8.9C2.5,8.7,2,8.4,1.6,8l0,3.2C1.6,12.1,2.5,12.8,4,13.3z"/>
</g>
<g>
<path class="st0" d="M5.4,13.6c0.1-0.2,0.3-0.4,0.4-0.6c0.8-1.1,1.8-1.9,3.1-2.5c0.8-0.4,1.7-0.6,2.6-0.7c1.8-0.2,3.4,0.3,4.8,1.3
c0.9,0.6,1.8,1.5,2.4,2.3c0.2,0.2,0.2,0.4,0,0.7c-0.8,1.1-1.7,1.9-2.8,2.6c-0.9,0.5-2,0.9-3.1,1.1c-1.6,0.1-3.1-0.2-4.4-1.1
C7.3,16,6.5,15,5.6,14c0-0.1-0.1-0.1-0.1-0.2C5.4,13.7,5.4,13.6,5.4,13.6z M12.1,10.8c-1.6,0-2.7,1.4-2.7,2.9s1.4,2.7,2.9,2.7
c1.5,0,2.7-1.4,2.7-2.9C15,12,13.6,10.8,12.1,10.8z"/>
<path class="st0" d="M12.2,12.1c0.8,0,1.5,0.6,1.5,1.5c0,0.8-0.6,1.6-1.6,1.6c-0.8,0-1.5-0.6-1.5-1.5
C10.7,12.8,11.3,12.1,12.2,12.1z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="43px" height="43px" viewBox="0 0 43 43" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>AE320C3A-79E4-4E24-956A-B81125ACFA52@svg</title>
<defs>
<linearGradient x1="50%" y1="0%" x2="100%" y2="100%" id="linearGradient-1">
<stop stop-color="#82B92E" offset="0%"></stop>
<stop stop-color="#2EB9A2" offset="100%"></stop>
</linearGradient>
<path d="M0,31.4018658 L0,11.5981342 C0,3.42952349 9.87916654,0 21.5,0 C33.1208335,0 43,3.42952349 43,11.5981342 L43,31.4018658 C43,39.5704765 33.1208335,43 21.5,43 C9.87916654,43 0,39.5704765 0,31.4018658 Z" id="path-2"></path>
</defs>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v4" transform="translate(-324, -276)">
<g id="General-overview" transform="translate(309, 186)">
<g id="Card-1/8" transform="translate(15, 66)">
<g id="Status-check" transform="translate(0, 24)">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<use id="Mask" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
<path d="M40.3336211,1.77120453 C41.5051939,0.599631653 43.4046889,0.599631653 44.5762617,1.77120453 C45.7009717,2.89591449 45.7459601,4.69147742 44.7112269,5.86985562 L44.5762617,6.01384522 L20.142225,30.447882 C19.017515,31.572592 17.2219521,31.6175804 16.0435739,30.5828472 L15.8995843,30.447882 L10.2105122,24.75881 C9.03893936,23.5872371 9.03893936,21.6877422 10.2105122,20.5161693 C11.3352222,19.3914593 13.1307851,19.3464709 14.3091633,20.3812041 L14.4531529,20.5161693 L18.021,24.084 L40.3336211,1.77120453 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="43px" height="43px" viewBox="0 0 43 43" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>CD9D3D2F-E199-427F-BC6C-532C8382EE45@svg</title>
<defs>
<linearGradient x1="100%" y1="5.25852345e-07%" x2="0%" y2="50%" id="linearGradient-1">
<stop stop-color="#F72222" offset="0%"></stop>
<stop stop-color="#E12D81" offset="100%"></stop>
</linearGradient>
<path d="M0,31.4018658 L0,11.5981342 C0,3.42952349 9.87916654,0 21.5,0 C33.1208335,0 43,3.42952349 43,11.5981342 L43,31.4018658 C43,39.5704765 33.1208335,43 21.5,43 C9.87916654,43 0,39.5704765 0,31.4018658 Z" id="path-2"></path>
</defs>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v4" transform="translate(-519, -276)">
<g id="General-overview" transform="translate(309, 186)">
<g id="Card-1/8" transform="translate(210, 66)">
<g id="Path" transform="translate(0, 24)">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<use id="Mask" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
<path d="M17.9773307,13.7437145 L18.1213203,13.8786797 L21.657,17.414 L25.1923882,13.8786797 C26.363961,12.7071068 28.263456,12.7071068 29.4350288,13.8786797 C30.5597388,15.0033896 30.6047272,16.7989525 29.569994,17.9773307 L29.4350288,18.1213203 L25.9,21.657 L29.4350288,25.1923882 C30.6066017,26.363961 30.6066017,28.263456 29.4350288,29.4350288 C28.3103189,30.5597388 26.514756,30.6047272 25.3363778,29.569994 L25.1923882,29.4350288 L21.657,25.9 L18.1213203,29.4350288 C16.9497475,30.6066017 15.0502525,30.6066017 13.8786797,29.4350288 C12.7539697,28.3103189 12.7089813,26.514756 13.7437145,25.3363778 L13.8786797,25.1923882 L17.414,21.657 L13.8786797,18.1213203 C12.7071068,16.9497475 12.7071068,15.0502525 13.8786797,13.8786797 C14.9565267,12.8008326 16.650487,12.7146048 17.8269121,13.6199964 L17.9773307,13.7437145 Z" id="Path-3" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="27px" height="27px" viewBox="0 0 27 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>F7C0551D-EEAD-4AA0-87B8-DE2D255390BB</title>
<g id="Welcome-dashboard---v1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-FMS---Tactical-view-v6" transform="translate(-1764, -1865)" fill="#95A3BF">
<g id="Log-storage" transform="translate(1102, 1662)">
<g id="Card-1/8" transform="translate(594, 203)">
<g id="System-event" transform="translate(68, 0)">
<path d="M11.7078546,2.70325912 C11.1257057,3.92992514 10.8,5.30192625 10.8,6.75 C10.8,11.9690909 15.0309091,16.2 20.25,16.2 C21.6996594,16.2 23.0730794,15.8735806 24.3007699,15.2902321 L24.3,20.4457055 C24.3,25.0619204 18.7171222,27 12.15,27 C5.58287783,27 0,25.0619204 0,20.4457055 L0,9.25429447 C0,4.79456141 5.2107929,2.83447266 11.4857292,2.70670994 Z M20.25,0 C23.9779221,0 27,3.02207794 27,6.75 C27,10.4779221 23.9779221,13.5 20.25,13.5 C16.5220779,13.5 13.5,10.4779221 13.5,6.75 C13.5,3.02207794 16.5220779,0 20.25,0 Z M21.6,4.05 L20.4317308,4.05 C20.3365385,4.59915254 19.7394231,5.05677966 18.9,5.06510015 L18.9,5.93875193 L20.2413462,5.93875193 L20.2413462,9.45 L21.6,9.45 L21.6,4.05 Z" id="Mask"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -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,

View File

@ -0,0 +1,78 @@
<?php
/**
* Ajax secondary controller for general tactival view.
*
* @category Ajax general tactical view page.
* @package Pandora FMS
* @subpackage Opensource
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Pandora FMS
* Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
// Only logged users have access to this endpoint.
check_login();
if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access credential store'
);
if (is_ajax()) {
echo json_encode(['error' => 'noaccess']);
} else {
include 'general/noaccess.php';
}
exit;
}
// AJAX controller.
if (is_ajax()) {
$dir = $config['homedir'].'/include/lib/TacticalView/elements/';
$method = get_parameter('method');
$class = get_parameter('class');
$filepath = realpath($dir.'/'.$class.'.php');
if (is_readable($filepath) === false
|| is_dir($filepath) === true
|| preg_match('/.*\.php$/', $filepath) === false
) {
exit;
}
include_once $filepath;
if (class_exists($class) === true) {
$instance = new $class();
if ($instance->ajaxMethod($method) === true) {
echo $instance->{$method}();
} else {
$instance->error('Unavailable method.');
}
} else {
$class->error('Class not found. ['.$class.']');
}
exit;
}

View File

@ -483,6 +483,13 @@ if (check_login()) {
'tagente_modulo',
['id_agente_modulo' => $module_id]
);
$made_enabled = db_get_value_filter(
'made_enabled',
'tagente_modulo',
['id_agente_modulo' => $module_id]
);
$unit = db_get_value_filter(
'unit',
'tagente_modulo',
@ -1627,7 +1634,6 @@ if (check_login()) {
// Uncompress.
try {
ob_start();
$dateNow = get_system_time();
$final = ($dateNow - $period);
$date = ($dateNow - ($time_all_box * $start));
@ -1751,31 +1757,11 @@ if (check_login()) {
'recordsFiltered' => $total_box,
]
);
$response = ob_get_clean();
// Clean output buffer.
while (ob_get_level() !== 0) {
ob_end_clean();
}
} catch (Exception $e) {
echo json_encode(
['error' => $e->getMessage()]
);
}
// If not valid it will throw an exception.
json_decode($response);
if (json_last_error() === JSON_ERROR_NONE) {
// If valid dump.
echo $response;
} else {
echo json_encode(
['error' => $response]
);
}
return;
}
if ($get_cluster_module_detail === true) {

View File

@ -96,9 +96,6 @@ if ($force_remote_check) {
if ($load_css_cv === true) {
$uniq = get_parameter('uniq', 0);
$ratio = get_parameter('ratio', 0);
$output = css_label_styles_visual_console($uniq, $ratio);
echo $output;
return;
}

View File

@ -256,6 +256,7 @@ class ConsoleSupervisor
/*
* Check if performance variables are corrects
*/
$this->checkPerformanceVariables();
/*
@ -289,6 +290,12 @@ class ConsoleSupervisor
*/
$this->checkMYSQLSettings();
/*
* Check log alerts version
*/
$this->checkLogAlerts();
}
@ -2099,8 +2106,8 @@ class ConsoleSupervisor
$this->notify(
[
'type' => 'NOTIF.EXT.ELASTICSEARCH',
'title' => __('Log collector cannot connect to ElasticSearch'),
'message' => __('ElasticSearch is not available using current configuration.'),
'title' => __('Log collector cannot connect to OpenSearch'),
'message' => __('OpenSearch is not available using current configuration.'),
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup&section=log',
]
);
@ -3106,4 +3113,32 @@ class ConsoleSupervisor
}
/**
* Checks log alerts version.
*
* @return void
*/
public function checkLogAlerts()
{
global $config;
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
$current_package = (int) $config['current_package'];
if ($current_package >= 774 && $current_package <= 777) {
$url = '__url__index.php?sec=galertas&sec2=enterprise/godmode/alerts/event_alerts';
$this->notify(
[
'type' => 'NOTIF.LOG.ALERT',
'title' => __('Alert correlation changed since version 774'),
'message' => __('Log correlation and log correlation with events will be disabled in this update. Some event correlation alerts may need to be modified to adapt to the new format'),
'url' => $url,
]
);
} else {
$this->cleanNotifications('NOTIF.LOG.ALERT');
}
}
}
}

View File

@ -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;

View File

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

View File

@ -441,6 +441,8 @@ define('SERVER_TYPE_ALERT', 21);
define('SERVER_TYPE_CORRELATION', 22);
define('SERVER_TYPE_NCM', 23);
define('SERVER_TYPE_NETFLOW', 24);
define('SERVER_TYPE_LOG', 25);
define('SERVER_TYPE_MADE', 26);
// REPORTS.
define('REPORT_TOP_N_MAX', 1);
@ -887,3 +889,8 @@ define('HOME_SCREEN_ALERT_DETAIL', 'alert_detail');
define('HOME_SCREEN_EXTERNAL_LINK', 'external_link');
define('HOME_SCREEN_OTHER', 'other');
define('HOME_SCREEN_DASHBOARD', 'dashboard');
// Alert correlation.
define('EVENT_ALERTS', 1);
define('LOG_ALERTS', 2);

View File

@ -1676,6 +1676,18 @@ function config_update_config()
if (config_update_value('Days_purge_old_information', (int) get_parameter('Days_purge_old_information'), true) === false) {
$error_update[] = __('Days to purge old information');
}
if (config_update_value('elasticsearch_user', get_parameter('elasticsearch_user'), true) === false) {
$error_update[] = __('User ElasticSearch server');
}
if (config_update_value('elasticsearch_pass', get_parameter('elasticsearch_pass'), true) === false) {
$error_update[] = __('Pass ElasticSearch server');
}
if (config_update_value('elasticsearch_https', get_parameter('elasticsearch_https'), true) === false) {
$error_update[] = __('Https ElasticSearch server');
}
break;
case 'hist_db':
@ -2466,7 +2478,19 @@ function config_process_config()
}
if (!isset($config['Days_purge_old_information'])) {
config_update_value('Days_purge_old_information', 90);
config_update_value('Days_purge_old_information', 30);
}
if (!isset($config['elasticsearch_user'])) {
config_update_value('elasticsearch_user', '');
}
if (!isset($config['elasticsearch_pass'])) {
config_update_value('elasticsearch_pass', '');
}
if (!isset($config['elasticsearch_https'])) {
config_update_value('elasticsearch_https', '');
}
if (!isset($config['font_size'])) {

View File

@ -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;

View File

@ -2763,6 +2763,7 @@ function graph_agent_status(
'height' => $height,
'colors' => array_values($colors),
'legend' => ['display' => false],
'labels' => array_keys($data),
];
if ($donut_narrow_graph == true) {
@ -4624,12 +4625,17 @@ function graph_nodata_image($options)
return base64_encode($dataImg);
}
$widthImage = '200px';
if (isset($options['nodata_image']['width']) === true) {
$widthImage = $options['nodata_image']['width'];
}
return html_print_image(
'images/image_problem_area.png',
true,
[
'title' => __('No data'),
'style' => 'width: 200px;',
'style' => 'width: '.$widthImage.';',
]
);
}

View File

@ -5409,7 +5409,7 @@ function html_print_link_with_params($text, $params=[], $type='text', $style='',
$formStyle = ' style="'.$formStyle.'"';
}
$html = '<form method="POST"'.$formStyle.'>';
$html = '<form method="POST"'.$formStyle.' class="link-with-params">';
switch ($type) {
case 'image':
$html .= html_print_input_image($text, $text, $text, $style, true);
@ -7304,7 +7304,9 @@ function html_print_select_date_range(
$date_end='',
$time_end='',
$date_text=SECONDS_1DAY,
$class='w100p'
$class='w100p',
$date_format='Y/m/d',
$time_format='H:i:s'
) {
global $config;
@ -7326,21 +7328,21 @@ function html_print_select_date_range(
}
if ($date_end === '') {
$date_end = date('Y/m/d');
$date_end = date($date_format);
}
if ($date_init === '') {
$date_init = date('Y/m/d', strtotime($date_end.' -1 days'));
$date_init = date($date_format, strtotime($date_end.' -1 days'));
}
$date_init = date('Y/m/d', strtotime($date_init));
$date_init = date($date_format, strtotime($date_init));
if ($time_init === '') {
$time_init = date('H:i:s');
$time_init = date($time_format);
}
if ($time_end === '') {
$time_end = date('H:i:s');
$time_end = date($time_format);
}
$fields[SECONDS_1DAY] = __('Last 24hr');

View File

@ -4762,3 +4762,31 @@ function export_agents_module_csv($filters)
return $result;
}
/**
* Check if modules are compatible with MADE server.
*
* @param integer $id_tipo_modulo
* @retur boolean True if compatible, false otherwise.
*/
function modules_made_compatible($id_tipo_modulo)
{
$compatible_types = [
1,
4,
5,
8,
15,
16,
22,
30,
34,
];
if (array_search($id_tipo_modulo, $compatible_types) === false) {
return false;
} else {
return true;
}
}

View File

@ -498,7 +498,7 @@ function netflow_get_top_N(
$options = '-o "fmt:%sap,%dap,%ibyt,%bps" -q -n '.$max.' -s record/bytes -t '.date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date);
$command = netflow_get_command($options, $filter);
$command = netflow_get_command($options, $filter, $start_date, $end_date);
// Execute nfdump.
exec($command, $lines);
@ -656,7 +656,10 @@ function netflow_get_data(
$aggregate,
$max,
$absolute,
$connection_name
$connection_name,
false,
$start_date,
$end_date
);
foreach ($data as $line) {
@ -734,6 +737,8 @@ function netflow_get_data(
* to get troughput.
* @param string $connection_name Node name when data is get in meta.
* @param boolean $address_resolution True to resolve ips to hostnames.
* @param integer $start_date_fixed Start date for use in command netflow.
* @param integer $end_date_fixed End date for use in command netflow.
*
* @return array With netflow stats.
*/
@ -745,7 +750,9 @@ function netflow_get_stats(
$max,
$absolute=true,
$connection_name='',
$address_resolution=false
$address_resolution=false,
$start_date_fixed=0,
$end_date_fixed=0,
) {
global $config, $nfdump_date_format;
@ -757,8 +764,7 @@ function netflow_get_stats(
// Get the command to call nfdump.
$options = "-o csv -q -n $max -s $aggregate/bytes -t ".date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date);
$command = netflow_get_command($options, $filter);
$command = netflow_get_command($options, $filter, $start_date_fixed, $end_date_fixed);
// Execute nfdump.
exec($command, $string);
@ -845,7 +851,7 @@ function netflow_get_summary($start_date, $end_date, $filter, $connection_name='
// Get the command to call nfdump.
$options = '-o csv -n 1 -s srcip/bytes -t '.date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date);
$command = netflow_get_command($options, $filter);
$command = netflow_get_command($options, $filter, $start_date, $end_date);
// Execute nfdump.
exec($command, $string);
@ -916,7 +922,7 @@ function netflow_get_relationships_raw_data(
// Get the command to call nfdump.
$options = ' -q -o csv -n 10000 -s record/bytes -t '.date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date);
$command = netflow_get_command($options, $filter);
$command = netflow_get_command($options, $filter, $start_date, $end_date);
// Execute nfdump.
// $command .= ' -q -o csv -n 10000 -s record/bytes -t '.date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date);
@ -1018,7 +1024,7 @@ function netflow_parse_relationships_for_circular_mesh(
*
* @return string Command to run.
*/
function netflow_get_command($options, $filter)
function netflow_get_command($options, $filter, $date_init=0, $date_end=0)
{
global $config;
@ -1030,14 +1036,46 @@ function netflow_get_command($options, $filter)
&& isset($config['netflow_name_dir']) && $config['netflow_name_dir'] !== ''
&& isset($config['general_network_path']) && $config['general_network_path'] !== ''
) {
$command .= ' -R. -M '.$config['general_network_path'].$config['netflow_name_dir'].':'.$config['sflow_name_dir'];
if ($date_init > 0 && $date_end > 0) {
$path = $config['general_network_path'].$config['sflow_name_dir'];
$range_time = find_range_files_time($path, $date_init, $date_end);
if ($range_time[0] === 0 && $range_time[1] === 0) {
$interval_files_sflow = $path;
} else {
$interval_files_sflow = $path.'/'.$range_time[0].':'.$range_time[1];
}
$path = $config['general_network_path'].$config['netflow_name_dir'];
$range_time = find_range_files_time($path, $date_init, $date_end);
if ($range_time[0] === 0 && $range_time[1] === 0) {
$interval_files_netflow = $path;
} else {
$interval_files_netflow = $path.'/'.$range_time[0].':'.$range_time[1];
}
$command .= ' -R '.$interval_files_sflow.' -R '.$interval_files_netflow;
} else {
$command .= ' -R. -M '.$config['general_network_path'].$config['netflow_name_dir'].':'.$config['sflow_name_dir'];
}
}
} else {
if ($config['activate_sflow']) {
if (isset($config['sflow_name_dir']) && $config['sflow_name_dir'] !== ''
&& isset($config['general_network_path']) && $config['general_network_path'] !== ''
) {
$command .= ' -R. -M '.$config['general_network_path'].$config['sflow_name_dir'];
if ($date_init > 0 && $date_end > 0) {
$path = $config['general_network_path'].$config['sflow_name_dir'];
$range_time = find_range_files_time($path, $date_init, $date_end);
if ($range_time[0] === 0 && $range_time[1] === 0) {
$interval_files = '.';
} else {
$interval_files = $range_time[0].':'.$range_time[1];
}
} else {
$interval_files = '.';
}
$command .= ' -R '.$interval_files.' -M '.$config['general_network_path'].$config['sflow_name_dir'];
}
}
@ -1045,7 +1083,19 @@ function netflow_get_command($options, $filter)
if (isset($config['netflow_name_dir']) && $config['netflow_name_dir'] !== ''
&& isset($config['general_network_path']) && $config['general_network_path'] !== ''
) {
$command .= ' -R. -M '.$config['general_network_path'].$config['netflow_name_dir'];
if ($date_init > 0 && $date_end > 0) {
$path = $config['general_network_path'].$config['netflow_name_dir'];
$range_time = find_range_files_time($path, $date_init, $date_end);
if ($range_time[0] === 0 && $range_time[1] === 0) {
$interval_files = '.';
} else {
$interval_files = $range_time[0].':'.$range_time[1];
}
} else {
$interval_files = '.';
}
$command .= ' -R '.$interval_files.' -M '.$config['general_network_path'].$config['netflow_name_dir'];
}
}
}
@ -1059,6 +1109,62 @@ function netflow_get_command($options, $filter)
}
/**
* Find the two files closest to the time range.
*
* @param string $folder Folder of netflow.
* @param integer $date_init Time init for range.
* @param integer $date_end Time end for range.
*
* @return array
*/
function find_range_files_time($folder, $date_init, $date_end)
{
$closest_init = 0;
$closest_end = 0;
$closest_init_date = 0;
$closest_end_date = 0;
$min_diff_init = PHP_INT_MAX;
$min_diff_end = PHP_INT_MAX;
$files = scandir($folder);
if ($date_init > 0) {
foreach ($files as $file) {
if (preg_match('/^nfcapd\.(\d{12})$/', $file, $matches)) {
$file_date = $matches[1];
$file_date = strtotime(substr($file_date, 0, 4).'-'.substr($file_date, 4, 2).'-'.substr($file_date, 6, 2).' '.substr($file_date, 8, 2).':'.substr($file_date, 10, 2));
$diff_init = abs($file_date - $date_init);
if ($diff_init < $min_diff_init) {
$closest_init_date = $file_date;
$min_diff_init = $diff_init;
$closest_init = $file;
}
$diff_end = abs($file_date - $date_end);
if ($diff_end < $min_diff_end) {
$closest_end_date = $file_date;
$min_diff_end = $diff_end;
$closest_end = $file;
}
}
}
}
if ($closest_end_date < $date_init || $closest_init_date > $date_end) {
return [
0,
0,
];
} else {
return [
$closest_init,
$closest_end,
];
}
}
/**
* Returns the nfdump command line arguments that match the given filter.
*
@ -1336,7 +1442,9 @@ function netflow_draw_item(
$max_aggregates,
true,
$connection_name,
$address_resolution
$address_resolution,
$start_date,
$end_date
);
if (empty($data_pie) === true) {
@ -1451,7 +1559,9 @@ function netflow_draw_item(
$max_aggregates,
true,
$connection_name,
$address_resolution
$address_resolution,
$start_date,
$end_date
);
if (empty($data_stats) === false) {
@ -1572,7 +1682,9 @@ function netflow_get_item_data(
$aggregate,
$max_aggregates,
true,
$connection_name
$connection_name,
$start_date,
$end_date
);
$data = [
@ -1801,7 +1913,7 @@ function netflow_get_top_summary(
}
$options = "-q -o csv -n $max -s $sort/$order_text -t ".date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date);
$command = netflow_get_command($options, $netflow_filter);
$command = netflow_get_command($options, $netflow_filter, $start_date, $end_date);
exec($command, $result);
if (! is_array($result)) {
@ -1962,7 +2074,7 @@ function netflow_get_top_data(
date($nfdump_date_format, $start_date),
date($nfdump_date_format, $end_date)
);
$agg_command = netflow_get_command($options, $filter);
$agg_command = netflow_get_command($options, $filter, $start_date, $end_date);
// Call nfdump.
exec($agg_command, $string);

View File

@ -906,7 +906,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
'images/logs@svg.svg',
true,
[
'title' => __('Log server'),
'title' => __('Syslog server'),
'class' => 'main_menu_icon invert_filter',
]
);
@ -979,6 +979,32 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
$id_modulo = 0;
break;
case SERVER_TYPE_LOG:
$server['img'] = html_print_image(
'images/log_server.svg',
true,
[
'title' => __('Log server'),
'class' => 'main_menu_icon invert_filter',
]
);
$server['type'] = 'log';
$id_modulo = 0;
break;
case SERVER_TYPE_MADE:
$server['img'] = html_print_image(
'images/Anomaly-detection@svg.svg',
true,
[
'title' => __('MADE server'),
'class' => 'main_menu_icon invert_filter',
]
);
$server['type'] = 'made';
$id_modulo = 0;
break;
default:
$server['img'] = '';
$server['type'] = 'unknown';

View File

@ -7326,7 +7326,8 @@ function ui_query_result_editor($name='default')
]
);
html_print_submit_button(__('Execute query'), 'execute_query', false, ['icon' => 'update']);
$execute_button = html_print_submit_button(__('Execute query'), 'execute_query', false, ['icon' => 'update'], true);
html_print_action_buttons($execute_button);
}

View File

@ -4548,54 +4548,4 @@ function visual_map_load_client_resources()
closedir($dh);
}
}
}
/**
* Labels styles visual console.
*
* @param string $uniq Uniq str.
* @param integer $ratio Ratio.
*
* @return string Css output.
*/
function css_label_styles_visual_console($uniq, $ratio=1)
{
global $config;
$output = '';
// Horrible trick! due to the use of tinyMCE
// it is necessary to modify specific classes of each
// of the visual consoles.
$output .= '.c-'.$uniq.' a {color: #3f3f3f } ';
$output .= '.c-'.$uniq.' .label p strong span {display: inline-block !important; line-height: normal !important} ';
$output .= '.c-'.$uniq.' *:not(.parent_graph p table tr td span) { font-size: '.(8 * $ratio).'pt; line-height:'.(8 * ($ratio)).'pt; }';
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td { padding: 0; margin: 0; white-space: pre-wrap; }';
$output .= '.c-'.$uniq.' .visual_font_size_4pt, .c-'.$uniq.' .visual_font_size_4pt * { font-size: '.(4 * $ratio).'pt !important; line-height:'.(4 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_6pt, .c-'.$uniq.' .visual_font_size_6pt * { font-size: '.(6 * $ratio).'pt !important; line-height:'.(6 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_8pt, .c-'.$uniq.' .visual_font_size_8pt * { font-size: '.(8 * $ratio).'pt !important; line-height:'.(8 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_10pt, .c-'.$uniq.' .visual_font_size_10pt * { font-size: '.(10 * $ratio).'pt !important; line-height:'.(10 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_12pt, .c-'.$uniq.' .visual_font_size_12pt * { font-size: '.(12 * $ratio).'pt !important; line-height:'.(12 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_14pt, .c-'.$uniq.' .visual_font_size_14pt * { font-size: '.(14 * $ratio).'pt !important; line-height:'.(14 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_18pt, .c-'.$uniq.' .visual_font_size_18pt * { font-size: '.(18 * $ratio).'pt !important; line-height:'.(18 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_24pt, .c-'.$uniq.' .visual_font_size_24pt * { font-size: '.(24 * $ratio).'pt !important; line-height:'.(24 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_28pt, .c-'.$uniq.' .visual_font_size_28pt * { font-size: '.(28 * $ratio).'pt !important; line-height:'.(28 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_36pt, .c-'.$uniq.' .visual_font_size_36pt * { font-size: '.(36 * $ratio).'pt !important; line-height:'.(36 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_48pt, .c-'.$uniq.' .visual_font_size_48pt * { font-size: '.(48 * $ratio).'pt !important; line-height:'.(48 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_60pt, .c-'.$uniq.' .visual_font_size_60pt * { font-size: '.(60 * $ratio).'pt !important; line-height:'.(60 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_72pt, .c-'.$uniq.' .visual_font_size_72pt * { font-size: '.(72 * $ratio).'pt !important; line-height:'.(72 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_84pt, .c-'.$uniq.' .visual_font_size_84pt * { font-size: '.(84 * $ratio).'pt !important; line-height:'.(84 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_96pt, .c-'.$uniq.' .visual_font_size_96pt * { font-size: '.(96 * $ratio).'pt !important; line-height:'.(96 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_116pt, .c-'.$uniq.' .visual_font_size_116pt * { font-size: '.(116 * $ratio).'pt !important; line-height:'.(116 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_128pt, .c-'.$uniq.' .visual_font_size_128pt * { font-size: '.(128 * $ratio).'pt !important; line-height:'.(128 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_140pt, .c-'.$uniq.' .visual_font_size_140pt * { font-size: '.(140 * $ratio).'pt !important; line-height:'.(140 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_154pt, .c-'.$uniq.' .visual_font_size_154pt * { font-size: '.(154 * $ratio).'pt !important; line-height:'.(154 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_196pt, .c-'.$uniq.' .visual_font_size_196pt * { font-size: '.(196 * $ratio).'pt !important; line-height:'.(196 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .flot-text, .c-'.$uniq.' .flot-text * { font-size: '.(($config['font_size'] - 2) * $ratio).'pt !important; line-height:'.(($config['font_size'] - 2) * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.time {font-size: '.(50 * $ratio).'px !important; line-height: '.(50 * $ratio).'px !important;}';
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.date {font-size: '.(25 * $ratio).'px !important; line-height: '.(25 * $ratio).'px !important;}';
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.timezone {font-size: '.(25 * $ratio).'px !important; line-height: '.(25 * $ratio).'px !important;}';
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph * {font-size: '.(8 * $ratio).'px !important; line-height: '.(8 * $ratio).'px !important;}';
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph g rect {width:'.(25 * $ratio).' !important; height: '.(15 * $ratio).' !important;}';
return $output;
}
}

View File

@ -725,6 +725,12 @@ function get_build_setup_charts($type, $options, $data)
$chart->options()->getElements()->center()->setColor($options['elements']['center']['color']);
}
}
if (isset($options['elements']['point']) === true) {
if (isset($options['elements']['point']['radius']) === true) {
$chart->options()->getElements()->point()->setRadius($options['elements']['point']['radius']);
}
}
}
// Set Responsive for responsive charts.
@ -1019,7 +1025,9 @@ function get_build_setup_charts($type, $options, $data)
) {
$scales = $chart->options()->getScales();
if ($options['scales']['x'] !== false) {
if (isset($options['scales']['x']) === true
&& $options['scales']['x'] !== false
) {
// Defaults scalesFont X.
$scalesXFonts = $scales->getX()->ticks()->getFonts();
$scalesXFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
@ -1028,7 +1036,9 @@ function get_build_setup_charts($type, $options, $data)
$scalesXFonts->setSize(((int) $config['font_size'] + 2));
}
if ($options['scales']['y'] !== false) {
if (isset($options['scales']['y']) === true
&& $options['scales']['y'] !== false
) {
// Defaults scalesFont Y.
$scalesYFonts = $scales->getY()->ticks()->getFonts();
$scalesYFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
@ -1037,7 +1047,9 @@ function get_build_setup_charts($type, $options, $data)
$scalesYFonts->setSize(((int) $config['font_size'] + 2));
}
if ($options['scales']['r'] !== false) {
if (isset($options['scales']['r']) === true
&& $options['scales']['r'] !== false
) {
// Defaults scalesFont R.
$scalesRFonts = $scales->getR()->pointLabels()->getFonts();
$scalesRFonts->setStyle('normal');
@ -1053,6 +1065,10 @@ function get_build_setup_charts($type, $options, $data)
$scales->getX()->setBounds($options['scales']['x']['bounds']);
}
if (isset($options['scales']['x']['display']) === true) {
$scales->getX()->setDisplay($options['scales']['x']['display']);
}
if (isset($options['scales']['x']['grid']) === true
&& empty($options['scales']['x']['grid']) === false
&& is_array($options['scales']['x']['grid']) === true
@ -1098,6 +1114,10 @@ function get_build_setup_charts($type, $options, $data)
$scales->getY()->setBounds($options['scales']['y']['bounds']);
}
if (isset($options['scales']['y']['display']) === true) {
$scales->getY()->setDisplay($options['scales']['y']['display']);
}
if (isset($options['scales']['y']['grid']) === true
&& empty($options['scales']['y']['grid']) === false
&& is_array($options['scales']['y']['grid']) === true
@ -1202,6 +1222,13 @@ function get_build_setup_charts($type, $options, $data)
$borders = array_values($defaultBorder);
}
if (isset($options['borderColors']) === true
&& empty($options['borderColors']) === false
&& is_array($options['borderColors']) === true
) {
$borders = $options['borderColors'];
}
// Set labels.
if (isset($options['labels']) === true
&& empty($options['labels']) === false

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/* eslint-disable no-unused-vars */
/* global $, load_modal, generalShowMsg, confirmDialog */
/* global $, load_modal, generalShowMsg, confirmDialog, jQuery */
function allowDrop(ev) {
ev.preventDefault();
@ -172,3 +172,317 @@ function disabled_alert(settings) {
}
});
}
function ajax_get_integria_custom_fields(
ticket_type_id,
values,
recovery_values,
max_macro_fields
) {
values = values || [];
recovery_values = recovery_values || [];
if (
ticket_type_id === null ||
ticket_type_id === "" ||
(Array.isArray(values) &&
values.length === 0 &&
Array.isArray(recovery_values) &&
recovery_values.length === 0)
) {
for (let i = 8; i <= max_macro_fields; i++) {
$("[name=field" + i + "_value\\[\\]").val("");
$("[name=field" + i + "_recovery_value\\[\\]").val("");
}
}
// On ticket type change, hide all table rows and inputs corresponding to custom fields, regardless of what its type is.
for (let i = 8; i <= max_macro_fields; i++) {
$("[name=field" + i + "_value\\[\\]").hide();
$("[name=field" + i + "_recovery_value\\[\\]").hide();
$("#table_macros-field" + i).hide();
$("[name=field" + i + "_value_container").hide();
$("[name=field" + i + "_recovery_value_container").hide();
}
jQuery.post(
"ajax.php",
{
page: "godmode/alerts/configure_alert_action",
get_integria_ticket_custom_types: 1,
ticket_type_id: ticket_type_id
},
function(data) {
data.forEach(function(custom_field, key) {
var custom_field_key = key + 8; // Custom fields start from field 8.
if (custom_field_key > max_macro_fields) {
return;
}
// Display field row for current input.
var custom_field_row = $("#table_macros-field" + custom_field_key);
custom_field_row.show();
// Replace label text of field row for current input.
var label_html = $("#table_macros-field" + custom_field_key + " td")
.first()
.html();
var label_name = label_html.split("<br>")[0];
var new_html_content = custom_field_row
.html()
.replace(label_name, custom_field.label);
custom_field_row.html(new_html_content);
switch (custom_field.type) {
case "CHECKBOX":
var checkbox_selector = $(
'input[type="checkbox"][name=field' +
custom_field_key +
"_value\\[\\]]"
);
var checkbox_recovery_selector = $(
'input[type="checkbox"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
);
checkbox_selector.on("change", function() {
if (checkbox_selector.prop("checked")) {
checkbox_selector.attr("value", "1");
} else {
checkbox_selector.attr("value", "0");
}
});
checkbox_recovery_selector.on("change", function() {
if (checkbox_recovery_selector.prop("checked")) {
checkbox_recovery_selector.attr("value", "1");
} else {
checkbox_recovery_selector.attr("value", "0");
}
});
if (typeof values[key] !== "undefined") {
if (values[key] == 1) {
checkbox_selector.prop("checked", true);
checkbox_selector.attr("value", "1");
} else {
checkbox_selector.prop("checked", false);
checkbox_selector.attr("value", "0");
}
}
if (typeof recovery_values[key] !== "undefined") {
if (recovery_values[key] == 1) {
checkbox_recovery_selector.prop("checked", true);
checkbox_recovery_selector.attr("value", "1");
} else {
checkbox_recovery_selector.prop("checked", false);
checkbox_recovery_selector.attr("value", "0");
}
}
$("[name=field" + custom_field_key + "_value_container]").show();
$(
"[name=field" + custom_field_key + "_recovery_value_container]"
).show();
$(
'input[type="checkbox"][name=field' +
custom_field_key +
"_value\\[\\]]"
).show();
$(
'input[type="checkbox"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
break;
case "COMBO":
var combo_input = $(
"select[name=field" + custom_field_key + "_value\\[\\]]"
);
var combo_input_recovery = $(
"select[name=field" + custom_field_key + "_recovery_value\\[\\]]"
);
combo_input.find("option").remove();
combo_input_recovery.find("option").remove();
var combo_values_array = custom_field.comboValue.split(",");
combo_values_array.forEach(function(value) {
combo_input.append(
$("<option>", {
value: value,
text: value
})
);
combo_input_recovery.append(
$("<option>", {
value: value,
text: value
})
);
});
if (typeof values[key] !== "undefined") {
combo_input.val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
combo_input_recovery.val(recovery_values[key]);
}
combo_input.show();
combo_input_recovery.show();
break;
case "DATE":
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).removeClass("hasDatepicker");
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).removeClass("hasDatepicker");
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).datepicker("destroy");
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).datepicker("destroy");
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).show();
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).datepicker({ dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>" });
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).datepicker({ dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>" });
$.datepicker.setDefaults(
$.datepicker.regional["<?php echo get_user_language(); ?>"]
);
if (typeof values[key] !== "undefined") {
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).val(recovery_values[key]);
}
break;
case "NUMERIC":
if (typeof values[key] !== "undefined") {
$(
'input[type="number"][name=field' +
custom_field_key +
"_value\\[\\]]"
).val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$(
'input[type="number"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).val(recovery_values[key]);
}
$(
'input[type="number"][name=field' +
custom_field_key +
"_value\\[\\]]"
).show();
$(
'input[type="number"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
break;
case "TEXT":
if (typeof values[key] !== "undefined") {
$(
'input.normal[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$(
'input.normal[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).val(recovery_values[key]);
}
$(
'input.normal[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).show();
$(
'input.normal[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
break;
case "TEXTAREA":
default:
if (typeof values[key] !== "undefined") {
$("textarea[name=field" + custom_field_key + "_value\\[\\]]").val(
values[key]
);
}
if (typeof recovery_values[key] !== "undefined") {
$(
"textarea[name=field" +
custom_field_key +
"_recovery_value\\[\\]]"
).val(recovery_values[key]);
}
$(
"textarea[name=field" + custom_field_key + "_value\\[\\]]"
).show();
$(
"textarea[name=field" +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
break;
}
});
},
"json"
);
}

View File

@ -1,5 +1,8 @@
var editor = ace.edit("elasticsearch_editor");
editor.setValue(`GET _search \n{\n "query": {\n "match_all": {}\n }\n}`);
editor.setValue(`GET _search\n{\n "query": {\n "match_all": {}\n }\n}`);
editor.session.setMode("ace/mode/json");
editor.setTheme("ace/theme/textmate");
editor.session.setUseWorker(false);
editor.clearSelection();
var view = ace.edit("elasticsearch_view");

View File

@ -0,0 +1,94 @@
/* global $ */
$(document).ready(function() {
$.ajax({
url: "ajax.php",
data: {
page: "include/ajax/general_tactical_view.ajax",
method: "getEventsGraph",
class: "Events"
},
type: "POST",
success: function(data) {
$("#events-last-24").html(data);
}
});
$.ajax({
url: "ajax.php",
data: {
page: "include/ajax/general_tactical_view.ajax",
method: "getEventsCriticalityGraph",
class: "Events"
},
type: "POST",
success: function(data) {
$("#events-criticality").html(data);
}
});
// Prevent that graphs use same name.
setTimeout(() => {
$.ajax({
url: "ajax.php",
data: {
page: "include/ajax/general_tactical_view.ajax",
method: "getEventsStatusGraph",
class: "Events"
},
type: "POST",
success: function(data) {
$("#events-status-validate").html(data);
}
});
}, 100);
$.ajax({
url: "ajax.php",
data: {
page: "include/ajax/general_tactical_view.ajax",
method: "getEventsStatusValidateGraph",
class: "Events"
},
type: "POST",
success: function(data) {
$("#events-status-pending-validate").html(data);
}
});
$.ajax({
url: "ajax.php",
data: {
page: "include/ajax/general_tactical_view.ajax",
method: "getStatusHeatMap",
class: "Groups",
width: $("#heatmap-group").width() - 50,
height:
$("#heatmap-group").height() < 280 ? 280 : $("#heatmap-group").height()
},
type: "POST",
success: function(data) {
var title = $(data)[1];
var heatmap = $(data)[0];
$("#heatmap-group").html(heatmap);
$("#heatmap-title").html($(title).html());
}
});
});
function autoRefresh(interval, id, method, php_class) {
setInterval(() => {
$.ajax({
url: "ajax.php",
data: {
page: "include/ajax/general_tactical_view.ajax",
method: method,
class: php_class
},
type: "POST",
success: function(data) {
var content = $(data).html();
$("#" + id).html(content);
}
});
}, interval);
}

View File

@ -1440,22 +1440,56 @@ function openURLTagWindow(url) {
*/
function defineTinyMCE(selector) {
var defaultToolbar =
"undo redo | blocks | bold italic | code | alignleft aligncenter alignright alignjustify | outdent indent";
tinymce.init({
selector: selector,
plugins: "preview, searchreplace, table, nonbreaking, link, image",
plugins:
"preview, searchreplace, table, nonbreaking, link, image, code, codesample",
promotion: false,
branding: false
branding: false,
codesample_languages: [
{ text: "HTML/XML", value: "markup" },
{ text: "JavaScript", value: "javascript" },
{ text: "CSS", value: "css" },
{ text: "PHP", value: "php" },
{ text: "Ruby", value: "ruby" },
{ text: "Python", value: "python" },
{ text: "Java", value: "java" },
{ text: "C", value: "c" },
{ text: "C#", value: "csharp" },
{ text: "C++", value: "cpp" }
],
toolbar: defaultToolbar
});
}
function defineTinyMCEDark(selector) {
var defaultToolbar =
"undo redo | blocks | bold italic | code | alignleft aligncenter alignright alignjustify | outdent indent";
tinymce.init({
selector: selector,
plugins: "preview, searchreplace, table, nonbreaking, link, image",
plugins:
"preview, searchreplace, table, nonbreaking, link, image, code, codesample",
promotion: false,
branding: false,
skin: "oxide-dark",
content_css: "dark"
content_css: "dark",
codesample_languages: [
{ text: "HTML/XML", value: "markup" },
{ text: "JavaScript", value: "javascript" },
{ text: "CSS", value: "css" },
{ text: "PHP", value: "php" },
{ text: "Ruby", value: "ruby" },
{ text: "Python", value: "python" },
{ text: "Java", value: "java" },
{ text: "C", value: "c" },
{ text: "C#", value: "csharp" },
{ text: "C++", value: "cpp" }
],
toolbar: defaultToolbar
});
}

View File

@ -1294,8 +1294,6 @@ function refresh_pagination_callback(
// eslint-disable-next-line no-unused-vars
function dashboardLoadVC(settings) {
var headerMobileFix = 40;
var container = document.getElementById(
"visual-console-container-" + settings.cellId
);
@ -1307,36 +1305,36 @@ function dashboardLoadVC(settings) {
var beforeUpdate = function(items, visualConsole, props, size) {
var ratio_visualconsole = props.height / props.width;
var ratio_w = size.width / props.width;
var ratio_h = size.height / props.height;
var acum_height = props.height;
var acum_width = props.width;
props.width = size.width;
props.height = size.width * ratio_visualconsole;
var ratio = ratio_w;
if (settings.mobile != undefined && settings.mobile === true) {
if (props.height < props.width) {
if (props.height > size.height) {
ratio = ratio_h;
props.height = size.height;
props.width = size.height / ratio_visualconsole;
}
} else {
ratio = ratio_w;
var height = (acum_height * size.width) / acum_width;
props.height = height;
props.width = height / ratio_visualconsole;
}
var ratio_ajax = size.width / props.width;
// 1.- Pantalla vertical:
if (size.width < size.height) {
props.width = size.width;
props.height = size.width * ratio_visualconsole;
} else {
if (props.height > size.height) {
ratio = ratio_h;
props.height = size.height;
props.width = size.height / ratio_visualconsole;
// 2.- Pantalla horizontal:
// 2.1. - Consola visual es alargada.
if (props.width < props.height) {
props.width = size.width;
props.height = size.width * ratio_visualconsole;
} else {
// 2.2. - Consola visual es estrecha.
var aspect_ratio_cv = props.width / props.height;
var aspect_ratio_screen = size.width / size.height;
// 2.2.1 - Consola visual si su aspect ratio es menor al de la pantalla ahustamos al alto.
if (aspect_ratio_cv < aspect_ratio_screen) {
ratio_ajax = size.height / props.height;
var width = props.width * (size.height / props.height);
props.width = width;
props.height = size.height;
} else {
// 2.2.2 - Consola visual si su aspect ratio es mayor al de la pantalla ahustamos al ancho.
props.width = size.width;
props.height = size.width * ratio_visualconsole;
}
}
}
props.ratio = ratio_ajax;
$.ajax({
method: "post",
url: settings.baseUrl + "ajax.php",
@ -1355,6 +1353,8 @@ function dashboardLoadVC(settings) {
// Add the datetime when the item was received.
items.map(function(item) {
item["receivedAt"] = receivedAt;
item["cellId"] = settings.cellId;
item["ratio"] = ratio_ajax;
return item;
});
@ -1383,21 +1383,18 @@ function dashboardLoadVC(settings) {
var regex_hash = /(hash=)[^&]+(&?)/gi;
var replacement_hash = "$1" + props.hash + "$2";
/*
var regex_width = /(width=)[^&]+(&?)/gi;
var replacement_width = "$1" + size.width + "$2";
var regex_height = /(height=)[^&]+(&?)/gi;
var replacement_height =
"$1" + (size.height + headerMobileFix) + "$2";
*/
var replacement_height = "$1" + size.height + "$2";
// Change the URL (if the browser has support).
if ("history" in window) {
var href = window.location.href.replace(regex, replacement);
href = href.replace(regex_hash, replacement_hash);
//href = href.replace(regex_width, replacement_width);
//href = href.replace(regex_height, replacement_height);
href = href.replace(regex_width, replacement_width);
href = href.replace(regex_height, replacement_height);
window.history.replaceState({}, document.title, href);
}
@ -1436,6 +1433,12 @@ function dashboardLoadVC(settings) {
return item;
});
var ratio = settings.ratio;
settings.items.map(function(item) {
item["ratio"] = ratio;
return item;
});
var visualConsoleManager = createVisualConsole(
container,
settings.props,
@ -1457,9 +1460,7 @@ function dashboardLoadVC(settings) {
}
if (settings.mobile_view_orientation_vc === true) {
$(window).on("orientationchange", function() {
$(container).width($(window).height());
$(container).height($(window).width() - headerMobileFix);
$(window).on("orientationchange", function(event) {
//Remove spinner change VC.
container.classList.remove("is-updating");
container.classList.remove("cv-overflow");
@ -1484,9 +1485,33 @@ function dashboardLoadVC(settings) {
divParent.appendChild(divSpinner);
container.appendChild(divParent);
let width = 0;
let height = 0;
let isMobile = true;
// If it is detected that it is a real mobile not the web inspector
// deducts 45 more for the header and footer of the mobile.
const fixHeader = 45;
if (navigator && navigator.userAgentData != null) {
isMobile = navigator.userAgentData.mobile;
}
if (event.target.screen.orientation.angle === 0) {
width = $(window).height();
if (isMobile) {
width += fixHeader;
}
height = $(window).width();
} else {
width = $(window).height();
height = $(window).width() - fixHeader;
if (isMobile) {
height -= fixHeader;
}
}
var dimensions = {
width: $(window).height(),
height: $(window).width() - 40
width: width,
height: height
};
visualConsoleManager.changeDimensionsVc(dimensions, interval);

View File

@ -1497,7 +1497,11 @@ function show_dialog(dialog) {
$(document).ajaxSend(function(event, jqXHR, ajaxOptions) {
const requestBody = ajaxOptions.data;
try {
if (requestBody && requestBody.includes("drawConsoleSound=1")) {
if (
requestBody &&
typeof requestBody.includes === "function" &&
requestBody.includes("drawConsoleSound=1")
) {
console.log(
"AJAX request sent with drawConsoleSound=1:",
ajaxOptions.url
@ -1659,7 +1663,11 @@ $(document).ajaxSend(function(event, jqXHR, ajaxOptions) {
$(document).ajaxSend(function(event, jqXHR, ajaxOptions) {
const requestBody = ajaxOptions.data;
try {
if (requestBody && requestBody.includes("drawConsoleSound=1")) {
if (
requestBody &&
typeof requestBody.includes === "function" &&
requestBody.includes("drawConsoleSound=1")
) {
console.log(
"AJAX request sent with drawConsoleSound=1:",
ajaxOptions.url

Some files were not shown because too many files have changed in this diff Show More