#12132 Fix conflict
|
@ -1 +1 @@
|
|||
To create the .deb and .rpm package need to hace docker installed on main system and execit `build_all_docker.sh`
|
||||
To create the .deb and .rpm package need to hace docker installed on main system and execit `build_all_docker.sh`
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, AIX version
|
||||
# Version 7.0NG.774, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, FreeBSD Version
|
||||
# Version 7.0NG.774, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, HP-UX Version
|
||||
# Version 7.0NG.774, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Version 7.0NG.774, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -300,3 +300,7 @@ module_plugin grep_log /var/log/syslog Syslog ssh
|
|||
#module_exec echo 5
|
||||
#module_description Postcondition test module
|
||||
#module_end
|
||||
|
||||
# This plugin runs several security checks in a Linux system
|
||||
|
||||
#module_plugin pandora_security_check
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Version 7.0NG.774, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, Solaris Version
|
||||
# Version 7.0NG.774, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2023 Pandora FMS
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -54,7 +54,6 @@ if (!$@) {
|
|||
|
||||
use constant AGENT_VERSION => '4.0.1';
|
||||
use constant AGENT_BUILD => '111213';
|
||||
|
||||
# Commands to retrieve total memory information in kB
|
||||
use constant TOTALMEMORY_CMDS => {
|
||||
linux => 'cat /proc/meminfo | grep MemTotal: | awk \'{ print $2 }\'',
|
||||
|
@ -117,7 +116,6 @@ my $ConfDir = '';
|
|||
|
||||
# Pandora FMS agent configuration file
|
||||
my $ConfFile = 'pandora_agent.conf';
|
||||
|
||||
# Broker agent configuration files
|
||||
my @BrokerPid;
|
||||
|
||||
|
@ -264,7 +262,6 @@ sub valid_regexp ($) {
|
|||
sub rmrf {
|
||||
my $path = shift;
|
||||
local *DIR;
|
||||
|
||||
if (-d $path) {
|
||||
opendir (DIR, $path) || return;
|
||||
while (defined (my $file_name = readdir(DIR))) {
|
||||
|
@ -348,7 +345,6 @@ sub log_message ($$;$) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Add the given directory to the PATH.
|
||||
################################################################################
|
||||
|
@ -582,7 +578,6 @@ sub write_broker_conf($){
|
|||
}
|
||||
|
||||
while (my $line = <CONF_FILE>){
|
||||
|
||||
# Skip broker definitions
|
||||
if ($line =~ m/^\s*broker_agent/) {
|
||||
next;
|
||||
|
@ -1810,7 +1805,6 @@ sub exec_plugin ($) {
|
|||
$Sem->down () if (defined ($Sem));
|
||||
$Xml .= $output;
|
||||
$Sem->up () if (defined ($Sem));
|
||||
|
||||
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
|
||||
}
|
||||
|
||||
|
@ -2287,4 +2281,4 @@ This is released under the GNU Lesser General Public License.
|
|||
|
||||
Copyright (c) 2005-2023 Pandora FMS
|
||||
|
||||
=cut
|
||||
=cut
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773.3, AIX version
|
||||
# Version 7.0NG.774, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773.3, HPUX Version
|
||||
# Version 7.0NG.774, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773.3, Solaris version
|
||||
# Version 7.0NG.774, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, AIX version
|
||||
# Version 7.0NG.774, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.773.3-231011
|
||||
Version: 7.0NG.774-231108
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.773.3-231011"
|
||||
pandora_version="7.0NG.774-231108"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.773.3"
|
||||
VERSION="7.0NG.774"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773.3" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.774" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773.3" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.774" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.773.3</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.773.3 Pandora FMS on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.773.3</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.774</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.774 Pandora FMS on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.774</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Version 7.0NG.774, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, FreeBSD Version
|
||||
# Version 7.0NG.774, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, HP-UX Version
|
||||
# Version 7.0NG.774, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3
|
||||
# Version 7.0NG.774
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2004-2023 Pandora FMS
|
||||
# https://pandorafms.com
|
||||
|
@ -313,6 +313,15 @@ module_plugin autodiscover --default
|
|||
|
||||
#Hardening plugin for security compliance analysis. Enable to use it.
|
||||
#module_begin
|
||||
#module_plugin /usr/share/pandora_agent/plugins/pandora_sca
|
||||
#module_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150
|
||||
#module_absoluteinterval 7d
|
||||
#module_end
|
||||
|
||||
# Logs extraction
|
||||
#module_begin
|
||||
#module_name Syslog
|
||||
#module_description Logs extraction module
|
||||
#module_type log
|
||||
#module_regexp /var/log/logfile.log
|
||||
#module_pattern .*
|
||||
#module_end
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Version 7.0NG.774, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, NetBSD Version
|
||||
# Version 7.0NG.774, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773.3, Solaris Version
|
||||
# Version 7.0NG.774, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -39,6 +39,14 @@ BEGIN {
|
|||
|
||||
use File::Copy;
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use File::Basename;
|
||||
|
||||
BEGIN {
|
||||
eval {
|
||||
require MIME::Base64;
|
||||
};
|
||||
}
|
||||
|
||||
BEGIN { push @INC, '/usr/lib/perl5'; }
|
||||
|
||||
################################################################################
|
||||
|
@ -1030,8 +1038,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.773.3';
|
||||
use constant AGENT_BUILD => '231011';
|
||||
use constant AGENT_VERSION => '7.0NG.774';
|
||||
use constant AGENT_BUILD => '231108';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -1562,6 +1570,9 @@ sub parse_conf_modules($) {
|
|||
} elsif ($line =~ /^\s*module_occupiedpercentdisk\s+(.*)$/) {
|
||||
$module->{'func'} = \&module_occupiedpercentdisk;
|
||||
$module->{'params'} = $1;
|
||||
}elsif ($line =~ /^\s*module_regexp\s+(.*)$/) {
|
||||
$module->{'func'} = \&module_logger;
|
||||
$module->{'params'} = $1;
|
||||
} elsif ($line =~ /^\s*module_max\s+(.*)\s*$/) {
|
||||
$module->{'max'} = $1;
|
||||
} elsif ($line =~ /^\s*module_min\s+(.*)\s*$/) {
|
||||
|
@ -1817,7 +1828,11 @@ sub parse_conf_modules($) {
|
|||
# Macros
|
||||
} elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) {
|
||||
$module->{'macros'}{$1} = $2;
|
||||
# Regexp
|
||||
}
|
||||
elsif ($line =~ /^\s*module_pattern(\S+)\s+(.*)\s*$/) {
|
||||
$module->{'filter'} = $1;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -3663,6 +3678,11 @@ sub write_module_xml ($@) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($module->{'func'} == \&module_logger) {
|
||||
$Xml .= $data[0];
|
||||
return
|
||||
}
|
||||
|
||||
# Critical section
|
||||
$Sem->down () if (defined ($Sem));
|
||||
|
||||
|
@ -3860,6 +3880,237 @@ sub module_plugin ($) {
|
|||
return ($output);
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Read the logs
|
||||
################################################################################
|
||||
sub module_logger ($) {
|
||||
my $module = shift;
|
||||
|
||||
my $status = grep_logs(
|
||||
$module->{'name'},
|
||||
$module->{'params'},
|
||||
$module->{'filter'}
|
||||
);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub {
|
||||
my ($str, $endl) = @_;
|
||||
|
||||
my @ALPHABET = ('A'..'Z', 'a'..'z', 0..9, '+', '/');
|
||||
my $str_len = length($str);
|
||||
my $str_base64 = '';
|
||||
|
||||
for (my $i = 0; $i < $str_len; $i += 3) {
|
||||
my $chunk = substr($str, $i, 3);
|
||||
my $chunk_len = length($chunk);
|
||||
|
||||
my $num = 0;
|
||||
$num |= ord(substr($chunk, 0, 1)) << 16 if ($chunk_len >= 1);
|
||||
$num |= ord(substr($chunk, 1, 1)) << 8 if ($chunk_len >= 2);
|
||||
$num |= ord(substr($chunk, 2, 1)) if ($chunk_len == 3);
|
||||
|
||||
my $enc_1 = ($num & 0xfc0000) >> 18;
|
||||
my $enc_2 = ($num & 0x03f000) >> 12;
|
||||
my $enc_3 = ($num & 0x000fc0) >> 6;
|
||||
my $enc_4 = ($num & 0x00003f);
|
||||
|
||||
$str_base64 .= $ALPHABET[$enc_1];
|
||||
$str_base64 .= $ALPHABET[$enc_2];
|
||||
$str_base64 .= $chunk_len >= 2 ? $ALPHABET[$enc_3] : '=';
|
||||
$str_base64 .= $chunk_len == 3 ? $ALPHABET[$enc_4] : '=';
|
||||
}
|
||||
|
||||
return $str_base64;
|
||||
};
|
||||
|
||||
sub grep_logs {
|
||||
my ($str_name, $str_file, $str_regex) = @_;
|
||||
|
||||
if(!$str_name){
|
||||
log_message("module_logger", "Missing module name");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$str_file){
|
||||
log_message("module_logger", "Missing file name");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$str_regex){
|
||||
$str_regex = '.*';
|
||||
}
|
||||
|
||||
my $idx_dir = '/tmp/';
|
||||
my $idx_file = '';
|
||||
my $idx_pos = 0;
|
||||
my $idx_size = 0;
|
||||
my $idx_ino = '';
|
||||
my $module_name = $str_name;
|
||||
my $log_file = $str_file;
|
||||
my $reg_exp = $str_regex;
|
||||
|
||||
# Check that log file exists
|
||||
if (! -e $log_file) {
|
||||
log_message("module_logger", "File $log_file does not exist");
|
||||
return;
|
||||
}
|
||||
|
||||
# Create index file storage directory
|
||||
if (! -d $idx_dir) {
|
||||
if (!mkdir($idx_dir)){
|
||||
log_message("module_logger", "Error creating directory $idx_dir: " . $!);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# Create index file if it does not exist
|
||||
$idx_file = $idx_dir.$module_name."_".basename($log_file).".idx";
|
||||
if (! -e $idx_file) {
|
||||
return if create_idx(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$idx_size) == 1;
|
||||
return
|
||||
} else{
|
||||
|
||||
return if load_idx(\$idx_pos, \$idx_ino, \$idx_file, \$idx_size) == 1;
|
||||
my @data = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp, \$idx_size);
|
||||
|
||||
my $output = create_log($module_name, @data);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
# Start the function definition
|
||||
|
||||
sub create_idx {
|
||||
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $idx_size_ref) = @_;
|
||||
my $first_line;
|
||||
|
||||
log_message("module_logger", "Creating index file $$idx_file_ref");
|
||||
|
||||
if (!open(LOGFILE, $$log_file_ref)){
|
||||
log_message("module_logger", "Error opening file $$log_file_ref: ".$!);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Go to EOF and save the position
|
||||
seek(LOGFILE, 0, 2);
|
||||
$$idx_pos_ref = tell(LOGFILE);
|
||||
|
||||
close(LOGFILE);
|
||||
|
||||
# Save the file inode number
|
||||
$$idx_ino_ref = (stat($$log_file_ref))[1];
|
||||
|
||||
return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub save_idx {
|
||||
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_;
|
||||
|
||||
log_message("module_logger", "Saving index file $$idx_file_ref");
|
||||
|
||||
if (!open(IDXFILE, "> $$idx_file_ref")){
|
||||
log_message("module_logger", "Error opening file $$idx_file_ref: ". $!);
|
||||
return 1;
|
||||
}
|
||||
|
||||
print (IDXFILE $$idx_pos_ref . " " . $$idx_ino_ref . " " . $$idx_size_ref);
|
||||
close(IDXFILE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub load_idx {
|
||||
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_;
|
||||
my $line;
|
||||
my $current_ino;
|
||||
my $current_size;
|
||||
|
||||
log_message("module_logger", "Loading index file $$idx_file_ref");
|
||||
|
||||
if (!open(IDXFILE, $$idx_file_ref)){
|
||||
log_message("module_logger", "Error opening file $$idx_file_ref: " .$!);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Read position and date
|
||||
$line = <IDXFILE>;
|
||||
($$idx_pos_ref, $$idx_ino_ref, $$idx_size_ref) = split(' ', $line);
|
||||
|
||||
close(IDXFILE);
|
||||
|
||||
# Reset the file index if the file has changed
|
||||
$current_ino = (stat($$idx_file_ref))[1];
|
||||
$current_size = -s "$$idx_file_ref";
|
||||
if ($current_ino != $$idx_ino_ref || $current_size < $$idx_size_ref) {
|
||||
log_message("module_logger", "File changed, resetting index");
|
||||
|
||||
$$idx_pos_ref = 0;
|
||||
$$idx_ino_ref = $current_ino;
|
||||
}
|
||||
$$idx_size_ref = $current_size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub parse_log {
|
||||
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $module_name_ref, $reg_exp_ref, $idx_size_ref) = @_;
|
||||
|
||||
my $line;
|
||||
|
||||
log_message("module_logger", "Parsing log file $$log_file_ref");
|
||||
|
||||
# Open log file for reading
|
||||
if (!open(LOGFILE, $$log_file_ref)){
|
||||
log_message("module_logger", "Error opening file $$log_file_ref: " . $!);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Go to starting position.
|
||||
seek(LOGFILE, $$idx_pos_ref, 0);
|
||||
|
||||
# Parse log file
|
||||
my @data;
|
||||
while ($line = <LOGFILE>) {
|
||||
if ($line =~ m/$$reg_exp_ref/i) {
|
||||
push (@data, $line);
|
||||
}
|
||||
}
|
||||
|
||||
$$idx_pos_ref = tell(LOGFILE);
|
||||
close(LOGFILE);
|
||||
|
||||
# Save the index file
|
||||
return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1;
|
||||
|
||||
return @data;
|
||||
}
|
||||
|
||||
sub create_log {
|
||||
my ($module_name, @data) = @_;
|
||||
|
||||
# No data
|
||||
if ($#data < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Log module
|
||||
my $output = "<log_module>\n";
|
||||
$output .= "<source><![CDATA[" . $module_name . "]]></source>\n";
|
||||
$output .= "<encoding>base64</encoding>\n";
|
||||
$output .= "<data><![CDATA[";
|
||||
$output .= &$encode_sub(join('', @data), '');
|
||||
$output .= "]]></data>\n";
|
||||
$output .= "</log_module>\n";
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# TERM Handler
|
||||
################################################################################
|
||||
|
@ -4030,6 +4281,8 @@ sub init_module ($) {
|
|||
$module->{'module_ff_interval'} = undef;
|
||||
$module->{'macros'} = {};
|
||||
$module->{'alert_template'} = undef;
|
||||
$module->{'filter'} = undef;
|
||||
$module->{'absoluteinterval'} = undef;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231011
|
||||
%define version 7.0NG.774
|
||||
%define release 231108
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230919
|
||||
%define version 7.0NG.774
|
||||
%define release 231108
|
||||
%define debug_package %{nil}
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
|
|
|
@ -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 230919
|
||||
%define version 7.0NG.774
|
||||
%define release 231108
|
||||
%define debug_package %{nil}
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
|
|
|
@ -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 231011
|
||||
%define version 7.0NG.774
|
||||
%define release 231108
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 231011
|
||||
%define version 7.0NG.774
|
||||
%define release 231108
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773.3"
|
||||
PI_BUILD="231011"
|
||||
PI_VERSION="7.0NG.774"
|
||||
PI_BUILD="231108"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -0,0 +1,631 @@
|
|||
#!/usr/bin/perl
|
||||
################################################################################
|
||||
# Author: Enrique Martin Garcia
|
||||
# Copyright: 2023, PandoraFMS
|
||||
# Maintainer: Operations department
|
||||
# Version: 1.0
|
||||
################################################################################
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Getopt::Long;
|
||||
use File::Basename;
|
||||
use File::Spec;
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
use Scalar::Util 'looks_like_number';
|
||||
use Socket;
|
||||
|
||||
# Define signal handlers
|
||||
sub sigint_handler {
|
||||
print STDERR "\nInterrupted by user\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
sub sigterm_handler {
|
||||
print STDERR "Received SIGTERM signal.\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
$SIG{INT} = \&sigint_handler;
|
||||
$SIG{TERM} = \&sigterm_handler;
|
||||
|
||||
# Add lib dir path
|
||||
my $lib_dir = File::Spec->catdir(dirname($0), 'lib');
|
||||
unshift @INC, $lib_dir;
|
||||
|
||||
###
|
||||
# GLOBALS
|
||||
##################
|
||||
|
||||
my %options = ();
|
||||
|
||||
my $modules_group = 'Security';
|
||||
|
||||
my $b_ports = 'PORTS';
|
||||
my $b_files = 'FILES';
|
||||
my $b_passwords = 'PASSWORDS';
|
||||
|
||||
my @blocks = ($b_ports, $b_files, $b_passwords);
|
||||
my $configuration_block;
|
||||
|
||||
my $integrity_file = '/tmp/' . md5_hex(File::Spec->rel2abs($0)) . '.integrity';
|
||||
|
||||
# Enable all checks by default
|
||||
my $check_selinux = 1;
|
||||
my $check_ssh_root_access = 1;
|
||||
my $check_ssh_root_keys = 1;
|
||||
my $check_ports = 1;
|
||||
my $check_files = 1;
|
||||
my $check_passwords = 1;
|
||||
|
||||
# Include all values for checks by default
|
||||
my $include_defaults = 1;
|
||||
|
||||
# Initialize check lists
|
||||
my @l_ports = (
|
||||
80,
|
||||
22
|
||||
);
|
||||
my @l_files = (
|
||||
'/etc/shadow',
|
||||
'/etc/passwd',
|
||||
'/etc/hosts',
|
||||
'/etc/resolv.conf',
|
||||
'/etc/ssh/sshd_config',
|
||||
'/etc/rsyslog.conf'
|
||||
);
|
||||
|
||||
my @l_passwords = (
|
||||
'123456',
|
||||
'12345678',
|
||||
'123456789',
|
||||
'12345',
|
||||
'1234567',
|
||||
'password',
|
||||
'1password',
|
||||
'abc123',
|
||||
'qwerty',
|
||||
'111111',
|
||||
'1234',
|
||||
'iloveyou',
|
||||
'sunshine',
|
||||
'monkey',
|
||||
'1234567890',
|
||||
'123123',
|
||||
'princess',
|
||||
'baseball',
|
||||
'dragon',
|
||||
'football',
|
||||
'shadow',
|
||||
'soccer',
|
||||
'unknown',
|
||||
'000000',
|
||||
'myspace1',
|
||||
'purple',
|
||||
'fuckyou',
|
||||
'superman',
|
||||
'Tigger',
|
||||
'buster',
|
||||
'pepper',
|
||||
'ginger',
|
||||
'qwerty123',
|
||||
'qwerty1',
|
||||
'peanut',
|
||||
'summer',
|
||||
'654321',
|
||||
'michael1',
|
||||
'cookie',
|
||||
'LinkedIn',
|
||||
'whatever',
|
||||
'mustang',
|
||||
'qwertyuiop',
|
||||
'123456a',
|
||||
'123abc',
|
||||
'letmein',
|
||||
'freedom',
|
||||
'basketball',
|
||||
'babygirl',
|
||||
'hello',
|
||||
'qwe123',
|
||||
'fuckyou1',
|
||||
'love',
|
||||
'family',
|
||||
'yellow',
|
||||
'trustno1',
|
||||
'jesus1',
|
||||
'chicken',
|
||||
'diamond',
|
||||
'scooter',
|
||||
'booboo',
|
||||
'welcome',
|
||||
'smokey',
|
||||
'cheese',
|
||||
'computer',
|
||||
'butterfly',
|
||||
'696969',
|
||||
'midnight',
|
||||
'princess1',
|
||||
'orange',
|
||||
'monkey1',
|
||||
'killer',
|
||||
'snoopy ',
|
||||
'qwerty12 ',
|
||||
'1qaz2wsx ',
|
||||
'bandit',
|
||||
'sparky',
|
||||
'666666',
|
||||
'football1',
|
||||
'master',
|
||||
'asshole',
|
||||
'batman',
|
||||
'sunshine1',
|
||||
'bubbles',
|
||||
'friends',
|
||||
'1q2w3e4r',
|
||||
'chocolate',
|
||||
'Yankees',
|
||||
'Tinkerbell',
|
||||
'iloveyou1',
|
||||
'abcd1234',
|
||||
'flower',
|
||||
'121212',
|
||||
'passw0rd',
|
||||
'pokemon',
|
||||
'StarWars',
|
||||
'iloveyou2',
|
||||
'123qwe',
|
||||
'Pussy',
|
||||
'angel1'
|
||||
);
|
||||
|
||||
###
|
||||
# ARGS PARSER
|
||||
##################
|
||||
|
||||
my $HELP = <<EO_HELP;
|
||||
Run several security checks in a Linux system
|
||||
|
||||
Usage: $0
|
||||
[-h,--help]
|
||||
[--check_selinux {0,1}]
|
||||
[--check_ssh_root_access {0,1}]
|
||||
[--check_ssh_root_keys {0,1}]
|
||||
[--check_ports {0,1}]
|
||||
[--check_files {0,1}]
|
||||
[--check_passwords {0,1}]
|
||||
[--include_defaults {0,1}]
|
||||
[--integrity_file <integrity_file>]
|
||||
[--conf <conf_file>]
|
||||
|
||||
Optional arguments:
|
||||
-h, --help Show this help message and exit
|
||||
--check_selinux {0,1} Enable/Disable check SElinux module
|
||||
--check_ssh_root_access {0,1} Enable/Disable check SSH root access module
|
||||
--check_ssh_root_keys {0,1} Enable/Disable check SSH root keys module
|
||||
--check_ports {0,1} Enable/Disable check ports module
|
||||
--check_files {0,1} Enable/Disable check files module
|
||||
--check_passwords {0,1} Enable/Disable check passwords module
|
||||
--include_defaults {0,1} Enable/Disable default plugin checks for ports, files and passwords
|
||||
--integrity_file <integrity_file> Path to integrity check file
|
||||
Default: $integrity_file
|
||||
--conf <conf_file> Path to plugin configuration file
|
||||
Available configuration blocks:
|
||||
[$b_ports], [$b_files] and [$b_passwords]
|
||||
Content example:
|
||||
[$b_ports]
|
||||
3306
|
||||
443
|
||||
[$b_files]
|
||||
/etc/httpd/httpd.conf
|
||||
/etc/my.cnf
|
||||
[$b_passwords]
|
||||
pandora
|
||||
PANDORA
|
||||
P4nd0r4
|
||||
|
||||
EO_HELP
|
||||
|
||||
sub help {
|
||||
my ($extra_message) = @_;
|
||||
print $HELP;
|
||||
print $extra_message if defined($extra_message);
|
||||
exit 0;
|
||||
}
|
||||
|
||||
sub parse_bool_arg {
|
||||
my ($arg, $default) = @_;
|
||||
|
||||
if (defined $options{$arg}) {
|
||||
if (looks_like_number($options{$arg}) && ($options{$arg} == 1 || $options{$arg} == 0)) {
|
||||
return $options{$arg};
|
||||
} else {
|
||||
help("Invalid value for argument: $arg\n");
|
||||
}
|
||||
} else {
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
||||
# Parse arguments
|
||||
GetOptions(
|
||||
"help|h" => \$options{help},
|
||||
"check_selinux=s" => \$options{check_selinux},
|
||||
"check_ssh_root_access=s" => \$options{check_ssh_root_access},
|
||||
"check_ssh_root_keys=s" => \$options{check_ssh_root_keys},
|
||||
"check_ports=s" => \$options{check_ports},
|
||||
"check_files=s" => \$options{check_files},
|
||||
"check_passwords=s" => \$options{check_passwords},
|
||||
"include_defaults=s" => \$options{include_defaults},
|
||||
"integrity_file=s" => \$options{integrity_file},
|
||||
"conf=s" => \$options{conf}
|
||||
);
|
||||
|
||||
help() if ($options{help});
|
||||
|
||||
$check_selinux = parse_bool_arg('check_selinux', $check_selinux);
|
||||
$check_ssh_root_access = parse_bool_arg('check_ssh_root_access', $check_ssh_root_access);
|
||||
$check_ssh_root_keys = parse_bool_arg('check_ssh_root_keys', $check_ssh_root_keys);
|
||||
$check_ports = parse_bool_arg('check_ports', $check_ports);
|
||||
$check_files = parse_bool_arg('check_files', $check_files);
|
||||
$check_passwords = parse_bool_arg('check_passwords', $check_passwords);
|
||||
|
||||
$include_defaults = parse_bool_arg('include_defaults', $include_defaults);
|
||||
|
||||
if (!$include_defaults) {
|
||||
@l_ports = ();
|
||||
@l_files = ();
|
||||
@l_passwords = ();
|
||||
}
|
||||
|
||||
$integrity_file = $options{integrity_file} if defined $options{integrity_file};
|
||||
|
||||
parse_configuration($options{conf}) if defined $options{conf};
|
||||
|
||||
###
|
||||
# FUNCTIONS
|
||||
##################
|
||||
|
||||
# Function to parse configuration file
|
||||
sub parse_configuration {
|
||||
my ($conf_file) = @_;
|
||||
|
||||
open my $conf_fh, '<', $conf_file or die "Error opening configuration file [$conf_file]: $!\n";
|
||||
|
||||
while (my $line = <$conf_fh>) {
|
||||
chomp $line;
|
||||
$line =~ s/^\s+//;
|
||||
$line =~ s/\s+$//;
|
||||
|
||||
if ($line =~ /^\[($b_ports|$b_files|$b_passwords)\]$/) {
|
||||
$configuration_block = $1;
|
||||
}
|
||||
elsif ($configuration_block) {
|
||||
if ($configuration_block eq $b_ports) {
|
||||
push @l_ports, $line;
|
||||
}
|
||||
elsif ($configuration_block eq $b_files) {
|
||||
push @l_files, $line;
|
||||
}
|
||||
elsif ($configuration_block eq $b_passwords) {
|
||||
push @l_passwords, $line;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close $conf_fh;
|
||||
}
|
||||
|
||||
# Function to print module XML to STDOUT
|
||||
sub print_xml_module {
|
||||
my ($m_name, $m_type, $m_desc, $m_value) = @_;
|
||||
|
||||
print "<module>\n";
|
||||
print "\t<name><![CDATA[$m_name]]></name>\n";
|
||||
print "\t<type>$m_type</type>\n";
|
||||
print "\t<data><![CDATA[$m_value]]></data>\n";
|
||||
print "\t<description><![CDATA[$m_desc]]></description>\n";
|
||||
print "\t<module_group>$modules_group</module_group>\n";
|
||||
print "</module>\n";
|
||||
}
|
||||
|
||||
# Make unique array
|
||||
sub uniq {
|
||||
my %seen;
|
||||
return grep { !$seen{$_}++ } @_;
|
||||
}
|
||||
|
||||
###
|
||||
# MAIN
|
||||
##################
|
||||
|
||||
# Check SELinux status
|
||||
if ($check_selinux) {
|
||||
my $value = 0;
|
||||
my $desc = 'SELinux is disabled.';
|
||||
|
||||
my $output = `sestatus 2> /dev/null`;
|
||||
if ($? == 0) {
|
||||
if ($output =~ /SELinux status: enabled/) {
|
||||
$value = 1;
|
||||
$desc = 'SELinux is enabled.';
|
||||
}
|
||||
} else {
|
||||
$value = 0;
|
||||
$desc = 'Can not determine if SELinux is enabled.';
|
||||
}
|
||||
|
||||
print_xml_module('SELinux status', 'generic_proc', $desc, $value);
|
||||
}
|
||||
|
||||
# Check if SSH allows root access
|
||||
if ($check_ssh_root_access) {
|
||||
my $value = 1;
|
||||
my $desc = 'SSH does not allow root access.';
|
||||
|
||||
my $ssh_config_file = '/etc/ssh/sshd_config';
|
||||
if (-e $ssh_config_file && open my $ssh_fh, '<', $ssh_config_file) {
|
||||
while (my $line = <$ssh_fh>) {
|
||||
chomp $line;
|
||||
$line =~ s/^\s+//;
|
||||
$line =~ s/\s+$//;
|
||||
next if $line =~ /^$/ or $line =~ /^#/;
|
||||
my ($option, $val) = split /\s+/, $line, 2;
|
||||
if ($option eq 'PermitRootLogin' && lc($val) ne 'no') {
|
||||
$value = 0;
|
||||
$desc = 'SSH config allows root access.';
|
||||
last;
|
||||
}
|
||||
}
|
||||
close $ssh_fh;
|
||||
} else {
|
||||
$value = 0;
|
||||
$desc = 'Can not read '.$ssh_config_file.' to check if root access allowed.';
|
||||
}
|
||||
|
||||
print_xml_module('SSH root access status', 'generic_proc', $desc, $value);
|
||||
}
|
||||
|
||||
# Specific function for recursive directory check
|
||||
sub find_files {
|
||||
my ($dir) = @_;
|
||||
|
||||
my @files = ();
|
||||
|
||||
opendir my $dh, $dir or return;
|
||||
while (my $file = readdir $dh) {
|
||||
next if $file eq '.' or $file eq '..';
|
||||
|
||||
my $file_path = File::Spec->catfile($dir, $file);
|
||||
if (-f $file_path) {
|
||||
push @files, $file_path;
|
||||
} elsif (-d $file_path) {
|
||||
push @files, find_files($file_path);
|
||||
}
|
||||
}
|
||||
closedir $dh;
|
||||
|
||||
return @files;
|
||||
}
|
||||
|
||||
# Check if /root has SSH keys
|
||||
if ($check_ssh_root_keys) {
|
||||
my $value = 1;
|
||||
my $desc = 'SSH root keys not found.';
|
||||
|
||||
my $ssh_keys = {'private' => [], 'public' => []};
|
||||
|
||||
my $ssh_dir = '/root/.ssh';
|
||||
my @all_files = find_files($ssh_dir);
|
||||
foreach my $file (@all_files) {
|
||||
if (open my $fh, '<:raw', $file) {
|
||||
my $content = '';
|
||||
while(my $l = <$fh>) {
|
||||
$content .= $l;
|
||||
}
|
||||
if ($content) {
|
||||
my ($filename, $directories) = fileparse($file);
|
||||
if ($content =~ /-----BEGIN RSA PRIVATE KEY-----.*?-----END RSA PRIVATE KEY-----/s) {
|
||||
push @{$ssh_keys->{'private'}}, $file;
|
||||
} elsif ($content =~ /ssh-rsa/ && $filename ne 'known_hosts' && $filename ne 'authorized_keys') {
|
||||
push @{$ssh_keys->{'public'}}, $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (@{$ssh_keys->{'private'}} > 0 || @{$ssh_keys->{'public'}} > 0) {
|
||||
$value = 0;
|
||||
$desc = "SSH root keys found:\n" . join("\n", @{$ssh_keys->{'private'}}, @{$ssh_keys->{'public'}});
|
||||
}
|
||||
|
||||
print_xml_module('SSH root keys status', 'generic_proc', $desc, $value);
|
||||
}
|
||||
|
||||
# Check authorized ports
|
||||
if ($check_ports) {
|
||||
my $value = 1;
|
||||
my $desc = 'No unauthorized ports found.';
|
||||
|
||||
my @open_ports;
|
||||
my @not_allowed_ports;
|
||||
|
||||
my @net_tcp_files = ('/proc/net/tcp', '/proc/net/tcp6');
|
||||
foreach my $net_tcp_file (@net_tcp_files) {
|
||||
if (-e $net_tcp_file && open my $tcp_fh, '<', $net_tcp_file) {
|
||||
while (my $line = <$tcp_fh>) {
|
||||
chomp $line;
|
||||
my @parts = split /\s+/, $line;
|
||||
if (scalar @parts >= 12) {
|
||||
my $local_addr_hex = (split /:/, $parts[2])[0];
|
||||
my $local_port_hex = (split /:/, $parts[2])[1];
|
||||
my $state = $parts[4];
|
||||
|
||||
# Check if the connection is in state 0A (listening)
|
||||
if ($state eq "0A") {
|
||||
my $local_addr_4 = join('.', reverse split(/\./, inet_ntoa(pack("N", hex($local_addr_hex)))));
|
||||
my $local_addr_6 = join(':', map { hex($_) } unpack("(A4)*", $local_addr_hex));
|
||||
|
||||
# Skip localhost listening ports
|
||||
if ($local_addr_4 eq "127.0.0.1" || $local_addr_6 eq "0:0:0:0:0:0:0:1") {
|
||||
next;
|
||||
}
|
||||
|
||||
my $local_port = hex($local_port_hex);
|
||||
push @open_ports, $local_port;
|
||||
}
|
||||
}
|
||||
}
|
||||
close $tcp_fh;
|
||||
}
|
||||
}
|
||||
@open_ports = uniq(@open_ports);
|
||||
|
||||
my %allowed_ports;
|
||||
foreach my $port (@l_ports) {
|
||||
$allowed_ports{$port} = 1;
|
||||
}
|
||||
|
||||
foreach my $port (@open_ports) {
|
||||
if (!exists $allowed_ports{$port}) {
|
||||
push @not_allowed_ports, $port;
|
||||
}
|
||||
}
|
||||
|
||||
if (@not_allowed_ports) {
|
||||
$value = 0;
|
||||
$desc = "Unauthorized ports found:\n" . join("\n", @not_allowed_ports);
|
||||
}
|
||||
|
||||
print_xml_module('Authorized ports status', 'generic_proc', $desc, $value);
|
||||
}
|
||||
|
||||
# Check files integrity
|
||||
if ($check_files) {
|
||||
my $value = 1;
|
||||
my $desc = 'No changed files found.';
|
||||
|
||||
my %integrity;
|
||||
|
||||
my $can_check_files = 0;
|
||||
|
||||
if (-e $integrity_file) {
|
||||
if (-r $integrity_file && -w $integrity_file) {
|
||||
# Read integrity file content
|
||||
open my $integrity_fh, '<', $integrity_file;
|
||||
while (my $line = <$integrity_fh>) {
|
||||
chomp $line;
|
||||
if ($line =~ /^\s*(.*?)=(.*?)\s*$/) {
|
||||
$integrity{$1} = $2;
|
||||
}
|
||||
}
|
||||
close $integrity_fh;
|
||||
$can_check_files = 1;
|
||||
} else {
|
||||
$value = 0;
|
||||
$desc = 'Integrity check file can not be read or written: ' . $integrity_file;
|
||||
}
|
||||
} else {
|
||||
if (open my $integrity_fh, '>', $integrity_file) {
|
||||
close $integrity_fh;
|
||||
$can_check_files = 1;
|
||||
} else {
|
||||
$value = 0;
|
||||
$desc = 'Integrity check file can not be created: ' . $integrity_file;
|
||||
}
|
||||
}
|
||||
|
||||
if ($can_check_files) {
|
||||
# Check each file integrity
|
||||
my @errored_files;
|
||||
my @no_integrity_files;
|
||||
|
||||
# Create unique check files list
|
||||
@l_files = uniq(@l_files);
|
||||
|
||||
foreach my $file (@l_files) {
|
||||
my $file_key = md5_hex($file);
|
||||
if (open my $fh, '<:raw', $file) {
|
||||
my $md5 = Digest::MD5->new;
|
||||
$md5->addfile($fh);
|
||||
my $file_md5 = $md5->hexdigest;
|
||||
chomp $file_md5;
|
||||
close $fh;
|
||||
|
||||
if (exists $integrity{$file_key} && $integrity{$file_key} ne $file_md5) {
|
||||
push @no_integrity_files, $file;
|
||||
}
|
||||
$integrity{$file_key} = $file_md5;
|
||||
} else {
|
||||
push @errored_files, $file;
|
||||
}
|
||||
}
|
||||
|
||||
# Overwrite integrity file content
|
||||
open my $file_handle, '>', $integrity_file;
|
||||
print $file_handle map { "$_=$integrity{$_}\n" } keys %integrity;
|
||||
close $file_handle;
|
||||
|
||||
# Check module status
|
||||
if (@no_integrity_files) {
|
||||
$value = 0;
|
||||
$desc = "Changed files found:\n" . join("\n", @no_integrity_files);
|
||||
}
|
||||
|
||||
if (@errored_files) {
|
||||
$value = 0;
|
||||
$desc .= "\nUnable to check integrity of some files:\n" . join("\n", @errored_files);
|
||||
}
|
||||
}
|
||||
|
||||
print_xml_module('Files check status', 'generic_proc', $desc, $value);
|
||||
}
|
||||
|
||||
# Check weak passwords
|
||||
if ($check_passwords) {
|
||||
my $value = 1;
|
||||
my $desc = 'No insecure passwords found.';
|
||||
|
||||
# Create unique check passwords list
|
||||
@l_passwords = uniq(@l_passwords);
|
||||
|
||||
my @insecure_users;
|
||||
|
||||
my $shadow_file = '/etc/shadow';
|
||||
if (-e $shadow_file && -r $shadow_file) {
|
||||
open my $shadow_fh, '<', $shadow_file;
|
||||
while (my $line = <$shadow_fh>) {
|
||||
chomp $line;
|
||||
my ($username, $password_hash, @rest) = split /:/, $line;
|
||||
|
||||
# Skip users with no password hash
|
||||
if ($password_hash ne "*" && $password_hash ne "!!" && $password_hash ne "!locked") {
|
||||
my $salt = substr($password_hash, 0, rindex($password_hash, '$') + 1);
|
||||
my $user_hash = crypt($username, $salt);
|
||||
if ($user_hash eq $password_hash) {
|
||||
push @insecure_users, $username;
|
||||
} else {
|
||||
foreach my $weak_password (@l_passwords) {
|
||||
my $weak_password_hash = crypt($weak_password, $salt);
|
||||
|
||||
if ($weak_password_hash eq $password_hash) {
|
||||
push @insecure_users, $username;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
close $shadow_fh;
|
||||
} else {
|
||||
$value = 0;
|
||||
$desc = 'Can not read '.$shadow_file.' to check passwords.';
|
||||
}
|
||||
|
||||
if (@insecure_users) {
|
||||
$value = 0;
|
||||
$desc = "Users with insecure passwords found:\n" . join("\n", @insecure_users);
|
||||
}
|
||||
|
||||
print_xml_module('Insecure passwords status', 'generic_proc', $desc, $value);
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:db207ef67053764be7e9b42cd04ea5509cc2a023548aab1c037745ca277b68a3
|
||||
size 4858753
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6d93bd9d56c938063045fa2093198d324746f84df2b74567648f3baebd635657
|
||||
size 5248006
|
|
@ -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
|
||||
{231011}
|
||||
{231108}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.773.3 Build 231011")
|
||||
#define PANDORA_VERSION ("7.0NG.774 Build 231108")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Pandora FMS"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.773.3(Build 231011))"
|
||||
VALUE "ProductVersion", "(7.0NG.774(Build 231108))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.773.3-231011
|
||||
Version: 7.0NG.774-231108
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.773.3-231011"
|
||||
pandora_version="7.0NG.774-231108"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -192,7 +192,7 @@ function quickShell()
|
|||
'name' => 'form-sent',
|
||||
'value' => true,
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
],
|
||||
false,
|
||||
|
@ -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);
|
||||
|
@ -292,7 +294,6 @@ function quickShellSettings()
|
|||
ui_require_css_file('discovery');
|
||||
|
||||
// Gotty settings. Internal communication (WS).
|
||||
|
||||
if (isset($config['gotty_ssh_enabled']) === false) {
|
||||
config_update_value('gotty_ssh_enabled', 1);
|
||||
}
|
||||
|
@ -542,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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
pandorafms.vmware=459175dce8ab811e874ce2e7216f0db4
|
||||
pandorafms.vmware=9959cc3e5cc6bfcfadd6d05b56d4a11b
|
||||
pandorafms.mysql=fadb4750d18285c0eca34f47c6aa3cfe
|
||||
pandorafms.mssql=1cc215409741d19080269ffba112810e
|
||||
pandorafms.oracle=2d9320a514d1e48a0b2804e1653c31c6
|
||||
|
|
|
@ -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'),
|
||||
|
@ -218,5 +313,139 @@ ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT
|
|||
ALTER TABLE `treport_content` ADD COLUMN `status_of_check` TINYTEXT;
|
||||
|
||||
ALTER TABLE `tservice` ADD COLUMN `enable_horizontal_tree` TINYINT NOT NULL DEFAULT 0;
|
||||
INSERT INTO tmodule_group (name) SELECT ('Security') WHERE NOT EXISTS (SELECT name FROM tmodule_group WHERE LOWER(name) = 'security');
|
||||
|
||||
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 plugin for security compliance 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 plugin for security compliance 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 Google chat';
|
||||
SET @action_name = 'Pandora Google chat';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-gchat-cli -u "_field1_" -d "_field2_" -t "_field3_" -D "_field4_"', 'Send messages using Google chat API', 0, '["Google chat webhook URL","Data in coma separate keypairs","Title","Description"]', '["","","",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "data=_data_", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "", "data=_data_", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
|
||||
|
||||
SET @command_name = 'Pandora Slack';
|
||||
SET @action_name = 'Pandora Slack';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-slack-cli -t "TOKEN" -d "_field1_" -c "_field2_" -e "_field3_" -T "_field4_" -D "_field5_"', 'Send messages using Slack API', 0, '["Data in coma separate keypairs","Slack channel id/name","Title emoji","Title","Description"]', '["","",":red_circle:,Red circle;:green_circle:,Green circle","",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "data=_data_", "", ":red_circle:", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", 0, 0, "data=_data_", "", ":green_circle:", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "");
|
||||
|
||||
SET @command_name = 'Pandora Telegram';
|
||||
SET @action_name = 'Pandora Telegram';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-telegram-cli -t "TOKEN" -c "_field1_" -m "_field2_"', 'Send messages using Telegram API', 0, '["Chat ID","Message"]', '["",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "");
|
||||
|
||||
SET @command_name = 'Pandora ilert';
|
||||
SET @action_name = 'Pandora ilert';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora_ilert -a "API_KEY" -t "_field1_" -k "_field2_" -T "_field3_" -d "_field4_" -A "_agentname_" -m "_module_" -p "_alert_text_severity_" -D "_data_" -C "_timestamp_"', 'Send SMS using ilert API: https://docs.ilert.com/integrations/pandorafms/', 0, '["Event type","Event title","Title","Description"]', '["alert,Alert;resolved,Resolved","","",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "alert", "", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "resolved", "", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
|
||||
|
||||
SET @command_name = 'Pandora Vonage';
|
||||
SET @action_name = 'Pandora Vonage';
|
||||
|
||||
-- Get command ID in case it exists
|
||||
SET @id_command = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora_vonage -a "API_KEY" -s "SECRET" -f "FROM_ALIAS" -n "_field1_" -m "_field2_"', 'Send SMS using Vonage API: https://www.vonage.com/communications-apis/sms/', 0, '["Phone number","Message"]', '["",""]');
|
||||
|
||||
-- Get command ID again in case it has been created
|
||||
SET @id_command = NULL;
|
||||
SET @id_action = NULL;
|
||||
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
|
||||
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "");
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -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'] == '&lt;p style="text-align: center; font-size: 13px;"&gt;Hello, congratulations, if you've arrived here you already have an operational monitoring console. Remember that our forums and online documentation are available 24x7 to get you out of any trouble. You can replace this message with a personalized one at Admin tools -&amp;gt; Site news.&lt;/p&gt; ') {
|
||||
$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', '<script', $text);
|
||||
$text = str_replace('</script', '</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();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 = '';
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -571,6 +571,7 @@ if (!$maps && is_metaconsole() === false) {
|
|||
}
|
||||
|
||||
if ($maps || is_metaconsole() === true) {
|
||||
$buttons = '';
|
||||
if ($vconsoles_write || $vconsoles_manage) {
|
||||
if (is_metaconsole() === false) {
|
||||
$actionUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder';
|
||||
|
@ -578,20 +579,22 @@ if ($maps || is_metaconsole() === true) {
|
|||
$actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure='.$pure;
|
||||
}
|
||||
|
||||
echo '<form action="'.$actionUrl.'" method="post">';
|
||||
html_print_input_hidden('edit_layout', 1);
|
||||
$buttons .= '<form action="'.$actionUrl.'" method="post">';
|
||||
$buttons .= html_print_input_hidden('edit_layout', 1, true);
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'next'],
|
||||
true
|
||||
),
|
||||
[ 'right_content' => $tablePagination ]
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Create'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'next'],
|
||||
true
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
$buttons .= '</form>';
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
$buttons,
|
||||
[ 'right_content' => $tablePagination ]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1284,7 +1284,7 @@ $class = 'databox filters';
|
|||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
<?php
|
||||
html_print_input_text(
|
||||
'text_os_version',
|
||||
$text_os_version,
|
||||
|
@ -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>
|
||||
|
@ -6625,7 +6600,7 @@ function addGeneralRow() {
|
|||
function loadGeneralAgents(agent_group) {
|
||||
var params = [];
|
||||
|
||||
var group = <?php echo $group ?? -1; ?>;
|
||||
var group = <?php echo ($group ?? -1); ?>;
|
||||
if (group < 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -290,6 +290,7 @@ html_print_action_buttons(
|
|||
|
||||
echo '</form>';
|
||||
|
||||
|
||||
function get_list_os_icons_dir()
|
||||
{
|
||||
global $config;
|
||||
|
|
|
@ -98,7 +98,10 @@ try {
|
|||
'ajax_url' => 'include/ajax/os',
|
||||
'ajax_data' => ['method' => 'drawOSTable'],
|
||||
'ajax_postprocess' => 'process_datatables_item(item)',
|
||||
'no_sortable_columns' => [-1, 1],
|
||||
'no_sortable_columns' => [
|
||||
-1,
|
||||
1,
|
||||
],
|
||||
'order' => [
|
||||
'field' => 'id',
|
||||
'direction' => 'asc',
|
||||
|
|
|
@ -53,7 +53,7 @@ if ($idOS > 0) {
|
|||
} else {
|
||||
$product = io_safe_input(strip_tags(io_safe_output((string) get_parameter('product'))));
|
||||
$version = io_safe_input(strip_tags(io_safe_output((string) get_parameter('version'))));
|
||||
$end_of_life_date = get_parameter('end_of_life_date', date("Y/m/d"));
|
||||
$end_of_life_date = get_parameter('end_of_life_date', date('Y/m/d'));
|
||||
}
|
||||
|
||||
$message = '';
|
||||
|
|
|
@ -220,7 +220,7 @@ switch ($tab) {
|
|||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -282,4 +282,4 @@ if (empty($id_message) === false) {
|
|||
}
|
||||
}
|
||||
|
||||
include_once $config['homedir'].'/godmode/setup/os_version.list.php';
|
||||
require_once $config['homedir'].'/godmode/setup/os_version.list.php';
|
||||
|
|
|
@ -2129,6 +2129,15 @@ $table_other->data[$row][] = html_print_label_input_block(
|
|||
__('Data multiplier to use in graphs/data'),
|
||||
html_print_select($options_data_multiplier, 'use_data_multiplier', $config['use_data_multiplier'], '', '', 1, true, false, false)
|
||||
);
|
||||
$table_other->data[$row][] = html_print_label_input_block(
|
||||
__('Hide general stats for non admin users in tactical view'),
|
||||
html_print_checkbox_switch(
|
||||
'disable_general_statistics',
|
||||
1,
|
||||
$config['disable_general_statistics'],
|
||||
true
|
||||
)
|
||||
);
|
||||
$row++;
|
||||
|
||||
/*
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -33,8 +33,6 @@ check_login();
|
|||
|
||||
require_once $config['homedir'].'/vendor/autoload.php';
|
||||
|
||||
use PandoraFMS\Dashboard\Manager;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_profile.php';
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
require_once $config['homedir'].'/include/functions_groups.php';
|
||||
|
@ -1376,72 +1374,6 @@ if (is_metaconsole() === true) {
|
|||
);
|
||||
}
|
||||
|
||||
$values = [
|
||||
-1 => __('Use global conf'),
|
||||
1 => __('Yes'),
|
||||
0 => __('No'),
|
||||
];
|
||||
|
||||
$home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('Home screen').ui_print_help_tip(
|
||||
__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'),
|
||||
true
|
||||
).'</p>';
|
||||
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$id_usr
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
$dashboards = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($dashboards as $key => $dashboard) {
|
||||
$dashboards_aux[$dashboard['id']] = $dashboard['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$home_screen .= '<div id="show_db" style="display: none; width: 100%;">';
|
||||
$home_screen .= html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true);
|
||||
$home_screen .= '</div>';
|
||||
|
||||
$layouts = visual_map_get_user_layouts($config['id_user'], true);
|
||||
$layouts_aux = [];
|
||||
if ($layouts === false) {
|
||||
$layouts_aux = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($layouts as $layout) {
|
||||
$layouts_aux[$layout] = $layout;
|
||||
}
|
||||
}
|
||||
|
||||
$home_screen .= '<div id="show_vc" style="display: none; width: 100%;">';
|
||||
$home_screen .= html_print_select(
|
||||
$layouts_aux,
|
||||
'visual_console',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$home_screen .= '</div>';
|
||||
|
||||
$home_screen .= html_print_input_text(
|
||||
'data_section',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
60,
|
||||
255,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
$home_screen = '';
|
||||
|
||||
$size_pagination = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Block size for pagination').'</p>';
|
||||
$size_pagination .= html_print_input_text(
|
||||
'block_size',
|
||||
|
@ -2078,17 +2010,20 @@ if (is_metaconsole() === false) {
|
|||
}
|
||||
|
||||
function show_data_section() {
|
||||
var $section = $("#section").val();
|
||||
var $allElements = $('div[id^="custom_home_screen_"]');
|
||||
var $elementSelected = $('div[id="custom_home_screen_' + $section + '"]');
|
||||
var section = $("#section").val();
|
||||
if(section === 'other'){
|
||||
section = 'external_link';
|
||||
}
|
||||
var allElements = $('div[id^="custom_home_screen_"]');
|
||||
var elementSelected = $('div[id="custom_home_screen_' + section + '"]');
|
||||
// Hide all elements.
|
||||
$allElements.each(function() {
|
||||
allElements.each(function() {
|
||||
$(this).addClass('invisible');
|
||||
$(this).children().addClass('invisible');
|
||||
})
|
||||
// Show only the selected.
|
||||
$elementSelected.removeClass('invisible');
|
||||
$elementSelected.children().removeClass('invisible');
|
||||
elementSelected.removeClass('invisible');
|
||||
elementSelected.children().removeClass('invisible');
|
||||
}
|
||||
|
||||
function switch_ehorus_conf() {
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
* ============================================================================
|
||||
*/
|
||||
|
||||
use PandoraFMS\Dashboard\Manager;
|
||||
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
|
@ -45,16 +47,75 @@ $homeScreenValues = [
|
|||
HOME_SCREEN_DASHBOARD => __('Dashboard'),
|
||||
];
|
||||
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$id_usr
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
$dashboards = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($dashboards as $key => $dashboard) {
|
||||
$dashboards_aux[$dashboard['id']] = $dashboard['name'];
|
||||
}
|
||||
}
|
||||
|
||||
// Custom Home Screen controls.
|
||||
$customHomeScreenAddition = [];
|
||||
// Home screen. Dashboard.
|
||||
$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
|
||||
// Home screen. Visual consoles.
|
||||
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select($layouts_aux, 'visual_console', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
|
||||
// Home screen. External link and Other.
|
||||
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true);
|
||||
$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true);
|
||||
$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select(
|
||||
$dashboards_aux,
|
||||
'dashboard',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
);
|
||||
|
||||
$layouts = visual_map_get_user_layouts($config['id_user'], true);
|
||||
$layouts_aux = [];
|
||||
if ($layouts === false) {
|
||||
$layouts_aux = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($layouts as $layout) {
|
||||
$layouts_aux[$layout] = $layout;
|
||||
}
|
||||
}
|
||||
|
||||
// Home screen. Visual consoles.
|
||||
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select(
|
||||
$layouts_aux,
|
||||
'visual_console',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
);
|
||||
// Home screen. External link and Other.
|
||||
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text(
|
||||
'data_section',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
60,
|
||||
255,
|
||||
true
|
||||
);
|
||||
$customHomeScreenDataField = '';
|
||||
foreach ($customHomeScreenAddition as $key => $customField) {
|
||||
$customHomeScreenDataField .= html_print_div(
|
||||
|
@ -576,7 +637,7 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh
|
|||
true
|
||||
);
|
||||
|
||||
// eHorus conf
|
||||
// EHorus conf.
|
||||
if (isset($config['ehorus_user_level_conf']) === true && (bool) $config['ehorus_user_level_conf'] === true) {
|
||||
$userManagementTable->data['captions_ehorus_user_level_enabled'][1] = __('Pandora RC user access enabled');
|
||||
$userManagementTable->data['fields_ehorus_user_level_enabled'][1] = html_print_checkbox_switch(
|
||||
|
@ -791,7 +852,7 @@ $userManagementTable->data['fields_addSettings'][0] = html_print_textarea(
|
|||
5,
|
||||
65,
|
||||
$user_info['comments'],
|
||||
($view_mode ? 'readonly="readonly"' : ''),
|
||||
($view_mode) ? 'readonly="readonly"' : '',
|
||||
true,
|
||||
''
|
||||
);
|
||||
|
@ -945,15 +1006,7 @@ $(document).ready(function () {
|
|||
$('#advanced-line1_looknfeel-1 > a').css('display', 'block');
|
||||
})
|
||||
|
||||
var ehorus_user_level_enabled =
|
||||
<?php
|
||||
if (isset($user_info['ehorus_user_level_enabled']) === true) {
|
||||
echo $user_info['ehorus_user_level_enabled'];
|
||||
} else {
|
||||
echo 0;
|
||||
}
|
||||
?>
|
||||
;
|
||||
var ehorus_user_level_enabled = '<?php echo (isset($user_info['ehorus_user_level_enabled']) === true) ? $user_info['ehorus_user_level_enabled'] : 0; ?>';
|
||||
var chk_ehorus_user_level_enabled = ehorus_user_level_enabled;
|
||||
|
||||
if (ehorus_user_level_enabled == 0) {
|
||||
|
|
|
@ -1268,7 +1268,7 @@ class DiscoveryTaskList extends HTML
|
|||
|
||||
$status = db_get_value('status', 'trecon_task', 'id_rt', $id_task);
|
||||
if ($status < 0) {
|
||||
$status = 100;
|
||||
$status = '100';
|
||||
}
|
||||
|
||||
echo json_encode($status);
|
||||
|
@ -1287,7 +1287,6 @@ class DiscoveryTaskList extends HTML
|
|||
$result = '<div class="flex">';
|
||||
$result .= '<div class="subtitle">';
|
||||
$result .= '<span>'._('Overall Progress').'</span>';
|
||||
|
||||
$result .= '<div class="mrgn_top_25px">';
|
||||
$result .= progress_circular_bar(
|
||||
$task['id_rt'],
|
||||
|
@ -1973,7 +1972,6 @@ class DiscoveryTaskList extends HTML
|
|||
{
|
||||
$status = '';
|
||||
$can_be_reviewed = false;
|
||||
|
||||
if (empty($task['summary']) === false
|
||||
&& $task['summary'] == 'cancelled'
|
||||
) {
|
||||
|
@ -1991,11 +1989,9 @@ class DiscoveryTaskList extends HTML
|
|||
$status = __('Done');
|
||||
}
|
||||
} else if ($task['utimestamp'] == 0
|
||||
&& empty($task['summary'])
|
||||
&& (bool) empty($task['summary']) === true
|
||||
) {
|
||||
$status = __('Not started');
|
||||
} else if ($task['utimestamp'] > 0) {
|
||||
$status = __('Done');
|
||||
} else {
|
||||
$status = __('Pending');
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 803 B |
After Width: | Height: | Size: 1.9 KiB |
|
@ -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 |
|
@ -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 |
|
@ -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 |
|
@ -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 |
|
@ -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 |
|
@ -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 |
|
@ -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 |
|
@ -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 |
|
@ -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 |
|
@ -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 |
After Width: | Height: | Size: 487 B |
After Width: | Height: | Size: 487 B |
After Width: | Height: | Size: 487 B |
After Width: | Height: | Size: 487 B |
|
@ -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 |
|
@ -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 |
|
@ -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 |
|
@ -65,6 +65,7 @@ if (check_login()) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if ($get_custom_fields_data) {
|
||||
$name_custom_fields = get_parameter('name_custom_fields', 0);
|
||||
$array_custom_fields_data = get_custom_fields_data($name_custom_fields);
|
||||
|
@ -110,30 +111,51 @@ if (check_login()) {
|
|||
|
||||
// Table temporary for save array in table
|
||||
// by order and search custom_field data.
|
||||
$table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields (
|
||||
id_server int(10),
|
||||
id_agent int(10),
|
||||
name_custom_fields varchar(2048),
|
||||
critical_count int,
|
||||
warning_count int,
|
||||
unknown_count int,
|
||||
notinit_count int,
|
||||
normal_count int,
|
||||
total_count int,
|
||||
`status` int(2),
|
||||
KEY `data_index_temp_1` (`id_server`, `id_agent`)
|
||||
)';
|
||||
db_process_sql($table_temporary);
|
||||
if (is_metaconsole() === true) {
|
||||
$table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields (
|
||||
id_server int(10),
|
||||
id_agent int(10),
|
||||
name_custom_fields varchar(2048),
|
||||
critical_count int,
|
||||
warning_count int,
|
||||
unknown_count int,
|
||||
notinit_count int,
|
||||
normal_count int,
|
||||
total_count int,
|
||||
`status` int(2),
|
||||
KEY `data_index_temp_1` (`id_server`, `id_agent`)
|
||||
)';
|
||||
} else {
|
||||
$table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields (
|
||||
id_agent int(10),
|
||||
name_custom_fields varchar(2048),
|
||||
critical_count int,
|
||||
warning_count int,
|
||||
unknown_count int,
|
||||
notinit_count int,
|
||||
normal_count int,
|
||||
total_count int,
|
||||
`status` int(2),
|
||||
KEY `data_index_temp_1` ( `id_agent`)
|
||||
)';
|
||||
}
|
||||
|
||||
$resul_tab_temp = db_process_sql($table_temporary);
|
||||
|
||||
// Insert values array in table temporary.
|
||||
$values_insert = [];
|
||||
foreach ($indexed_descriptions as $key => $value) {
|
||||
$values_insert[] = '('.$value['id_server'].', '.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')';
|
||||
if (is_metaconsole() === true) {
|
||||
$values_insert[] = '('.$value['id_server'].', '.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')';
|
||||
} else {
|
||||
$values_insert[] = '('.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')';
|
||||
}
|
||||
}
|
||||
|
||||
$values_insert_implode = implode(',', $values_insert);
|
||||
$query_insert = 'INSERT INTO temp_custom_fields VALUES '.$values_insert_implode;
|
||||
db_process_sql($query_insert);
|
||||
|
||||
$result_temp = db_process_sql($query_insert);
|
||||
|
||||
// Search table for alias, custom field data, server_name, direction.
|
||||
$search_query = '';
|
||||
|
@ -199,41 +221,17 @@ if (check_login()) {
|
|||
}
|
||||
|
||||
// Query all fields result.
|
||||
$query = sprintf(
|
||||
'SELECT
|
||||
tma.id_agente,
|
||||
tma.id_tagente,
|
||||
tma.id_tmetaconsole_setup,
|
||||
tma.alias,
|
||||
tma.direccion,
|
||||
tma.server_name,
|
||||
temp.name_custom_fields,
|
||||
temp.status
|
||||
FROM tmetaconsole_agent tma
|
||||
INNER JOIN temp_custom_fields temp
|
||||
ON temp.id_agent = tma.id_tagente
|
||||
AND temp.id_server = tma.id_tmetaconsole_setup
|
||||
WHERE tma.disabled = 0
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
LIMIT %d OFFSET %d
|
||||
',
|
||||
$search_query,
|
||||
$status_agent_search,
|
||||
$status_module_search,
|
||||
$order_by,
|
||||
$length,
|
||||
$start
|
||||
);
|
||||
|
||||
$result = db_get_all_rows_sql($query);
|
||||
|
||||
// Query count.
|
||||
$query_count = sprintf(
|
||||
'SELECT
|
||||
COUNT(tma.id_agente) AS `count`
|
||||
if (is_metaconsole() === true) {
|
||||
$query = sprintf(
|
||||
'SELECT
|
||||
tma.id_agente,
|
||||
tma.id_tagente,
|
||||
tma.id_tmetaconsole_setup,
|
||||
tma.alias,
|
||||
tma.direccion,
|
||||
tma.server_name,
|
||||
temp.name_custom_fields,
|
||||
temp.status
|
||||
FROM tmetaconsole_agent tma
|
||||
INNER JOIN temp_custom_fields temp
|
||||
ON temp.id_agent = tma.id_tagente
|
||||
|
@ -242,16 +240,87 @@ if (check_login()) {
|
|||
%s
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
LIMIT %d OFFSET %d
|
||||
',
|
||||
$search_query,
|
||||
$status_agent_search,
|
||||
$status_module_search
|
||||
);
|
||||
$search_query,
|
||||
$status_agent_search,
|
||||
$status_module_search,
|
||||
$order_by,
|
||||
$length,
|
||||
$start
|
||||
);
|
||||
} else {
|
||||
$query = sprintf(
|
||||
'SELECT
|
||||
tma.id_agente,
|
||||
tma.alias,
|
||||
tma.direccion,
|
||||
tma.server_name,
|
||||
temp.name_custom_fields,
|
||||
temp.status
|
||||
FROM tagente as tma
|
||||
INNER JOIN temp_custom_fields temp
|
||||
ON temp.id_agent = tma.id_agente
|
||||
WHERE tma.disabled = 0
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
LIMIT %d OFFSET %d
|
||||
',
|
||||
$search_query,
|
||||
$status_agent_search,
|
||||
$status_module_search,
|
||||
$order_by,
|
||||
$length,
|
||||
$start
|
||||
);
|
||||
}
|
||||
|
||||
$result = db_get_all_rows_sql($query);
|
||||
// Query count.
|
||||
if (is_metaconsole() === true) {
|
||||
$query_count = sprintf(
|
||||
'SELECT
|
||||
COUNT(tma.id_agente) AS `count`
|
||||
FROM tmetaconsole_agent tma
|
||||
INNER JOIN temp_custom_fields temp
|
||||
ON temp.id_agent = tma.id_tagente
|
||||
AND temp.id_server = tma.id_tmetaconsole_setup
|
||||
WHERE tma.disabled = 0
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
',
|
||||
$search_query,
|
||||
$status_agent_search,
|
||||
$status_module_search
|
||||
);
|
||||
} else {
|
||||
$query_count = sprintf(
|
||||
'SELECT
|
||||
COUNT(tma.id_agente) AS `count`
|
||||
FROM tagente tma
|
||||
INNER JOIN temp_custom_fields temp
|
||||
ON temp.id_agent = tma.id_agente
|
||||
WHERE tma.disabled = 0
|
||||
%s
|
||||
%s
|
||||
%s
|
||||
',
|
||||
$search_query,
|
||||
$status_agent_search,
|
||||
$status_module_search
|
||||
);
|
||||
}
|
||||
|
||||
$count = db_get_sql($query_count);
|
||||
|
||||
// For link nodes.
|
||||
$array_nodes = metaconsole_get_connections();
|
||||
if (is_metaconsole() === true) {
|
||||
$array_nodes = metaconsole_get_connections();
|
||||
}
|
||||
|
||||
if (isset($array_nodes) && is_array($array_nodes)) {
|
||||
$hash_array_nodes = [];
|
||||
foreach ($array_nodes as $key => $server) {
|
||||
|
@ -280,19 +349,24 @@ if (check_login()) {
|
|||
$data = [];
|
||||
foreach ($result as $values) {
|
||||
$image_status = agents_get_image_status($values['status']);
|
||||
|
||||
// Link nodes.
|
||||
$agent_link = '<a href="'.$hash_array_nodes[$values['id_tmetaconsole_setup']]['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$values['id_tagente'].$hash_array_nodes[$values['id_tmetaconsole_setup']]['hashurl'].'">';
|
||||
if (is_metaconsole() === true) {
|
||||
$agent_link = '<a href="'.$hash_array_nodes[$values['id_tmetaconsole_setup']]['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$values['id_tagente'].$hash_array_nodes[$values['id_tmetaconsole_setup']]['hashurl'].'">';
|
||||
$agent_alias = ui_print_truncate_text(
|
||||
$values['alias'],
|
||||
'agent_small',
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
'[…]',
|
||||
'font-size:7.5pt;'
|
||||
);
|
||||
} else {
|
||||
$agent_link = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$values['id_agente'].'"/>';
|
||||
$agent_alias = $values['alias'];
|
||||
}
|
||||
|
||||
|
||||
$agent_alias = ui_print_truncate_text(
|
||||
$values['alias'],
|
||||
'agent_small',
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
'[…]',
|
||||
'font-size:7.5pt;'
|
||||
);
|
||||
|
||||
if (can_user_access_node()) {
|
||||
$agent = $agent_link.'<b>'.$agent_alias.'</b></a>';
|
||||
|
@ -300,6 +374,11 @@ if (check_login()) {
|
|||
$agent = $agent_alias;
|
||||
}
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
$values['id_tagente'] = $values['id_agente'];
|
||||
$values['id_tmetaconsole_setup'] = 1;
|
||||
}
|
||||
|
||||
$data[] = [
|
||||
'ref' => $referencia,
|
||||
'data_custom_field' => ui_bbcode_to_html($values['name_custom_fields']),
|
||||
|
@ -405,7 +484,7 @@ if (check_login()) {
|
|||
|
||||
$table_modules = new stdClass();
|
||||
$table_modules->width = '100%';
|
||||
$table_modules->class = 'databox data';
|
||||
$table_modules->class = 'databox data custom_field_data';
|
||||
|
||||
$table_modules->head = [];
|
||||
$table_modules->head[0] = __('Module name');
|
||||
|
@ -589,7 +668,11 @@ if (check_login()) {
|
|||
__('Load filter'),
|
||||
'load_filter',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
[
|
||||
'icon' => 'search',
|
||||
'class' => 'sub upd',
|
||||
'onclick' => 'load_filter()',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -608,12 +691,14 @@ if (check_login()) {
|
|||
),
|
||||
true
|
||||
);
|
||||
|
||||
$table = new StdClass;
|
||||
$table->id = 'save_filter_form';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox';
|
||||
$table->rowspan = [];
|
||||
$table->style = [];
|
||||
$table->cellstyle[0][0] = 'display: grid';
|
||||
$table->cellstyle[0][1] = 'display: grid';
|
||||
|
||||
if ($filters['id'] == 'extended_create_filter') {
|
||||
echo "<div id='msg_error_create'></div>";
|
||||
|
@ -624,7 +709,7 @@ if (check_login()) {
|
|||
'',
|
||||
15,
|
||||
255,
|
||||
true
|
||||
true,
|
||||
);
|
||||
|
||||
$table->data[1][0] = __('Group');
|
||||
|
@ -650,11 +735,16 @@ if (check_login()) {
|
|||
);
|
||||
|
||||
$table->rowspan[0][2] = 2;
|
||||
|
||||
$table->data[0][2] = html_print_submit_button(
|
||||
__('Create filter'),
|
||||
'create_filter',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
[
|
||||
'icon' => 'search',
|
||||
'class' => 'sub upd',
|
||||
'onclick' => 'create_filter()',
|
||||
],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
|
@ -702,14 +792,23 @@ if (check_login()) {
|
|||
__('Delete filter'),
|
||||
'delete_filter',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
[
|
||||
'icon' => 'delete',
|
||||
'class' => 'sub upd',
|
||||
'onclick' => 'delete_filter()',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][2] = html_print_submit_button(
|
||||
__('Update filter'),
|
||||
'update_filter',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
[
|
||||
'icon' => 'update',
|
||||
'class' => 'sub upd',
|
||||
'onclick' => 'update_filter()',
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -124,18 +124,22 @@ if (empty($apiPassword) === true
|
|||
) {
|
||||
// Allow internal direct node -> metaconsole connection
|
||||
// or node -> own console connection.
|
||||
$server_uid = get_parameter(('server_auth'));
|
||||
$config['__internal_call'] = true;
|
||||
$config['id_usuario'] = 'admin';
|
||||
$config['id_usuario'] = $server_uid;
|
||||
// Compat.
|
||||
$config['id_user'] = 'admin';
|
||||
$config['id_user'] = $server_uid;
|
||||
$correctLogin = true;
|
||||
$config['is_admin'][$server_uid] = true;
|
||||
// Bypass credentials if server-auth and api-pass are correct.
|
||||
} else if (($config['server_unique_identifier'] === get_parameter('server_auth'))
|
||||
&& ($api_password === $apiPassword)
|
||||
&& ((bool) isInACL($ipOrigin) === true)
|
||||
) {
|
||||
$config['id_usuario'] = 'admin';
|
||||
$config['id_user'] = 'admin';
|
||||
$server_uid = get_parameter(('server_auth'));
|
||||
$config['id_usuario'] = $server_uid;
|
||||
$config['id_user'] = $server_uid;
|
||||
$config['is_admin'][$server_uid] = true;
|
||||
$correctLogin = true;
|
||||
} else if ((bool) isInACL($ipOrigin) === true) {
|
||||
// External access.
|
||||
|
|
|
@ -66,13 +66,34 @@ global $config;
|
|||
// Care whit this!!! check_login not working if you remove this.
|
||||
$config['id_user'] = $id_user;
|
||||
$_SESSION['id_usuario'] = $id_user;
|
||||
|
||||
// Checks for server api req.
|
||||
$bypassLogin = false;
|
||||
if ($data_decoded['apipass'] !== null
|
||||
&& ($config['server_unique_identifier'] === $_SESSION['id_usuario'])
|
||||
) {
|
||||
$apiPassword = io_output_password(
|
||||
db_get_value_filter(
|
||||
'value',
|
||||
'tconfig',
|
||||
['token' => 'api_password']
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
if ($apiPassword === $data_decoded['apipass']) {
|
||||
$bypassLogin = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($config[$slicebar])) {
|
||||
$config[$slicebar] = $slicebar_value;
|
||||
}
|
||||
|
||||
// Try to initialize session using existing php session id.
|
||||
$user = new PandoraFMS\User(['phpsessionid' => $session_id]);
|
||||
if (check_login(false) === false) {
|
||||
|
||||
if (check_login(false) === false && $bypassLogin !== true) {
|
||||
// Error handler.
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
|
|
@ -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§ion=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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|