Merge branch 'ent-4967-9083-Valores-unidades-en-graficas-no-son-por-1024' of https://brutus.artica.es:8081/artica/pandorafms into ent-4967-9083-Valores-unidades-en-graficas-no-son-por-1024

This commit is contained in:
alejandro-campos 2020-01-15 16:01:11 +01:00
commit d9062def99
217 changed files with 5412 additions and 1885 deletions

View File

@ -9,6 +9,7 @@ RUN yum -y install \
epel-release \ epel-release \
unzip \ unzip \
perl \ perl \
python3 \
sed \ sed \
"perl(Sys::Syslog)" "perl(Sys::Syslog)"

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, AIX version # Version 7.0NG.742, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, FreeBSD Version # Version 7.0NG.742, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, HP-UX Version # Version 7.0NG.742, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, GNU/Linux # Version 7.0NG.742, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, GNU/Linux # Version 7.0NG.742, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, Solaris Version # Version 7.0NG.742, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas # (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.740 # Version 7.0NG.742
# This program is Free Software, you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.740, AIX version # Version 7.0NG.742, AIX version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.740 # Version 7.0NG.742
# FreeBSD/IPSO version # FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena # Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.740, HPUX Version # Version 7.0NG.742, HPUX Version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740 # Version 7.0NG.742
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas # (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740 # Version 7.0NG.742
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas # (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740 # Version 7.0NG.742
# Licensed under GPL license v2, # Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.740, Solaris version # Version 7.0NG.742, Solaris version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, AIX version # Version 7.0NG.742, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.740-191122 Version: 7.0NG.742-200115
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, GNU/Linux # Version 7.0NG.742, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, FreeBSD Version # Version 7.0NG.742, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, HP-UX Version # Version 7.0NG.742, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, GNU/Linux # Version 7.0NG.742, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, GNU/Linux # Version 7.0NG.742, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, NetBSD Version # Version 7.0NG.742, NetBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.740, Solaris Version # Version 7.0NG.742, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -54,8 +54,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.740'; use constant AGENT_VERSION => '7.0NG.742';
use constant AGENT_BUILD => '191122'; use constant AGENT_BUILD => '200115';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -2882,7 +2882,7 @@ sub cron_valid_date {
my $utime; my $utime;
eval { eval {
local $SIG{__DIE__} = sub {}; local $SIG{__DIE__} = sub {};
$utime = timelocal(0, $min, $hour, $mday, $month, $year); $utime = strftime("%s", 0, $min, $hour, $mday, $month, $year);
}; };
if ($@) { if ($@) {
return 0; return 0;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.740 %define version 7.0NG.742
%define release 191122 %define release 200115
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}
@ -24,7 +24,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
Requires: fileutils textutils unzip Requires: fileutils textutils unzip
Requires: util-linux procps grep Requires: util-linux procps grep
Requires: /sbin/ip /bin/awk Requires: /sbin/ip /bin/awk
Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip) Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
# Required by plugins # Required by plugins
#Requires: sh-utils sed passwd net-tools rpm #Requires: sh-utils sed passwd net-tools rpm
AutoReq: 0 AutoReq: 0

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.740 %define version 7.0NG.742
%define release 191122 %define release 200115
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}
@ -19,7 +19,7 @@ Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
BuildArch: noarch BuildArch: noarch
PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
Requires: coreutils unzip perl Requires: coreutils unzip perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
AutoReq: 0 AutoReq: 0
Provides: %{name}-%{version} Provides: %{name}-%{version}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.740" PI_VERSION="7.0NG.742"
PI_BUILD="191122" PI_BUILD="200115"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0
@ -89,7 +89,7 @@ fi
[ "$4" ] && PANDORA_PERL_PATH=$4 [ "$4" ] && PANDORA_PERL_PATH=$4
# Check for Perl 5.6.x or higher available # Check for Perl 5.6.x or higher available
PERL_VERSION=`$PANDORA_PERL_PATH -v | egrep 'v5.[6-9]|v5.[12][0-9]' | grep perl` PERL_VERSION=`$PANDORA_PERL_PATH -v | egrep 'v5.[6-9]|v5.[1-3][0-9]' | grep perl`
if [ -z "$PERL_VERSION" ] if [ -z "$PERL_VERSION" ]
then then

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas # (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.740 # Version 7.0NG.742
# This program is Free Software, you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes} {Yes}
AppName AppName
{Pandora FMS Windows Agent v7.0NG.740} {Pandora FMS Windows Agent v7.0NG.742}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{191122} {200115}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -1708,3 +1708,17 @@ void
Pandora_Module::setExecutions (long executions) { Pandora_Module::setExecutions (long executions) {
this->executions = executions; this->executions = executions;
} }
/**
* Checks if the module has intensive conditions.
*
* @return true if the module's intensive condition list is not empty, false if it is.
*/
bool
Pandora_Module::isIntensive () {
if (this->intensive_condition_list == NULL || this->intensive_condition_list->size () <= 0) {
return false;
}
return true;
}

View File

@ -303,6 +303,7 @@ namespace Pandora_Modules {
time_t getTimestamp (); time_t getTimestamp ();
void setIntensiveMatch (unsigned char intensive_match); void setIntensiveMatch (unsigned char intensive_match);
unsigned char getIntensiveMatch (); unsigned char getIntensiveMatch ();
bool isIntensive ();
}; };
} }

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.740(Build 191122)") #define PANDORA_VERSION ("7.0NG.742(Build 200115)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -1918,18 +1918,21 @@ Pandora_Windows_Service::pandora_run_broker (string config, long executions) {
} }
/* Evaluate intensive conditions */ /* Evaluate intensive conditions */
if (module->isIntensive()) {
intensive_match = module->evaluateIntensiveConditions (); intensive_match = module->evaluateIntensiveConditions ();
if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
module->setNoOutput (); module->setNoOutput ();
this->broker_modules->goNext (); this->broker_modules->goNext ();
continue; continue;
} }
module->setIntensiveMatch (intensive_match);
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
module->setTimestamp (this->run_time); module->setTimestamp (this->run_time);
} }
module->setIntensiveMatch (intensive_match);
}
/* Evaluate module conditions */ /* Evaluate module conditions */
module->evaluateConditions (); module->evaluateConditions ();
@ -2038,18 +2041,21 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
} }
/* Evaluate intensive conditions */ /* Evaluate intensive conditions */
if (module->isIntensive()) {
intensive_match = module->evaluateIntensiveConditions (); intensive_match = module->evaluateIntensiveConditions ();
if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) { if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
module->setNoOutput (); module->setNoOutput ();
this->modules->goNext (); this->modules->goNext ();
continue; continue;
} }
module->setIntensiveMatch (intensive_match);
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) { if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
module->setTimestamp (this->run_time); module->setTimestamp (this->run_time);
} }
module->setIntensiveMatch (intensive_match);
}
/* Evaluate module conditions */ /* Evaluate module conditions */
module->evaluateConditions (); module->evaluateConditions ();

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.740(Build 191122))" VALUE "ProductVersion", "(7.0NG.742(Build 200115))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.740-191122 Version: 7.0NG.742-200115
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -798,11 +798,7 @@ function mainAgentsModules()
echo "<td style='text-align: center;'>"; echo "<td style='text-align: center;'>";
$win_handle = dechex(crc32($module_id.$module['name'])); $win_handle = dechex(crc32($module_id.$module['name']));
$graph_type = return_graphtype(modules_get_agentmodule_type($module_id)); $graph_type = return_graphtype(modules_get_agentmodule_type($module_id));
$link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'label='.rawurlencode( $link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."')";
urlencode(
base64_encode($module['name'])
)
).'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."')";
echo '<a href="javascript:'.$link.'">'; echo '<a href="javascript:'.$link.'">';
switch ($status) { switch ($status) {

View File

@ -22,6 +22,17 @@ function dbmanager_query($sql, &$error, $dbconnection)
} }
$sql = html_entity_decode($sql, ENT_QUOTES); $sql = html_entity_decode($sql, ENT_QUOTES);
// Extract the text in quotes to add html entities before query db.
$patttern = '/(?:"|\')+([^"\']*)(?:"|\')+/m';
$sql = preg_replace_callback(
$patttern,
function ($matches) {
return '"'.io_safe_input($matches[1]).'"';
},
$sql
);
if ($config['mysqli']) { if ($config['mysqli']) {
$result = mysqli_query($dbconnection, $sql); $result = mysqli_query($dbconnection, $sql);
if ($result === false) { if ($result === false) {

View File

@ -64,9 +64,11 @@ if (!empty($files)) {
$document_root = str_replace('\\', '/', io_safe_output($_SERVER['DOCUMENT_ROOT'])); $document_root = str_replace('\\', '/', io_safe_output($_SERVER['DOCUMENT_ROOT']));
$file['location'] = str_replace('\\', '/', io_safe_output($file['location'])); $file['location'] = str_replace('\\', '/', io_safe_output($file['location']));
$relative_path = str_replace($document_root, '', $file['location']); $relative_path = str_replace($document_root, '', $file['location']);
$file_path = base64_encode($relative_path); $file_name = explode('/', $file['location']);
$hash = md5($relative_path.$config['dbpass']); $file_decoded = $file_name[(count($file_name) - 1)];
$url = ui_get_full_url("include/get_file.php?file=$file_path&hash=$hash"); $file_path = base64_encode($file_decoded);
$hash = md5($file_path.$config['dbpass']);
$url = ui_get_full_url('include/get_file.php?file='.urlencode($file_path).'&hash='.$hash);
$date_format = ($config['date_format']) ? io_safe_output($config['date_format']) : 'F j, Y - H:m'; $date_format = ($config['date_format']) ? io_safe_output($config['date_format']) : 'F j, Y - H:m';
$data[0] = "<a href=\"$url\" target=\"_blank\">".$file['name'].'</a>'; $data[0] = "<a href=\"$url\" target=\"_blank\">".$file['name'].'</a>';

View File

@ -312,7 +312,7 @@ function main_net_tools()
$ips = db_get_all_rows_sql( $ips = db_get_all_rows_sql(
sprintf( sprintf(
'SELECT ip FROM taddress WHERE id_a IN (%s)', 'SELECT ip FROM taddress WHERE id_a IN (%s)',
join($ids) join(',', $ids)
) )
); );

View File

@ -65,17 +65,13 @@ function quickShell()
ui_require_css_file('discovery'); ui_require_css_file('discovery');
// Settings. // Settings.
// WebSocket host, where to connect. // WebSocket host, where client should connect.
if (isset($config['ws_host']) === false) {
config_update_value('ws_host', $_SERVER['SERVER_ADDR']);
}
if (isset($config['ws_port']) === false) { if (isset($config['ws_port']) === false) {
config_update_value('ws_port', 8080); config_update_value('ws_port', 8080);
} }
if (empty($config['ws_proxy_url']) === true) { if (empty($config['ws_proxy_url']) === true) {
$ws_url = 'http://'.$config['ws_host'].':'.$config['ws_port']; $ws_url = 'http://'.$_SERVER['SERVER_ADDR'].':'.$config['ws_port'];
} else { } else {
preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches); preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches);
if (isset($_SERVER['HTTPS']) === true) { if (isset($_SERVER['HTTPS']) === true) {
@ -313,7 +309,7 @@ function quickShellSettings()
} }
// Parser. // Parser.
if (get_parameter('qs_update', false) !== false) { if (get_parameter('update_config', false) !== false) {
// Gotty settings. Internal communication (WS). // Gotty settings. Internal communication (WS).
$gotty = get_parameter( $gotty = get_parameter(
'gotty', 'gotty',
@ -381,14 +377,6 @@ function quickShellSettings()
} }
} }
// Interface.
ui_print_page_header(
__('QuickShell settings'),
'',
false,
'quickshell_settings'
);
if ($changes > 0) { if ($changes > 0) {
$msg = __('%d Updated', $changes); $msg = __('%d Updated', $changes);
if ($critical > 0) { if ($critical > 0) {
@ -401,100 +389,105 @@ function quickShellSettings()
ui_print_success_message($msg); ui_print_success_message($msg);
} }
// Form. // Form. Using old style.
$wiz = new Wizard(); echo '<fieldset>';
echo '<legend>'.__('Quickshell').'</legend>';
$wiz->printForm( $t = new StdClass();
[ $t->data = [];
'form' => [ $t->width = '100%';
'action' => '#', $t->class = 'databox filters';
'class' => 'wizard', $t->data = [];
'method' => 'post', $t->style = [];
], $t->style[0] = 'font-weight: bold; width: 40%;';
'inputs' => [
[ $t->data[0][0] = __('Gotty path');
'label' => __('Gotty path').ui_print_help_tip( $t->data[0][1] = html_print_input_text(
__('Leave blank if using an external Gotty service'), 'gotty',
true $config['gotty'],
), '',
'arguments' => [ 30,
'type' => 'text', 100,
'name' => 'gotty',
'value' => $config['gotty'],
],
],
[
'label' => __('Gotty host'),
'arguments' => [
'type' => 'text',
'name' => 'gotty_host',
'value' => $config['gotty_host'],
],
],
[
'label' => __('Gotty ssh port'),
'arguments' => [
'type' => 'text',
'name' => 'gotty_ssh_port',
'value' => $config['gotty_ssh_port'],
],
],
[
'label' => __('Gotty telnet port'),
'arguments' => [
'type' => 'text',
'name' => 'gotty_telnet_port',
'value' => $config['gotty_telnet_port'],
],
],
[
'toggle' => true,
'toggle_name' => 'Advanced',
'block_content' => [
[
'label' => __('Gotty user').ui_print_help_tip(
__('Optional, set a user to access gotty service'),
true
),
'arguments' => [
'type' => 'text',
'name' => 'gotty_user',
'value' => $config['gotty_user'],
],
],
[
'label' => __('Gotty password').ui_print_help_tip(
__('Optional, set a password to access gotty service'),
true
),
'arguments' => [
'type' => 'password',
'name' => 'gotty_pass',
'value' => io_output_password($config['gotty_pass']),
],
],
],
],
[
'arguments' => [
'type' => 'hidden',
'name' => 'qs_update',
'value' => 1,
],
],
[
'arguments' => [
'type' => 'submit',
'label' => __('Update'),
'attributes' => 'class="sub next"',
],
],
],
],
false,
true true
); );
$t->data[1][0] = __('Gotty host');
$t->data[1][1] = html_print_input_text(
'gotty_host',
$config['gotty_host'],
'',
30,
100,
true
);
$t->data[2][0] = __('Gotty ssh port');
$t->data[2][1] = html_print_input_text(
'gotty_ssh_port',
$config['gotty_ssh_port'],
'',
30,
100,
true
);
$t->data[3][0] = __('Gotty telnet port');
$t->data[3][1] = html_print_input_text(
'gotty_telnet_port',
$config['gotty_telnet_port'],
'',
30,
100,
true
);
$hidden = new StdClass();
$hidden->data = [];
$hidden->width = '100%';
$hidden->class = 'databox filters';
$hidden->data = [];
$hidden->style[0] = 'font-weight: bold;width: 40%;';
$hidden->data[0][0] = __('Gotty user').ui_print_help_tip(
__('Optional, set a user to access gotty service'),
true
);
$hidden->data[0][1] = html_print_input_text(
'gotty_user',
$config['gotty_user'],
'',
30,
100,
true
);
$hidden->data[1][0] = __('Gotty password').ui_print_help_tip(
__('Optional, set a password to access gotty service'),
true
);
$hidden->data[1][1] = html_print_input_password(
'gotty_pass',
io_output_password($config['gotty_pass']),
'',
30,
100,
true
);
html_print_table($t);
ui_print_toggle(
[
'content' => html_print_table($hidden, true),
'name' => __('Advanced options'),
'clean' => false,
'main_class' => 'no-border-imp',
'container_class' => 'no-border-imp',
]
);
echo '</fieldset>';
} }
@ -523,19 +516,4 @@ if (empty($agent_id) === false
} }
} }
extensions_add_godmode_menu_option(
// Name.
__('QuickShell settings'),
// Acl.
'PM',
// FatherId.
'gextensions',
// Icon.
'images/ehorus/terminal.png',
// Version.
'N/A',
// SubfatherId.
null
);
extensions_add_godmode_function('quickShellSettings'); extensions_add_godmode_function('quickShellSettings');

View File

@ -1,5 +1,6 @@
START TRANSACTION; START TRANSACTION;
ALTER TABLE `treport_template` ADD COLUMN `agent_regex` varchar(600) NOT NULL default '';
ALTER TABLE `tlayout_template_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0; ALTER TABLE `tlayout_template_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
INSERT INTO `ttipo_modulo` VALUES INSERT INTO `ttipo_modulo` VALUES
@ -16,10 +17,45 @@ INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `ma
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux&#x20;available&#x20;memory&#x20;percent','Available&#x20;memory&#x20;%',43,34,0,0,300,0,'free&#x20;|&#x20;grep&#x20;Mem&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$NF/$2&#x20;*&#x20;100}&#039;','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux&#x20;available&#x20;memory&#x20;percent','Available&#x20;memory&#x20;%',43,34,0,0,300,0,'free&#x20;|&#x20;grep&#x20;Mem&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$NF/$2&#x20;*&#x20;100}&#039;','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux&#x20;available&#x20;disk&#x20;/','Available&#x20;free&#x20;space&#x20;in&#x20;mountpoint&#x20;/',43,34,0,0,300,0,'df&#x20;/&#x20;|&#x20;tail&#x20;-n&#x20;+2&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$&#40;NF-1&#41;}&#039;&#x20;|&#x20;tr&#x20;-d&#x20;&#039;%&#039;','','','',4,2,0,'','','',0,0,1,0.00,0.00,'0.00',0.00,0.00,'',0,'','inherited','',0,0,0.000000000000000,'','nowizard','','nowizard','0','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux&#x20;available&#x20;disk&#x20;/','Available&#x20;free&#x20;space&#x20;in&#x20;mountpoint&#x20;/',43,34,0,0,300,0,'df&#x20;/&#x20;|&#x20;tail&#x20;-n&#x20;+2&#x20;|&#x20;awk&#x20;&#039;{print&#x20;$&#40;NF-1&#41;}&#039;&#x20;|&#x20;tr&#x20;-d&#x20;&#039;%&#039;','','','',4,2,0,'','','',0,0,1,0.00,0.00,'0.00',0.00,0.00,'',0,'','inherited','',0,0,0.000000000000000,'','nowizard','','nowizard','0','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default '';
ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL;
ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL;
ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT; ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent';
UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != '';
UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != '';
UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0;
UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != '';
UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != '';
UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != '';
UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != '';
UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99';
UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != '';
UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0;
UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != '';
UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != '';
UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != '';
ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0;
ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400;
CREATE TABLE `tremote_command` ( CREATE TABLE `tremote_command` (
`id` SERIAL, `id` SERIAL,
`name` varchar(150) NOT NULL, `name` varchar(150) NOT NULL,
@ -48,6 +84,12 @@ CREATE TABLE `tremote_command_target` (
INSERT INTO `tconfig`(`token`, `value`) VALUES ('welcome_state', -1); INSERT INTO `tconfig`(`token`, `value`) VALUES ('welcome_state', -1);
ALTER TABLE `tcredential_store` MODIFY COLUMN `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM'; ALTER TABLE `tcredential_store` MODIFY COLUMN `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM';
ALTER TABLE `tevent_filter` ADD COLUMN `id_source_event` int(10);
ALTER TABLE `tmetaconsole_agent_secondary_group` ADD INDEX `id_tagente` (`id_tagente`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`);
COMMIT; COMMIT;

View File

@ -0,0 +1,10 @@
START TRANSACTION;
ALTER TABLE `treport_content` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `tevent_response` ADD COLUMN `command_timeout` int(5) unsigned NOT NULL DEFAULT 90;
COMMIT;

View File

@ -1,5 +1,7 @@
START TRANSACTION; START TRANSACTION;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_module_units', '{"bytes":"bytes","entries":"entries","files":"files","hits":"hits","sessions":"sessions","users":"users","ºC":"ºC","ºF":"ºF"}'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_module_units', '{"bytes":"bytes","entries":"entries","files":"files","hits":"hits","sessions":"sessions","users":"users","ºC":"ºC","ºF":"ºF"}');
ALTER TABLE `tmap` ADD COLUMN `id_group_map` INT(10) UNSIGNED NOT NULL default 0;
ALTER TABLE `tevent_filter` MODIFY `severity` TEXT NOT NULL;
COMMIT; COMMIT;

View File

@ -579,6 +579,39 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tevent_rule` ADD COLUMN `group_recursion` INT(1) unsigned default 0; ALTER TABLE `tevent_rule` ADD COLUMN `group_recursion` INT(1) unsigned default 0;
ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT;
ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source';
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent';
ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default '';
ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL;
ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL;
UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != '';
UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != '';
UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0;
UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != '';
UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != '';
UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != '';
UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != '';
UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99';
UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != '';
UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0;
UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != '';
UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != '';
UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != '';
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tevent_alert` -- Table `tevent_alert`
@ -627,6 +660,9 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0;
ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tevent_alert_action` -- Table `tevent_alert_action`
-- ----------------------------------------------------- -- -----------------------------------------------------
@ -728,6 +764,8 @@ CREATE TABLE IF NOT EXISTS `treport_template` (
`footer` MEDIUMTEXT default NULL, `footer` MEDIUMTEXT default NULL,
`custom_font` varchar(200) default NULL, `custom_font` varchar(200) default NULL,
`metaconsole` tinyint(1) DEFAULT 0, `metaconsole` tinyint(1) DEFAULT 0,
`agent_regex` varchar(600) NOT NULL default '',
PRIMARY KEY(`id_report`) PRIMARY KEY(`id_report`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8; ) ENGINE = InnoDB DEFAULT CHARSET=utf8;
@ -804,6 +842,8 @@ ALTER TABLE `treport_content_template` MODIFY COLUMN `historical_db` tinyint(1)
MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0', MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0',
MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300', MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300',
MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0'; MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
-- Table `tnews` -- Table `tnews`
@ -931,6 +971,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(22,5) default NULL; ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(22,5) default NULL;
ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0'; ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`);
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tmetaconsole_event_history` -- Table `tmetaconsole_event_history`
@ -1154,6 +1195,8 @@ CREATE TABLE IF NOT EXISTS `tmap` (
`generation_method` INTEGER UNSIGNED NOT NULL default 0, `generation_method` INTEGER UNSIGNED NOT NULL default 0,
`generated` INTEGER UNSIGNED NOT NULL default 0, `generated` INTEGER UNSIGNED NOT NULL default 0,
`filter` TEXT, `filter` TEXT,
`id_group_map` INT(10) UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id`) PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8; ) ENGINE = InnoDB DEFAULT CHARSET=utf8;
@ -1291,13 +1334,13 @@ ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT '';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 33); INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 34);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '741'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '742');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
@ -1358,7 +1401,9 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL;
ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL; ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `id_source_event` int(10);
ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL; ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL;
ALTER TABLE `tevent_filter` MODIFY COLUMN `severity` text NOT NULL;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tusuario` -- Table `tusuario`
@ -1561,6 +1606,8 @@ ALTER TABLE `treport_content` MODIFY COLUMN `historical_db` tinyint(1) unsigned
MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0', MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0',
MODIFY COLUMN `failover_mode` tinyint(1) NULL DEFAULT '1', MODIFY COLUMN `failover_mode` tinyint(1) NULL DEFAULT '1',
MODIFY COLUMN `failover_type` tinyint(1) NULL DEFAULT '1'; MODIFY COLUMN `failover_type` tinyint(1) NULL DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tmodule_relationship` -- Table `tmodule_relationship`
@ -1736,6 +1783,7 @@ ALTER TABLE tserver ADD COLUMN exec_proxy tinyint(1) UNSIGNED NOT NULL default 0
-- Table `tevent_response` -- Table `tevent_response`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tevent_response ADD COLUMN server_to_exec int(10) unsigned NOT NULL DEFAULT 0; ALTER TABLE tevent_response ADD COLUMN server_to_exec int(10) unsigned NOT NULL DEFAULT 0;
ALTER TABLE tevent_response ADD COLUMN command_timeout int(5) unsigned NOT NULL DEFAULT 90;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tmodule` -- Table `tmodule`
@ -1906,6 +1954,7 @@ create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`(
ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
ALTER TABLE tusuario_perfil ADD COLUMN `no_hierarchy` tinyint(1) NOT NULL default '0'; ALTER TABLE tusuario_perfil ADD COLUMN `no_hierarchy` tinyint(1) NOT NULL default '0';
ALTER TABLE `tmetaconsole_agent_secondary_group` ADD INDEX `id_tagente` (`id_tagente`);
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tautoconfig` -- Table `tautoconfig`
@ -2357,7 +2406,7 @@ CREATE TABLE `tvisual_console_elements_cache` (
CREATE TABLE IF NOT EXISTS `tcredential_store` ( CREATE TABLE IF NOT EXISTS `tcredential_store` (
`identifier` varchar(100) NOT NULL, `identifier` varchar(100) NOT NULL,
`id_group` mediumint(4) unsigned NOT NULL DEFAULT 0, `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0,
`product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM', `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM',
`username` text, `username` text,
`password` text, `password` text,
`extra_1` text, `extra_1` text,

View File

@ -13,6 +13,8 @@
require_once 'include/functions_messages.php'; require_once 'include/functions_messages.php';
require_once 'include/functions_servers.php'; require_once 'include/functions_servers.php';
require_once 'include/functions_notifications.php'; require_once 'include/functions_notifications.php';
require_once 'include/ajax/order_interpreter.php';
ui_require_css_file('order_interpreter');
// Check permissions // Check permissions
// Global errors/warnings checking. // Global errors/warnings checking.
@ -99,7 +101,8 @@ if ($config['menu_type'] == 'classic') {
if ($acl_head_search) { if ($acl_head_search) {
// Search bar. // Search bar.
$search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">'; $search_bar = '<form autocomplete="off" method="get" style="display: inline;" name="quicksearch" action="">';
'<input autocomplete="false" name="hidden" type="text" style="display:none;">';
if (!isset($config['search_keywords'])) { if (!isset($config['search_keywords'])) {
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>'; $search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
} else { } else {
@ -110,7 +113,7 @@ if ($config['menu_type'] == 'classic') {
} }
} }
$search_bar .= '<input type="text" id="keywords" name="keywords"'; $search_bar .= '<input id="keywords" name="keywords"';
if (!isset($config['search_keywords'])) { if (!isset($config['search_keywords'])) {
$search_bar .= "value='".__('Enter keywords to search')."'"; $search_bar .= "value='".__('Enter keywords to search')."'";
} else if (strlen($config['search_keywords']) == 0) { } else if (strlen($config['search_keywords']) == 0) {
@ -119,9 +122,11 @@ if ($config['menu_type'] == 'classic') {
$search_bar .= "value='".$config['search_keywords']."'"; $search_bar .= "value='".$config['search_keywords']."'";
} }
$search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" $search_bar .= 'type="search" onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
onkeyup="javascript: fieldKeyWordEmpty = false;" class="search_input" />'; onkeyup="showinterpreter()" class="search_input"/>';
$search_bar .= '<div id="result_order" class="result_order"></div>';
// $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />"; $search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
$search_bar .= '</form>'; $search_bar .= '</form>';
@ -622,7 +627,7 @@ if ($config['menu_type'] == 'classic') {
}); });
} }
// Resize event // Resize event.
window.addEventListener("resize", function() { window.addEventListener("resize", function() {
attatch_to_image(); attatch_to_image();
}); });
@ -631,6 +636,85 @@ if ($config['menu_type'] == 'classic') {
var new_chat = <?php echo (int) $_SESSION['new_chat']; ?>; var new_chat = <?php echo (int) $_SESSION['new_chat']; ?>;
function showinterpreter(){
document.onclick = function(e) {
$('#result_order').hide();
$('#keywords').addClass('search_input');
$('#keywords').removeClass('results-found');
$('#keywords').value = '';
$('#keywords').attr('placeholder','Enter keywords to search');
}
if(event.keyCode == 13 && $("#result_items li.active").length != 0 )
{
window.location = $('#result_items').find("li.active a").attr('href');
}
var code = event.key;
switch (code){
case 'ArrowDown':
if($("#result_items li.active").length!=0)
{
var storeTarget = $('#result_items').find("li.active").next();
$("#result_items li.active").removeClass("active");
storeTarget.focus().addClass("active");
}
else
{
$('#result_items').find("li:first").focus().addClass("active");
}
return;
case 'ArrowUp':
if($("#result_items li.active"))
{
var storeTarget = $('#result_items').find("li.active").prev();
$("#result_items li.active").removeClass("active");
storeTarget.focus().addClass("active");
}
else
{
$('#result_items').find("li:first").focus().addClass("active");
}
return;
case 'ArrowRight':
return;
case 'ArrowLeft':
return;
}
if( $('#keywords').val() === ''){
$('#keywords').addClass('search_input');
$('#keywords').removeClass('results-found');
$('#result_order').hide();
$('#keywords').attr('placeholder','Enter keywords to search');
}else {
$.ajax({
type: "POST",
url: "ajax.php",
dataType: "html",
data: {
page: 'include/ajax/order_interpreter',
method: 'getResult',
text: $('#keywords').val(),
},
success: function (data) {
$('#result_order').html(data);
console.log(data);
},
error: function (data) {
console.error("Fatal error in AJAX call to interpreter order", data)
}
});
$('#keywords').removeClass('search_input');
$('#keywords').addClass('results-found');
$('#result_order').show();
}
}
/** /**
* Loads modal from AJAX to add feedback. * Loads modal from AJAX to add feedback.
*/ */

View File

@ -82,12 +82,18 @@ if (!empty($page) && !empty($sec)) {
} }
$login_body_style = ''; $login_body_style = '';
$login_body_class = '';
// Overrides the default background with the defined by the user. // Overrides the default background with the defined by the user.
if (!empty($config['login_background'])) { if (!empty($config['login_background'])) {
$background_url = 'images/backgrounds/'.$config['login_background']; $background_url = 'images/backgrounds/'.$config['login_background'];
$login_body_style = "style=\"background:linear-gradient(74deg, #02020255 36%, transparent 36%), url('".$background_url."');\""; $login_body_style = "style=\"background:linear-gradient(74deg, #02020255 36%, transparent 36%), url('".$background_url."');\"";
} }
// Support for Internet Explorer and Microsoft Edge browsers
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') !== false) {
$login_body_class = "class='login_body_trident'";
}
// Get alternative custom in case of db fail. // Get alternative custom in case of db fail.
$custom_fields = [ $custom_fields = [
'custom_logo_login', 'custom_logo_login',
@ -111,7 +117,7 @@ foreach ($custom_fields as $field) {
// Get the custom icons. // Get the custom icons.
$docs_logo = ui_get_docs_logo(); $docs_logo = ui_get_docs_logo();
$support_logo = ui_get_support_logo(); $support_logo = ui_get_support_logo();
echo '<div id="login_body" '.$login_body_style.'>'; echo '<div id="login_body" '.$login_body_class.' '.$login_body_style.'>';
echo '<div id="header_login">'; echo '<div id="header_login">';
echo '<div id="list_icon_docs_support"><ul>'; echo '<div id="list_icon_docs_support"><ul>';

View File

@ -40,7 +40,7 @@ if (!empty($news)) {
// Prints news dialog template // Prints news dialog template
echo '<div id="news_dialog" title="" style="display: none;">'; echo '<div id="news_dialog" title="" style="display: none;">';
echo '<div style="position:absolute; top:30px; left: 10px; text-align: left; right:0%; height:70px; min-width:560px; width: 95%; margin: 0 auto; border: 1px solid #FFF; line-height: 19px;">'; echo '<div style="position:absolute; top:30px; left: 10px; text-align: left; right:0%; height:70px; min-width:560px; width: 95%; margin: 0 auto; line-height: 19px;">';
echo '<span style="display: block; height: 260px; overflow: auto; text-align: justify; padding: 5px 15px 4px 10px; background: #ECECEC; border-radius: 4px;" id="new_text"></span>'; echo '<span style="display: block; height: 260px; overflow: auto; text-align: justify; padding: 5px 15px 4px 10px; background: #ECECEC; border-radius: 4px;" id="new_text"></span>';
echo '<span style="font-size: 12px; display: block; margin-top: 20px;" id="new_author"></span>'; echo '<span style="font-size: 12px; display: block; margin-top: 20px;" id="new_author"></span>';
echo '<span style="font-size: 12px; display: block; font-style: italic;" id="new_timestamp"></span>'; echo '<span style="font-size: 12px; display: block; font-style: italic;" id="new_timestamp"></span>';

View File

@ -612,7 +612,6 @@ if (enterprise_installed()) {
$cascade_protection, $cascade_protection,
true true
).__('Cascade protection').'&nbsp;'; ).__('Cascade protection').'&nbsp;';
}
$table_adv_parent .= __('Module').'&nbsp;'.html_print_select( $table_adv_parent .= __('Module').'&nbsp;'.html_print_select(
$modules_values, $modules_values,
@ -622,7 +621,10 @@ $table_adv_parent .= __('Module').'&nbsp;'.html_print_select(
'', '',
0, 0,
true true
).'</div></div>'; );
}
$table_adv_parent .= '</div></div>';
// Learn mode / Normal mode. // Learn mode / Normal mode.
$table_adv_module_mode = '<div class="label_select"><p class="input_label">'.__('Module definition').': </p>'; $table_adv_module_mode = '<div class="label_select"><p class="input_label">'.__('Module definition').': </p>';
@ -667,7 +669,7 @@ $table_adv_status .= html_print_checkbox_switch(
$disabled, $disabled,
true true
); );
$table_adv_status .= '<p class="input_label input_label_simple">'.__('Disabled').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'</p>'; $table_adv_status .= '<p class="input_label input_label_simple">'.__('Disabled mode').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'</p>';
$table_adv_status .= '</div>'; $table_adv_status .= '</div>';
// Url address. // Url address.
@ -774,11 +776,14 @@ if ($config['activate_gis']) {
} }
if (enterprise_installed()) {
$advanced_div = '<div class="secondary_groups_list">';
} else {
$advanced_div = '<div class="secondary_groups_list" style="display: none">';
}
// General display distribution. // General display distribution.
$table_adv_options = ' $table_adv_options = $advanced_div.$adv_secondary_groups_label.'
<div class="secondary_groups_list">
'.$adv_secondary_groups_label.'
<div class="sg_source"> <div class="sg_source">
'.$adv_secondary_groups_left.' '.$adv_secondary_groups_left.'
</div> </div>

View File

@ -546,7 +546,7 @@ if ($create_modules) {
$module_values = $common_values; $module_values = $common_values;
$module_values['descripcion'] = sprintf(__('Check if the process %s is running or not'), $process); $module_values['descripcion'] = sprintf(__('Check if the process %s is running or not'), $process);
$module_values['id_tipo_modulo'] = modules_get_type_id('remote_snmp_proc'); $module_values['id_tipo_modulo'] = modules_get_type_id('generic_proc');
$module_values['id_modulo'] = MODULE_PLUGIN; $module_values['id_modulo'] = MODULE_PLUGIN;
$module_values['id_plugin'] = $plugin['id']; $module_values['id_plugin'] = $plugin['id'];

View File

@ -1,16 +1,18 @@
<?php <?php
/**
* Pandora FMS - http://pandorafms.com.
* * ==================================================
* * Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
* * Please see http://pandorafms.org 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; 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.
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org 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; 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.
global $config; global $config;
require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_agents.php';
require_once 'include/functions_modules.php'; require_once 'include/functions_modules.php';
@ -23,19 +25,19 @@ require_once 'include/graphs/functions_utils.php';
check_login(); check_login();
$ip_target = (string) get_parameter('ip_target', $ipAgent); $ip_target = (string) get_parameter('ip_target', $ipAgent);
// Host // Host.
$plugin_user = (string) get_parameter('plugin_user', 'Administrator'); $plugin_user = (string) get_parameter('plugin_user', 'Administrator');
// Username // Username.
$plugin_pass = io_safe_output(get_parameter('plugin_pass', '')); $plugin_pass = io_safe_output(get_parameter('plugin_pass', ''));
// Password // Password.
$tcp_send = (string) get_parameter('tcp_send'); $tcp_send = (string) get_parameter('tcp_send');
// Namespace // Namespace.
$server_to_exec = get_parameter('server_to_exec', 0); $server_to_exec = get_parameter('server_to_exec', 0);
// See if id_agente is set (either POST or GET, otherwise -1 // See if id_agente is set (either POST or GET, otherwise -1.
$id_agent = $idAgent; $id_agent = $idAgent;
// Get passed variables // Get passed variables.
$wmiexplore = (int) get_parameter('wmiexplore', 0); $wmiexplore = (int) get_parameter('wmiexplore', 0);
$create_modules = (int) get_parameter('create_modules', 0); $create_modules = (int) get_parameter('create_modules', 0);
@ -44,24 +46,30 @@ $interfaces = [];
$wmi_client = 'wmic'; $wmi_client = 'wmic';
if ($wmiexplore) { if ($wmiexplore) {
$wmi_command = wmi_compose_query($wmi_client, $plugin_user, $plugin_pass, $ip_target, $tcp_send); $wmi_command = wmi_compose_query(
$wmi_client,
$plugin_user,
$plugin_pass,
$ip_target,
$tcp_send
);
$processes = []; $processes = [];
$services = []; $services = [];
$disks = []; $disks = [];
$network_component_groups = []; $network_component_groups = [];
// Processes // Processes.
$wmi_processes = $wmi_command.' "select Name from Win32_Process"'; $wmi_processes = $wmi_command.' "select Name from Win32_Process"';
$processes_name_field = 1; $processes_name_field = 1;
if (enterprise_installed() && (int) $server_to_exec != 0) {
if (enterprise_installed()) {
if ($server_to_exec != 0) {
$server_data = db_get_row('tserver', 'id_server', $server_to_exec); $server_data = db_get_row('tserver', 'id_server', $server_to_exec);
exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_processes."'", $output, $rc); exec(
} else { 'ssh pandora_exec_proxy@'.$server_data['ip_address']."
exec($wmi_processes, $output); '".$wmi_processes."'",
} $output,
$rc
);
} else { } else {
exec($wmi_processes, $output); exec($wmi_processes, $output);
} }
@ -73,7 +81,7 @@ if ($wmiexplore) {
if (!$fail) { if (!$fail) {
foreach ($output as $index => $row) { foreach ($output as $index => $row) {
// First and second rows are Class and column names, ignore it // First and second rows are Class and column names, ignore it.
if ($index < 2) { if ($index < 2) {
continue; continue;
} }
@ -81,30 +89,39 @@ if ($wmiexplore) {
$row_exploded = explode('|', $row); $row_exploded = explode('|', $row);
if (!in_array($row_exploded[$processes_name_field], $processes)) { if (!in_array($row_exploded[$processes_name_field], $processes)) {
$processes[$row_exploded[$processes_name_field]] = $row_exploded[$processes_name_field]; if (preg_match('/ERROR/', $row_exploded[$processes_name_field])) {
$processes[$row_exploded[$prouycesses_name_field]] = __('None');
} else {
$processes[$row_exploded[$prouycesses_name_field]] = $row_exploded[$processes_name_field];
}
} }
} }
unset($output); unset($output);
// Services // Services.
$wmi_services = $wmi_command.' "select Name from Win32_Service"'; $wmi_services = $wmi_command.' "select Name from Win32_Service"';
$services_name_field = 0; $services_name_field = 0;
$services_check_field = 1; $services_check_field = 1;
if (enterprise_installed()) { if (enterprise_installed() && (int) $server_to_exec != 0) {
if ($server_to_exec != 0) { $server_data = db_get_row(
$server_data = db_get_row('tserver', 'id_server', $server_to_exec); 'tserver',
exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_services."'", $output, $rc); 'id_server',
} else { $server_to_exec
exec($wmi_services, $output); );
} exec(
'ssh pandora_exec_proxy@'.$server_data['ip_address']."
'".$wmi_services."'",
$output,
$rc
);
} else { } else {
exec($wmi_services, $output); exec($wmi_services, $output);
} }
foreach ($output as $index => $row) { foreach ($output as $index => $row) {
// First and second rows are Class and column names, ignore it // First and second rows are Class and column names, ignore it.
if ($index < 2) { if ($index < 2) {
continue; continue;
} }
@ -112,29 +129,34 @@ if ($wmiexplore) {
$row_exploded = explode('|', $row); $row_exploded = explode('|', $row);
if (!in_array($row_exploded[$services_name_field], $services)) { if (!in_array($row_exploded[$services_name_field], $services)) {
if (preg_match('/ERROR/', $row_exploded[$services_name_field])) {
$services[$row_exploded[$services_name_field]] = __('None');
} else {
$services[$row_exploded[$services_name_field]] = $row_exploded[$services_name_field]; $services[$row_exploded[$services_name_field]] = $row_exploded[$services_name_field];
} }
} }
}
unset($output); unset($output);
// Disks // Disks.
$wmi_disks = $wmi_command.' "Select DeviceID from Win32_LogicalDisk"'; $wmi_disks = $wmi_command.' "Select DeviceID from Win32_LogicalDisk"';
$disks_name_field = 0; $disks_name_field = 0;
if (enterprise_installed()) { if (enterprise_installed() && (int) $server_to_exec != 0) {
if ($server_to_exec != 0) {
$server_data = db_get_row('tserver', 'id_server', $server_to_exec); $server_data = db_get_row('tserver', 'id_server', $server_to_exec);
exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_disks."'", $output, $rc); exec(
} else { 'ssh pandora_exec_proxy@'.$server_data['ip_address']."
exec($wmi_disks, $output); '".$wmi_disks."'",
} $output,
$rc
);
} else { } else {
exec($wmi_disks, $output); exec($wmi_disks, $output);
} }
foreach ($output as $index => $row) { foreach ($output as $index => $row) {
// First and second rows are Class and column names, ignore it // First and second rows are Class and column names, ignore it.
if ($index < 2) { if ($index < 2) {
continue; continue;
} }
@ -142,14 +164,21 @@ if ($wmiexplore) {
$row_exploded = explode('|', $row); $row_exploded = explode('|', $row);
if (!in_array($row_exploded[$disks_name_field], $services)) { if (!in_array($row_exploded[$disks_name_field], $services)) {
$disk_string = sprintf(__('Free space on %s'), $row_exploded[$disks_name_field]); if (preg_match('/ERROR/', $row_exploded[$disks_name_field])) {
$disks[$row_exploded[$disks_name_field]] = __('None');
} else {
$disk_string = sprintf(
__('Free space on %s'),
$row_exploded[$disks_name_field]
);
$disks[$row_exploded[$disks_name_field]] = $disk_string; $disks[$row_exploded[$disks_name_field]] = $disk_string;
} }
} }
}
unset($output); unset($output);
// WMI Components // WMI Components.
$network_component_groups = network_components_get_groups(MODULE_WMI); $network_component_groups = network_components_get_groups(MODULE_WMI);
} }
} }
@ -163,14 +192,14 @@ if ($create_modules) {
$components = []; $components = [];
foreach ($modules as $module) { foreach ($modules as $module) {
// Split module data to get type // Split module data to get type.
$module_exploded = explode('_', $module); $module_exploded = explode('_', $module);
$type = $module_exploded[0]; $type = $module_exploded[0];
// Delete type from module data // Delete type from module data.
unset($module_exploded[0]); unset($module_exploded[0]);
// Rebuild module data // Rebuild module data.
$module = implode('_', $module_exploded); $module = implode('_', $module_exploded);
switch ($type) { switch ($type) {
@ -189,10 +218,14 @@ if ($create_modules) {
case 'component': case 'component':
$components[] = $module; $components[] = $module;
break; break;
default:
// Default.
break;
} }
} }
// Common values for WMI modules // Common values for WMI modules.
$values = [ $values = [
'ip_target' => $ip_target, 'ip_target' => $ip_target,
'tcp_send' => $tcp_send, 'tcp_send' => $tcp_send,
@ -202,7 +235,10 @@ if ($create_modules) {
]; ];
if ($server_to_exec != 0) { if ($server_to_exec != 0) {
$sql = sprintf('SELECT server_type FROM tserver WHERE id_server = %d', $server_to_exec); $sql = sprintf(
'SELECT server_type FROM tserver WHERE id_server = %d',
$server_to_exec
);
$row = db_get_row_sql($sql); $row = db_get_row_sql($sql);
if ($row['server_type'] == 13) { if ($row['server_type'] == 13) {
@ -210,89 +246,146 @@ if ($create_modules) {
} }
} }
// Create Service modules // Create Service modules.
$services_values = $values; $services_values = $values;
$services_values['snmp_community'] = 'Running'; $services_values['snmp_community'] = 'Running';
// Key string // Key string.
$services_values['tcp_port'] = 1; $services_values['tcp_port'] = 1;
// Field number (Running/Stopped) // Field number (Running/Stopped).
$services_values['id_tipo_modulo'] = 2; $services_values['id_tipo_modulo'] = 2;
// Generic boolean // Generic boolean.
$services_result = wmi_create_wizard_modules($id_agent, $services, 'services', $services_values, 0, 0, $server_to_exec); $services_result = wmi_create_wizard_modules(
$id_agent,
$services,
'services',
$services_values,
0,
0,
$server_to_exec
);
// Create Process modules // Create Process modules.
$processes_values = $values; $processes_values = $values;
$processes_values['tcp_port'] = 0; $processes_values['tcp_port'] = 0;
// Field number (OID) // Field number (OID).
$processes_values['id_tipo_modulo'] = 2; $processes_values['id_tipo_modulo'] = 2;
// Generic boolean // Generic boolean.
$processes_result = wmi_create_wizard_modules($id_agent, $processes, 'processes', $processes_values, 0, 0, $server_to_exec); $processes_result = wmi_create_wizard_modules(
$id_agent,
$processes,
'processes',
$processes_values,
0,
0,
$server_to_exec
);
// Create Space on disk modules // Create Space on disk modules.
$disks_values = $values; $disks_values = $values;
$disks_values['tcp_port'] = 1; $disks_values['tcp_port'] = 1;
// Free space in bytes // Free space in bytes.
$disks_values['id_tipo_modulo'] = 1; $disks_values['id_tipo_modulo'] = 1;
// Generic numeric // Generic numeric.
$disks_values['unit'] = 'Bytes'; $disks_values['unit'] = 'Bytes';
// Unit // Unit.
$disks_result = wmi_create_wizard_modules($id_agent, $disks, 'disks', $disks_values, 0, 0, $server_to_exec); $disks_result = wmi_create_wizard_modules(
$id_agent,
$disks,
'disks',
$disks_values,
0,
0,
$server_to_exec
);
// Create modules from component // Create modules from component.
$components_values = $values; $components_values = $values;
$components_values['id_agente'] = $id_agent; $components_values['id_agente'] = $id_agent;
$components_result = wmi_create_module_from_components($components, $components_values, 0, 0, $server_to_exec); $components_result = wmi_create_module_from_components(
$components,
$components_values,
0,
0,
$server_to_exec
);
// Errors/Success messages // Errors/Success messages.
$success_message = ''; $success_message = '';
$error_message = ''; $error_message = '';
if (!empty($services_result)) { if (!empty($services_result)) {
if (count($services_result[NOERR]) > 0) { if (count($services_result[NOERR]) > 0) {
$success_message .= sprintf(__('%s service modules created succesfully'), count($services_result[NOERR])).'<br>'; $success_message .= sprintf(
__('%s service modules created succesfully'),
count($services_result[NOERR])
).'<br>';
} }
if (count($services_result[ERR_GENERIC]) > 0) { if (count($services_result[ERR_GENERIC]) > 0) {
$error_message .= sprintf(__('Error creating %s service modules'), count($services_result[ERR_GENERIC])).'<br>'; $error_message .= sprintf(
__('Error creating %s service modules'),
count($services_result[ERR_GENERIC])
).'<br>';
} }
} }
if (!empty($processes_result)) { if (!empty($processes_result)) {
if (count($processes_result[NOERR]) > 0) { if (count($processes_result[NOERR]) > 0) {
$success_message .= sprintf(__('%s process modules created succesfully'), count($processes_result[NOERR])).'<br>'; $success_message .= sprintf(
__('%s process modules created succesfully'),
count($processes_result[NOERR])
).'<br>';
} }
if (count($processes_result[ERR_GENERIC]) > 0) { if (count($processes_result[ERR_GENERIC]) > 0) {
$error_message .= sprintf(__('Error creating %s process modules'), count($processes_result[ERR_GENERIC])).'<br>'; $error_message .= sprintf(
__('Error creating %s process modules'),
count($processes_result[ERR_GENERIC])
).'<br>';
} }
} }
if (!empty($disks_result)) { if (!empty($disks_result)) {
if (count($disks_result[NOERR]) > 0) { if (count($disks_result[NOERR]) > 0) {
$success_message .= sprintf(__('%s disk space modules created succesfully'), count($disks_result[NOERR])).'<br>'; $success_message .= sprintf(
__('%s disk space modules created succesfully'),
count($disks_result[NOERR])
).'<br>';
} }
if (count($disks_result[ERR_GENERIC]) > 0) { if (count($disks_result[ERR_GENERIC]) > 0) {
$error_message .= sprintf(__('Error creating %s disk space modules'), count($disks_result[ERR_GENERIC])).'<br>'; $error_message .= sprintf(
__('Error creating %s disk space modules'),
count($disks_result[ERR_GENERIC])
).'<br>';
} }
} }
if (!empty($components_result)) { if (!empty($components_result)) {
if (count($components_result[NOERR]) > 0) { if (count($components_result[NOERR]) > 0) {
$success_message .= sprintf(__('%s modules created from components succesfully'), count($components_result[NOERR])).'<br>'; $success_message .= sprintf(
__('%s modules created from components succesfully'),
count($components_result[NOERR])
).'<br>';
} }
if (count($components_result[ERR_GENERIC]) > 0) { if (count($components_result[ERR_GENERIC]) > 0) {
$error_message .= sprintf(__('Error creating %s modules from components'), count($components_result[ERR_GENERIC])).'<br>'; $error_message .= sprintf(
__('Error creating %s modules from components'),
count($components_result[ERR_GENERIC])
).'<br>';
} }
if (count($components_result[ERR_EXIST]) > 0) { if (count($components_result[ERR_EXIST]) > 0) {
$error_message .= sprintf(__('%s modules already exist'), count($components_result[ERR_EXIST])).'<br>'; $error_message .= sprintf(
__('%s modules already exist'),
count($components_result[ERR_EXIST])
).'<br>';
} }
} }
@ -306,7 +399,9 @@ if ($create_modules) {
} }
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>'; echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo "<form method='post' id='wmi_form' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>"; echo "<form method='post' id='wmi_form'
action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&
tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
$table->width = '100%'; $table->width = '100%';
$table->cellpadding = 0; $table->cellpadding = 0;
@ -314,18 +409,47 @@ $table->cellspacing = 0;
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->data[0][0] = '<b>'.__('Target IP').'</b>'; $table->data[0][0] = '<b>'.__('Target IP').'</b>';
$table->data[0][1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true); $table->data[0][1] = html_print_input_text(
'ip_target',
$ip_target,
'',
15,
60,
true
);
$table->data[0][2] = '<b>'.__('Namespace').'</b>'; $table->data[0][2] = '<b>'.__('Namespace').'</b>';
$table->data[0][3] = html_print_input_text('tcp_send', $tcp_send, '', 15, 60, true); $table->data[0][3] = html_print_input_text(
'tcp_send',
$tcp_send,
'',
15,
60,
true
);
$table->data[1][0] = '<b>'.__('Username').'</b>'; $table->data[1][0] = '<b>'.__('Username').'</b>';
$table->data[1][1] = html_print_input_text('plugin_user', $plugin_user, '', 15, 60, true); $table->data[1][1] = html_print_input_text(
'plugin_user',
$plugin_user,
'',
15,
60,
true
);
$table->data[1][2] = '<b>'.__('Password').'</b>'; $table->data[1][2] = '<b>'.__('Password').'</b>';
$table->data[1][3] = html_print_input_password('plugin_pass', $plugin_pass, '', 15, 60, true); $table->data[1][3] = html_print_input_password(
'plugin_pass',
$plugin_pass,
'',
15,
60,
true
);
$table->data[1][3] .= '<div id="spinner_modules" style="float: left; display: none;">'.html_print_image('images/spinner.gif', true).'</div>'; $table->data[1][3] .= '<div id="spinner_modules" style="float: left; display: none;">
'.html_print_image('images/spinner.gif', true).'</div>';
html_print_input_hidden('wmiexplore', 1); html_print_input_hidden('wmiexplore', 1);
$servers_to_exec = []; $servers_to_exec = [];
@ -346,13 +470,27 @@ if (enterprise_installed()) {
} }
$table->data[2][0] = '<b>'.__('Server to execute command').'</b>'; $table->data[2][0] = '<b>'.__('Server to execute command').'</b>';
$table->data[2][1] = html_print_select($servers_to_exec, 'server_to_exec', $server_to_exec, '', '', '', true); $table->data[2][1] = html_print_select(
$servers_to_exec,
'server_to_exec',
$server_to_exec,
'',
'',
'',
true
);
html_print_table($table); html_print_table($table);
echo "<div style='text-align:right; width:".$table->width."'>"; echo "<div style='text-align:right; width:".$table->width."'>";
echo '<span id="oid_loading" class="invisible">'.html_print_image('images/spinner.gif', true).'</span>'; echo '<span id="oid_loading" class="invisible">
html_print_submit_button(__('WMI Explore'), 'wmi_explore', false, ['class' => 'sub next']); '.html_print_image('images/spinner.gif', true).'</span>';
html_print_submit_button(
__('WMI Explore'),
'wmi_explore',
false,
['class' => 'sub next']
);
echo '</div><br>'; echo '</div><br>';
if ($wmiexplore && $fail) { if ($wmiexplore && $fail) {
@ -365,23 +503,25 @@ echo '</form>';
if ($wmiexplore && !$fail) { if ($wmiexplore && !$fail) {
echo '<br><span id ="none_text" style="display: none;">'.__('None').'</span>'; echo '<br><span id ="none_text" style="display: none;">'.__('None').'</span>';
echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>"; echo "<form method='post'
action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente
&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
echo '<span id="form_interfaces">'; echo '<span id="form_interfaces">';
html_print_input_hidden('create_modules', 1); html_print_input_hidden('create_modules', 1);
html_print_input_hidden('ip_target', $ip_target); html_print_input_hidden('ip_target', $ip_target);
// Host // Host.
html_print_input_hidden('plugin_user', $plugin_user); html_print_input_hidden('plugin_user', $plugin_user);
// User // User.
html_print_input_hidden('plugin_pass', $plugin_pass); html_print_input_hidden('plugin_pass', $plugin_pass);
// Password // Password.
html_print_input_hidden('tcp_send', $tcp_send); html_print_input_hidden('tcp_send', $tcp_send);
// Namespace // Namespace.
html_print_input_hidden('server_to_exec', $server_to_exec); html_print_input_hidden('server_to_exec', $server_to_exec);
$table->width = '100%'; $table->width = '100%';
// Mode selector // Mode selector.
$modes = []; $modes = [];
$modes['services'] = __('Services'); $modes['services'] = __('Services');
$modes['processes'] = __('Processes'); $modes['processes'] = __('Processes');
@ -406,7 +546,7 @@ if ($wmiexplore && !$fail) {
$table->data[1][2] = '<b>'.__('Modules').'</b>'; $table->data[1][2] = '<b>'.__('Modules').'</b>';
$table->cellstyle[1][2] = 'text-align: center;'; $table->cellstyle[1][2] = 'text-align: center;';
// Components list // Components list.
$table->data[2][0] = '<div class="wizard_mode_form wizard_mode_components">'; $table->data[2][0] = '<div class="wizard_mode_form wizard_mode_components">';
$table->data[2][0] .= __('Filter by group').'<br>'; $table->data[2][0] .= __('Filter by group').'<br>';
$table->data[2][0] .= html_print_select( $table->data[2][0] .= html_print_select(
@ -439,7 +579,7 @@ if ($wmiexplore && !$fail) {
); );
$table->data[2][0] .= '</div>'; $table->data[2][0] .= '</div>';
// Services list // Services list.
$table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_services">'; $table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_services">';
$table->data[2][0] .= html_print_select( $table->data[2][0] .= html_print_select(
$services, $services,
@ -456,8 +596,7 @@ if ($wmiexplore && !$fail) {
'width: 300px;' 'width: 300px;'
); );
$table->data[2][0] .= '</div>'; $table->data[2][0] .= '</div>';
// Processes list.
// Processes list
$table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_processes">'; $table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_processes">';
$table->data[2][0] .= html_print_select( $table->data[2][0] .= html_print_select(
$processes, $processes,
@ -474,11 +613,13 @@ if ($wmiexplore && !$fail) {
'width: 300px;' 'width: 300px;'
); );
$table->data[2][0] .= '</div>'; $table->data[2][0] .= '</div>';
$table->data[2][0] .= '<span id="no_component" class="invisible error wizard_mode_form wizard_mode_components">'; $table->data[2][0] .= '<span id="no_component"
class="invisible error wizard_mode_form wizard_mode_components">';
$table->data[2][0] .= __('No component was found'); $table->data[2][0] .= __('No component was found');
$table->data[2][0] .= '</span>'; $table->data[2][0] .= '</span>';
// Disks list // Disks list.
$table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_disks">'; $table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_disks">';
$table->data[2][0] .= html_print_select( $table->data[2][0] .= html_print_select(
$disks, $disks,
@ -498,27 +639,79 @@ if ($wmiexplore && !$fail) {
$table->cellstyle[2][0] = 'vertical-align: bottom; text-align: center;'; $table->cellstyle[2][0] = 'vertical-align: bottom; text-align: center;';
// Components arrow // Components arrow.
$table->data[2][1] = '<div class="wizard_mode_form wizard_mode_components wizard_mode_components_arrow clickable">'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'</div>'; $table->data[2][1] = '<div
// Services arrow class="wizard_mode_form wizard_mode_components wizard_mode_components_arrow clickable">
$table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_services wizard_mode_services_arrow clickable">'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'</div>'; '.html_print_image(
// Processes arrow 'images/darrowright.png',
$table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_processes wizard_mode_processes_arrow clickable">'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'</div>'; true,
// Disks arrow ['title' => __('Add to modules list')]
$table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_disks wizard_mode_disks_arrow clickable">'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'</div>'; ).'</div>';
// Services arrow.
$table->data[2][1] .= '<div
class="wizard_mode_form wizard_mode_services wizard_mode_services_arrow clickable">
'.html_print_image(
'images/darrowright.png',
true,
['title' => __('Add to modules list')]
).'</div>';
// Processes arrow.
$table->data[2][1] .= '<div
class="wizard_mode_form wizard_mode_processes wizard_mode_processes_arrow clickable">
'.html_print_image(
'images/darrowright.png',
true,
['title' => __('Add to modules list')]
).'</div>';
// Disks arrow.
$table->data[2][1] .= '<div
class="wizard_mode_form wizard_mode_disks wizard_mode_disks_arrow clickable">
'.html_print_image(
'images/darrowright.png',
true,
['title' => __('Add to modules list')]
).'</div>';
$table->data[2][1] .= '<br><br><div class="wizard_mode_delete_arrow clickable">'.html_print_image('images/cross.png', true, ['title' => __('Remove from modules list')]).'</div>'; $table->data[2][1] .= '<br><br>
<div class="wizard_mode_delete_arrow clickable">
'.html_print_image(
'images/cross.png',
true,
['title' => __('Remove from modules list')]
).'</div>';
$table->cellstyle[2][1] = 'vertical-align: middle; text-align: center;'; $table->cellstyle[2][1] = 'vertical-align: middle; text-align: center;';
$table->data[2][2] = html_print_select([], 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:300px; height: 100%;'); $table->data[2][2] = html_print_select(
$table->data[2][2] .= html_print_input_hidden('agent', $id_agent, true); [],
'module[]',
0,
false,
'',
0,
true,
true,
true,
'',
false,
'width:300px; height: 100%;'
);
$table->data[2][2] .= html_print_input_hidden(
'agent',
$id_agent,
true
);
$table->cellstyle[2][2] = 'vertical-align: top; text-align: center;'; $table->cellstyle[2][2] = 'vertical-align: top; text-align: center;';
html_print_table($table); html_print_table($table);
echo "<div style='text-align:right; width:".$table->width."'>"; echo "<div style='text-align:right; width:".$table->width."'>";
html_print_submit_button(__('Create modules'), 'create_modules_btn', false, ['class' => 'sub add']); html_print_submit_button(
__('Create modules'),
'create_modules_btn',
false,
['class' => 'sub add']
);
echo '</div>'; echo '</div>';
unset($table); unset($table);
@ -651,4 +844,3 @@ $(document).ready (function () {
/* ]]> */ /* ]]> */
</script> </script>

View File

@ -466,11 +466,11 @@ $data[1] = html_print_select(
$array_os = [ $array_os = [
'inherited' => __('Inherited'), 'inherited' => __('Inherited'),
'linux' => __('Linux'), 'linux' => __('SSH'),
'windows' => __('Windows'), 'windows' => __('Windows remote'),
]; ];
$data[2] = __('Target OS'); $data[2] = __('Connection method');
$data[3] = html_print_select( $data[3] = html_print_select(
$array_os, $array_os,
'command_os', 'command_os',
@ -541,14 +541,12 @@ $(document).ready (function () {
$("#simple-field_snmpv3_row2").attr("style", ""); $("#simple-field_snmpv3_row2").attr("style", "");
$("#simple-field_snmpv3_row3").attr("style", ""); $("#simple-field_snmpv3_row3").attr("style", "");
$("input[name=active_snmp_v3]").val(1); $("input[name=active_snmp_v3]").val(1);
$("input[name=snmp_community]").attr("disabled", true);
} }
else { else {
$("#simple-field_snmpv3_row1").css("display", "none"); $("#simple-field_snmpv3_row1").css("display", "none");
$("#simple-field_snmpv3_row2").css("display", "none"); $("#simple-field_snmpv3_row2").css("display", "none");
$("#simple-field_snmpv3_row3").css("display", "none"); $("#simple-field_snmpv3_row3").css("display", "none");
$("input[name=active_snmp_v3]").val(0); $("input[name=active_snmp_v3]").val(0);
$("input[name=snmp_community]").removeAttr('disabled');
} }
}); });

View File

@ -32,19 +32,6 @@ if (! check_acl($config['id_user'], 0, 'LM')) {
exit; exit;
} }
if (is_ajax()) {
$get_alert_action = (bool) get_parameter('get_alert_action');
if ($get_alert_action) {
$id = (int) get_parameter('id');
$action = alerts_get_alert_action($id);
$action['command'] = alerts_get_alert_action_alert_command($action['id']);
echo json_encode($action);
}
return;
}
$update_action = (bool) get_parameter('update_action'); $update_action = (bool) get_parameter('update_action');
$create_action = (bool) get_parameter('create_action'); $create_action = (bool) get_parameter('create_action');
$delete_action = (bool) get_parameter('delete_action'); $delete_action = (bool) get_parameter('delete_action');
@ -57,15 +44,22 @@ if (defined('METACONSOLE')) {
$sec = 'galertas'; $sec = 'galertas';
} }
if ((!$copy_action) && (!$delete_action)) { // Header.
// Header
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
alerts_meta_print_header(); alerts_meta_print_header();
} else { } else {
ui_print_page_header(__('Alerts').' &raquo; '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_action', true); $header_help = 'alerts_action';
}
if ($copy_action) {
$header_help = 'alerts_config';
} }
if ($delete_action) {
$header_help = 'alerts_action';
}
ui_print_page_header(__('Alerts').' &raquo; '.__('Alert actions'), 'images/gm_alerts.png', false, $header_help, true);
}
if ($copy_action) { if ($copy_action) {
$id = get_parameter('id'); $id = get_parameter('id');
@ -83,13 +77,6 @@ if ($copy_action) {
); );
include 'general/noaccess.php'; include 'general/noaccess.php';
exit; exit;
} else {
// Header
if (defined('METACONSOLE')) {
alerts_meta_print_header();
} else {
ui_print_page_header(__('Alerts').' &raquo; '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
}
} }
} //end if } //end if
else { else {
@ -102,14 +89,7 @@ if ($copy_action) {
$is_in_group = in_array($al_action['id_group'], $own_groups); $is_in_group = in_array($al_action['id_group'], $own_groups);
// Then action group have to be in his own groups // Then action group have to be in his own groups
if ($is_in_group) { if (!$is_in_group) {
// Header
if (defined('METACONSOLE')) {
alerts_meta_print_header();
} else {
ui_print_page_header(__('Alerts').' &raquo; '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
}
} else {
db_pandora_audit( db_pandora_audit(
'ACL Violation', 'ACL Violation',
'Trying to access Alert Management' 'Trying to access Alert Management'
@ -118,13 +98,6 @@ if ($copy_action) {
exit; exit;
} }
} }
} else {
// Header
if (defined('METACONSOLE')) {
alerts_meta_print_header();
} else {
ui_print_page_header(__('Alerts').' &raquo; '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
}
} }
$result = alerts_clone_alert_action($id); $result = alerts_clone_alert_action($id);
@ -162,13 +135,6 @@ if ($delete_action) {
); );
include 'general/noaccess.php'; include 'general/noaccess.php';
exit; exit;
} else {
// Header
if (defined('METACONSOLE')) {
alerts_meta_print_header();
} else {
ui_print_page_header(__('Alerts').' &raquo; '.__('Alert actions'), 'images/gm_alerts.png', false, 'alert_action', true);
}
} }
// If user tries to delete an action of others groups // If user tries to delete an action of others groups
@ -182,14 +148,7 @@ if ($delete_action) {
$is_in_group = in_array($al_action['id_group'], $own_groups); $is_in_group = in_array($al_action['id_group'], $own_groups);
// Then action group have to be in his own groups // Then action group have to be in his own groups
if ($is_in_group) { if (!$is_in_group) {
// Header
if (defined('METACONSOLE')) {
alerts_meta_print_header();
} else {
ui_print_page_header(__('Alerts').' &raquo; '.__('Alert actions'), 'images/gm_alerts.png', false, 'alert_action', true);
}
} else {
db_pandora_audit( db_pandora_audit(
'ACL Violation', 'ACL Violation',
'Trying to access Alert Management' 'Trying to access Alert Management'
@ -198,9 +157,6 @@ if ($delete_action) {
exit; exit;
} }
} }
} else {
// Header
ui_print_page_header(__('Alerts').' &raquo; '.__('Alert actions'), 'images/gm_alerts.png', false, '', true);
} }
@ -285,10 +241,14 @@ foreach ($actions as $action) {
2 => 'action_buttons', 2 => 'action_buttons',
3 => 'action_buttons', 3 => 'action_buttons',
]; ];
$data[2] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&amp;copy_action=1&amp;id='.$action['id'].'&pure='.$pure.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true).'</a>'; $id_action = $action['id'];
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&delete_action=1&id='.$action['id'].'&pure='.$pure.'" $text_confirm = __('Are you sure?');
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>';
$data[2] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions"
onClick="copy_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/copy.png', true).'</a>';
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions"
onClick="delete_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/cross.png', true).'</a>';
} }
array_push($table->data, $data); array_push($table->data, $data);
@ -308,3 +268,45 @@ echo '</form>';
echo '</div>'; echo '</div>';
enterprise_hook('close_meta_frame'); enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
function copy_action(id_action, text_confirm) {
if (!confirm(text_confirm)) {
return false;
} else {
jQuery.post ("ajax.php",
{
"page" : "godmode/alerts/alert_actions",
"copy_action" : 1,
"id" : id_action
},
function (data, status) {
// No data.
},
"json"
);
}
}
function delete_action(id_action, text_confirm) {
if (!confirm(text_confirm)) {
return false;
} else {
jQuery.post ("ajax.php",
{
"page" : "godmode/alerts/alert_actions",
"delete_action" : 1,
"id" : id_action
},
function (data, status) {
// No data.
},
"json"
);
}
}
</script>

View File

@ -140,14 +140,8 @@ $table->colspan[0][1] = 2;
$table->data[1][0] = __('Group'); $table->data[1][0] = __('Group');
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
// Only display group "All" if user is administrator or has "PM" privileges
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
$display_all_group = true;
} else {
$display_all_group = false;
}
$table->data[1][1] = html_print_select_groups(false, 'LW', $display_all_group, 'group', $group, '', '', 0, true); $table->data[1][1] = html_print_select_groups(false, 'LW', true, 'group', $group, '', '', 0, true);
$table->colspan[1][1] = 2; $table->colspan[1][1] = 2;
$table->data[2][0] = __('Command'); $table->data[2][0] = __('Command');
@ -173,9 +167,9 @@ $table->data[2][1] = html_print_select_from_sql(
); );
$table->data[2][1] .= ' '; $table->data[2][1] .= ' ';
if (check_acl($config['id_user'], 0, 'PM')) { if (check_acl($config['id_user'], 0, 'PM')) {
$table->data[2][1] .= html_print_image('images/add.png', true);
$table->data[2][1] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
$table->data[2][1] .= __('Create Command'); $table->data[2][1] .= __('Create Command');
$table->data[2][1] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
$table->data[2][1] .= html_print_image('images/add.png', true);
$table->data[2][1] .= '</a>'; $table->data[2][1] .= '</a>';
} }
@ -320,18 +314,18 @@ $(document).ready (function () {
original_command = data["command"]; original_command = data["command"];
render_command_preview (original_command); render_command_preview (original_command);
command_description = data["description"]; command_description = data["description"];
if (command_description != undefined) {
render_command_description(command_description); render_command_description(command_description);
} else {
render_command_description('');
}
var max_fields = parseInt('<?php echo $config['max_macro_fields']; ?>'); var max_fields = parseInt('<?php echo $config['max_macro_fields']; ?>');
// Change the selected group // Change the selected group
$("#group option").each(function(index, value) { $("#group option").each(function(index, value) {
var current_group = $(value).val(); var current_group = $(value).val();
if (data.id_group != 0 && current_group != 0 && current_group != data.id_group) {
$(value).hide();
} else {
$(value).show();
}
}); });
if (data.id_group != 0 && $("#group").val() != data.id_group) { if (data.id_group != 0 && $("#group").val() != data.id_group) {
$("#group").val(0); $("#group").val(0);

View File

@ -55,7 +55,7 @@ if ($id) {
$id_group = $filter['id_group']; $id_group = $filter['id_group'];
$id_name = $filter['id_name']; $id_name = $filter['id_name'];
$event_type = $filter['event_type']; $event_type = $filter['event_type'];
$severity = $filter['severity']; $severity = explode(',', $filter['severity']);
$status = $filter['status']; $status = $filter['status'];
$search = $filter['search']; $search = $filter['search'];
$text_agent = $filter['text_agent']; $text_agent = $filter['text_agent'];
@ -123,7 +123,7 @@ if ($update || $create) {
$id_group_filter = get_parameter('id_group_filter'); $id_group_filter = get_parameter('id_group_filter');
$id_name = (string) get_parameter('id_name'); $id_name = (string) get_parameter('id_name');
$event_type = get_parameter('event_type', ''); $event_type = get_parameter('event_type', '');
$severity = get_parameter('severity', ''); $severity = implode(',', get_parameter('severity', -1));
$status = get_parameter('status', ''); $status = get_parameter('status', '');
$search = get_parameter('search', ''); $search = get_parameter('search', '');
$text_agent = get_parameter('text_agent', ''); $text_agent = get_parameter('text_agent', '');
@ -172,6 +172,8 @@ if ($update || $create) {
'user_comment' => $user_comment, 'user_comment' => $user_comment,
'filter_only_alert' => $filter_only_alert, 'filter_only_alert' => $filter_only_alert,
]; ];
$severity = explode(',', $severity);
} }
if ($update) { if ($update) {
@ -289,15 +291,24 @@ $table->data[3][1] = html_print_select(
true true
); );
if (empty($severity) && $severity !== '0') {
$severity = -1;
}
$table->data[4][0] = '<b>'.__('Severity').'</b>'; $table->data[4][0] = '<b>'.__('Severity').'</b>';
$table->data[4][1] = html_print_select( $table->data[4][1] = html_print_select(
get_priorities(), get_priorities(),
'severity', 'severity[]',
$severity, $severity,
'', '',
__('All'), __('All'),
'-1', -1,
true true,
true,
true,
'',
false,
'width: 175px'
); );
$fields = events_get_all_status(); $fields = events_get_all_status();
@ -588,6 +599,18 @@ $table->data[23][1] = html_print_input_text('id_extra', $id_extra, '', 11, 255,
$table->data[24][0] = '<b>'.__('Comment').'</b>'; $table->data[24][0] = '<b>'.__('Comment').'</b>';
$table->data[24][1] = html_print_input_text('user_comment', $user_comment, '', 35, 255, true); $table->data[24][1] = html_print_input_text('user_comment', $user_comment, '', 35, 255, true);
if (is_metaconsole()) {
$table->data[25][0] = '<b>'.__('Id souce event').'</b>';
$table->data[25][1] = html_print_input_text(
'id_source_event',
$id_source_event,
'',
35,
255,
true
);
}
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&pure='.$config['pure'].'">'; echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&pure='.$config['pure'].'">';
html_print_table($table); html_print_table($table);

View File

@ -52,6 +52,7 @@ if ($event_response_id > 0) {
$event_response['modal_height'] = 0; $event_response['modal_height'] = 0;
$event_response['params'] = ''; $event_response['params'] = '';
$event_response['server_to_exec'] = ''; $event_response['server_to_exec'] = '';
$event_response['command_timeout'] = 90;
} }
$table = new stdClass(); $table = new stdClass();
@ -175,6 +176,11 @@ $data[3] = '<div id="server_to_exec_value" style="display:none;">'.html_print_se
$table->data[4] = $data; $table->data[4] = $data;
$data = [];
$data[0] = '<div id="command_timeout_label" style="display:none;" class="labels">'.__('Command timeout (s)');
$data[1] = '<div id="command_timeout_value" style="display:none;">'.html_print_input_text('command_timeout', $event_response['command_timeout'], '', 4, 5, true);
$table->data[5] = $data;
if ($event_response_id == 0) { if ($event_response_id == 0) {
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=create_response&amp;pure='.$config['pure'].'">'; echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=create_response&amp;pure='.$config['pure'].'">';
html_print_table($table); html_print_table($table);
@ -214,11 +220,17 @@ $('#type').change(function() {
$('#new_window').attr('disabled','disabled'); $('#new_window').attr('disabled','disabled');
$('#server_to_exec_label').css('display',''); $('#server_to_exec_label').css('display','');
$('#server_to_exec_value').css('display',''); $('#server_to_exec_value').css('display','');
$('#command_timeout_label').css('display','');
$('#command_timeout_value').css('display','');
break; break;
case 'url': case 'url':
$('#new_window').removeAttr('disabled'); $('#new_window').removeAttr('disabled');
$('#server_to_exec_label').css('display','none'); $('#server_to_exec_label').css('display','none');
$('#server_to_exec_value').css('display','none'); $('#server_to_exec_value').css('display','none');
$('#command_timeout_label').css('display','none');
$('#command_timeout_value').css('display','none');
break; break;
} }
}); });

View File

@ -42,6 +42,7 @@ switch ($action) {
$values['new_window'] = get_parameter('new_window'); $values['new_window'] = get_parameter('new_window');
$values['params'] = get_parameter('params'); $values['params'] = get_parameter('params');
$values['server_to_exec'] = get_parameter('server_to_exec'); $values['server_to_exec'] = get_parameter('server_to_exec');
$values['command_timeout'] = get_parameter('command_timeout', 90);
$result = event_responses_create_response($values); $result = event_responses_create_response($values);
@ -65,6 +66,8 @@ switch ($action) {
$values['params'] = get_parameter('params'); $values['params'] = get_parameter('params');
$values['server_to_exec'] = get_parameter('server_to_exec'); $values['server_to_exec'] = get_parameter('server_to_exec');
$response_id = get_parameter('id_response', 0); $response_id = get_parameter('id_response', 0);
$values['command_timeout'] = get_parameter('command_timeout', '90');
$result = event_responses_update_response($response_id, $values); $result = event_responses_update_response($response_id, $values);

View File

@ -129,6 +129,7 @@ if ($disabled != '') {
$extensions = extensions_get_extension_info(); $extensions = extensions_get_extension_info();
$table = new StdClass;
$table->width = '98%'; $table->width = '98%';
$table->head = []; $table->head = [];

View File

@ -117,6 +117,14 @@ if ($update_agents) {
$values['quiet'] = get_parameter('quiet_select'); $values['quiet'] = get_parameter('quiet_select');
} }
if (get_parameter('safe_mode_change', -1) == 1 && get_parameter('safe_mode_module', '') != '') {
// Get the module name.
$values['safe_mode_module'] = get_parameter('safe_mode_module');
} else if (get_parameter('safe_mode_change', -1) == 0) {
// Disabled Safe Operation Mode.
$values['safe_mode_module'] = '0';
}
$fields = db_get_all_fields_in_table('tagent_custom_fields'); $fields = db_get_all_fields_in_table('tagent_custom_fields');
if ($fields === false) { if ($fields === false) {
@ -134,6 +142,20 @@ if ($update_agents) {
} }
} }
// Get the id_agente_modulo to update the 'safe_operation_mode' field.
if (isset($values['safe_mode_module']) && ($values['safe_mode_module'] != '0')) {
foreach ($id_agents as $id_agent) {
$id_module_safe[$id_agent] = db_get_value_filter(
'id_agente_modulo',
'tagente_modulo',
[
'id_agente' => $id_agent,
'nombre' => $values['safe_mode_module'],
]
);
}
}
// CONF FILE DELETION // CONF FILE DELETION
if (isset($values['delete_conf'])) { if (isset($values['delete_conf'])) {
unset($values['delete_conf']); unset($values['delete_conf']);
@ -188,6 +210,11 @@ if ($update_agents) {
} }
} }
// Get the id_agent_module for this agent to update the 'safe_operation_mode' field.
if (isset($values['safe_mode_module']) && ($values['safe_mode_module'] != '0')) {
$values['safe_mode_module'] = $id_module_safe[$id_agent];
}
$result = db_process_sql_update( $result = db_process_sql_update(
'tagente', 'tagente',
$values, $values,
@ -677,6 +704,27 @@ $table->data[6][1] = html_print_select(
true true
); );
$table->data[7][0] = __('Safe operation mode').': '.ui_print_help_tip(
__(
'This mode allow %s to disable all modules
of this agent while the selected module is on CRITICAL status',
get_product_name()
),
true
);
$table->data[7][1] .= html_print_select(
[
1 => __('Enabled'),
0 => __('Disabled'),
],
'safe_mode_change',
-1,
'',
__('No change'),
-1,
true
).'&nbsp;';
$table->data[7][1] .= __('Module').'&nbsp;'.html_print_select('', 'safe_mode_module', '', '', __('Any'), -1, true).'</div>';
ui_toggle(html_print_table($table, true), __('Advanced options')); ui_toggle(html_print_table($table, true), __('Advanced options'));
unset($table); unset($table);
@ -810,6 +858,54 @@ $(document).ready (function () {
} }
}); });
// Enable Safe Operation Mode if 'Enabled' is selected.
$("#safe_mode_module").attr("disabled", "disabled");
$("#safe_mode_change").on('change', function() {
if ($("#safe_mode_change").val() == 1) {
$("#safe_mode_module").removeAttr("disabled");
refreshSafeModules();
}
else {
$("#safe_mode_module").attr("disabled", "disabled");
$('#safe_mode_module').empty();
$("#safe_mode_module").append($("<option></option>").attr("value", 'Any').html('Any'));
}
});
// Fill modules in Safe Operation Mode.
function refreshSafeModules(){
var idAgents = Array();
jQuery.each ($("#id_agents option:selected"), function (i, val) {
idAgents.push($(val).val());
});
var params = {
"page" : "operation/agentes/ver_agente",
"get_agent_modules_json_for_multiple_agents" : 1,
"id_agent" : idAgents,
"selection_mode": "common"
};
jQuery.post ("ajax.php",
params,
function (data, status) {
$('#safe_mode_module').empty();
if($.type(data) === "object"){
jQuery.each (data, function (id, value) {
option = $("<option></option>").attr("value", value).html(value);
$("#safe_mode_module").append(option);
});
} else {
option = $("<option></option>").attr("value", 'None').html('None');
$("#safe_mode_module").append(option);
}
},
"json"
);
}
$("#form_agent").submit(function() { $("#form_agent").submit(function() {
var get_parameters_count = window.location.href.slice( var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length; window.location.href.indexOf('?') + 1).split('&').length;
@ -833,7 +929,7 @@ $(document).ready (function () {
$("#id_group").trigger("change"); $("#id_group").trigger("change");
}); });
$("#id_agents").change (function () { $('#id_agents').on('change', function() {
var idAgents = Array(); var idAgents = Array();
jQuery.each ($("#id_agents option:selected"), function (i, val) { jQuery.each ($("#id_agents option:selected"), function (i, val) {
idAgents.push($(val).val()); idAgents.push($(val).val());
@ -858,6 +954,10 @@ $(document).ready (function () {
); );
$("#form_agents").attr("style", ""); $("#form_agents").attr("style", "");
if($("#safe_mode_change").val() == 1) {
refreshSafeModules();
}
}); });
$("#id_group").change (function () { $("#id_group").change (function () {

View File

@ -316,6 +316,9 @@ if (check_acl($config['id_user'], 0, 'PM')) {
$sub2['godmode/setup/setup&amp;section=notifications']['text'] = __('Notifications'); $sub2['godmode/setup/setup&amp;section=notifications']['text'] = __('Notifications');
$sub2['godmode/setup/setup&amp;section=notifications']['refr'] = 0; $sub2['godmode/setup/setup&amp;section=notifications']['refr'] = 0;
$sub2['godmode/setup/setup&amp;section=websocket_engine']['text'] = __('Websocket Engine');
$sub2['godmode/setup/setup&amp;section=websocket_engine']['refr'] = 0;
if ($config['activate_gis']) { if ($config['activate_gis']) {
$sub2['godmode/setup/gis']['text'] = __('Map conections GIS'); $sub2['godmode/setup/gis']['text'] = __('Map conections GIS');
} }

View File

@ -59,52 +59,36 @@ switch ($action) {
$resultOperationDB = false; $resultOperationDB = false;
} else if (!empty($ids_serialize)) { } else if (!empty($ids_serialize)) {
$ids = explode('|', $ids_serialize); $ids = explode('|', $ids_serialize);
switch ($config['dbtype']) {
case 'mysql':
$items = db_get_all_rows_sql( $items = db_get_all_rows_sql(
' 'SELECT id_gs, `field_order`
SELECT id_gs, `field_order`
FROM tgraph_source FROM tgraph_source
WHERE id_graph = '.$id_graph.' WHERE id_graph = '.$id_graph.'
ORDER BY `field_order`' ORDER BY `field_order`'
); );
break;
}
if ($items === false) { if ($items === false) {
$items = []; $items = [];
} }
// Clean the repeated order values // Clean the repeated order values.
$order_temp = 1; $order_temp = 1;
foreach ($items as $item) { foreach ($items as $item) {
switch ($config['dbtype']) {
case 'mysql':
db_process_sql_update( db_process_sql_update(
'tgraph_source', 'tgraph_source',
['`field_order`' => $order_temp], ['`field_order`' => $order_temp],
['id_gs' => $item['id_rc']] ['id_gs' => $item['id_rc']]
); );
break;
}
$order_temp++; $order_temp++;
} }
switch ($config['dbtype']) {
case 'mysql':
$items = db_get_all_rows_sql( $items = db_get_all_rows_sql(
' 'SELECT id_gs, `field_order`
SELECT id_gs, `field_order`
FROM tgraph_source FROM tgraph_source
WHERE id_graph = '.$id_graph.' WHERE id_graph = '.$id_graph.'
ORDER BY `field_order`' ORDER BY `field_order`'
); );
break;
}
if ($items === false) { if ($items === false) {
$items = []; $items = [];
@ -116,7 +100,7 @@ switch ($action) {
$temp = []; $temp = [];
foreach ($items as $item) { foreach ($items as $item) {
// Remove the contents from the block to sort // Remove the contents from the block to sort.
if (array_search($item['id_gs'], $ids) === false) { if (array_search($item['id_gs'], $ids) === false) {
$temp[$item['field_order']] = $item['id_gs']; $temp[$item['field_order']] = $item['id_gs'];
} }
@ -150,16 +134,11 @@ switch ($action) {
foreach ($items as $order => $id) { foreach ($items as $order => $id) {
switch ($config['dbtype']) {
case 'mysql':
db_process_sql_update( db_process_sql_update(
'tgraph_source', 'tgraph_source',
['`field_order`' => ($order + 1)], ['`field_order`' => ($order + 1)],
['id_gs' => $id] ['id_gs' => $id]
); );
break;
}
} }
$resultOperationDB = true; $resultOperationDB = true;
@ -211,7 +190,7 @@ if ($editGraph) {
$weights = implode(',', $weight_array); $weights = implode(',', $weight_array);
} }
// Modules table // Modules table.
if (count($module_array) > 0) { if (count($module_array) > 0) {
echo "<table width='100%' cellpadding=4 cellpadding=4 class='databox filters'>"; echo "<table width='100%' cellpadding=4 cellpadding=4 class='databox filters'>";
echo '<tr> echo '<tr>
@ -224,7 +203,7 @@ if (count($module_array) > 0) {
<th>'.__('Sort').'</th>'; <th>'.__('Sort').'</th>';
$color = 0; $color = 0;
for ($a = 0; $a < count($module_array); $a++) { for ($a = 0; $a < count($module_array); $a++) {
// Calculate table line color // Calculate table line color.
if ($color == 1) { if ($color == 1) {
$tdcolor = 'datos'; $tdcolor = 'datos';
$color = 0; $color = 0;
@ -332,7 +311,7 @@ echo '</form>';
echo '<br>'; echo '<br>';
// Configuration form // Configuration form.
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>'; echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&add_module=1&edit_graph=1&id=".$id_graph."'>"; echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&add_module=1&edit_graph=1&id=".$id_graph."'>";
@ -352,7 +331,7 @@ echo "<td colspan='3'>".html_print_select_groups(
true true
).'</td>'; ).'</td>';
echo '</tr><tr>'; echo '</tr><tr>';
echo "<td style='vertical-align: top;'>".__('Agents').'</td>'; echo "<td style='vertical-align: top;'>".__('Agents').ui_print_help_tip(__('If you select several agents, only the common modules will be displayed'), true).'</td>';
echo '<td></td>'; echo '<td></td>';
echo "<td style='vertical-align: top;'>".__('Modules').'</td>'; echo "<td style='vertical-align: top;'>".__('Modules').'</td>';
echo '</tr><tr>'; echo '</tr><tr>';

View File

@ -125,6 +125,20 @@ if ($report_r && $report_w) {
get_graphs_container(id_container,hash,time); get_graphs_container(id_container,hash,time);
} }
}); });
$("div[id^=period_container_] a").on('click', function(e){
if ($("div[id^=period_container_][id$=_default]").css('display') == 'none') {
$('#refresh_custom_time').show();
$('#refresh_custom_time').on('click', function(e){
var time = $('input[id *= hidden-period_container_'+hash+']').val();
get_graphs_container(id_container,hash,time);
});
}
else if ($("div[id^=period_container_][id$=_manual]").css('display') == 'none') {
$('#refresh_custom_time').hide();
}
});
} }
}); });
} }

View File

@ -290,7 +290,7 @@ $table_aux = new stdClass();
foreach ($result_graphs as $graph) { foreach ($result_graphs as $graph) {
$data = []; $data = [];
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text(io_safe_output($graph['name']), 70).'</a>'; $data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text($graph['name'], 70).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70); $data[1] = ui_print_truncate_text($graph['description'], 70);

View File

@ -454,10 +454,10 @@ if (!$maps && !is_metaconsole()) {
4 => 'action_buttons', 4 => 'action_buttons',
]; ];
$data[3] = '<a class="copy_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image('images/copy.png', true).'</a>'; $data[3] = '<a class="copy_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image('images/copy.png', true).'</a>';
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1">'.html_print_image('images/cross.png', true).'</a>'; $data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image('images/cross.png', true).'</a>';
} else { } else {
$data[3] = '<a class="copy_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image('images/copy.png', true).'</a>'; $data[3] = '<a class="copy_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image('images/copy.png', true).'</a>';
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;delete_layout=1">'.html_print_image('images/cross.png', true).'</a>'; $data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image('images/cross.png', true).'</a>';
} }
} else { } else {
$data[3] = ''; $data[3] = '';

View File

@ -163,7 +163,6 @@ switch ($action) {
$description = null; $description = null;
$sql = null; $sql = null;
$show_in_same_row = 0; $show_in_same_row = 0;
$show_in_landscape = 0;
$hide_notinit_agents = 0; $hide_notinit_agents = 0;
$priority_mode = REPORT_PRIORITY_MODE_OK; $priority_mode = REPORT_PRIORITY_MODE_OK;
$failover_mode = 0; $failover_mode = 0;
@ -171,6 +170,8 @@ switch ($action) {
$server_name = ''; $server_name = '';
$server_id = 0; $server_id = 0;
$dyn_height = 230; $dyn_height = 230;
$landscape = false;
$pagebreak = false;
break; break;
case 'save': case 'save':
@ -208,7 +209,6 @@ switch ($action) {
$description = null; $description = null;
$sql = null; $sql = null;
$show_in_same_row = 0; $show_in_same_row = 0;
$show_in_landscape = 0;
$hide_notinit_agents = 0; $hide_notinit_agents = 0;
$server_name = ''; $server_name = '';
$server_id = 0; $server_id = 0;
@ -236,12 +236,18 @@ switch ($action) {
$name_from_template = $style['name_label']; $name_from_template = $style['name_label'];
$show_in_same_row = $style['show_in_same_row']; $show_in_same_row = $style['show_in_same_row'];
$show_in_landscape = $style['show_in_landscape'];
$hide_notinit_agents = $style['hide_notinit_agents']; $hide_notinit_agents = $style['hide_notinit_agents'];
$dyn_height = $style['dyn_height']; $dyn_height = $style['dyn_height'];
$type = $item['type']; $type = $item['type'];
$name = $style['name_label']; $name = $style['name_label'];
if ($name === null || $name === '') {
$name = $item['name'];
}
$landscape = $item['landscape'];
$pagebreak = $item['pagebreak'];
switch ($type) { switch ($type) {
case 'event_report_log': case 'event_report_log':
$period = $item['period']; $period = $item['period'];
@ -899,6 +905,28 @@ $class = 'databox filters';
</td> </td>
</tr> </tr>
<?php
if ($meta) {
?>
<tr id="row_servers" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Server'); ?></td>
<td style="">
<?php
html_print_select(
$servers,
'combo_server',
$server_name,
'',
__('Local metaconsole'),
0
);
?>
</td>
</tr>
<?php
}
?>
<tr id="row_label" style="" class="datos"> <tr id="row_label" style="" class="datos">
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php <?php
@ -1838,28 +1866,6 @@ $class = 'databox filters';
<td style="" id="max_items_example"></td> <td style="" id="max_items_example"></td>
</tr> </tr>
<?php
if ($meta) {
?>
<tr id="row_servers" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Server'); ?></td>
<td style="">
<?php
html_print_select(
$servers,
'combo_server',
$server_name,
'',
__('Select server'),
0
);
?>
</td>
</tr>
<?php
}
?>
<tr id="row_header" style="" class="datos"> <tr id="row_header" style="" class="datos">
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php <?php
@ -2198,7 +2204,7 @@ $class = 'databox filters';
<tr id="row_show_address_agent" style="" class="datos"> <tr id="row_show_address_agent" style="" class="datos">
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php <?php
echo __('Show address instead module name.').ui_print_help_tip( echo __('Show address instead module name').ui_print_help_tip(
__('Show the main address of agent.'), __('Show the main address of agent.'),
true true
); );
@ -2554,25 +2560,6 @@ $class = 'databox filters';
</td> </td>
</tr> </tr>
<tr id="row_show_in_landscape" style="" class="datos">
<td style="font-weight:bold;">
<?php
echo __('Show in landscape');
?>
</td>
<td>
<?php
html_print_checkbox(
'show_in_landscape',
1,
$show_in_landscape,
false,
false
);
?>
</td>
</tr>
<tr id="row_priority_mode" style="" class="datos"> <tr id="row_priority_mode" style="" class="datos">
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php <?php
@ -2779,6 +2766,24 @@ $class = 'databox filters';
</td> </td>
</tr> </tr>
<tr id="row_landscape" style="" class="datos">
<td style="font-weight:bold;">
<?php
echo __('Show item in landscape format (only PDF)');
?>
</td>
<td><?php html_print_checkbox('landscape', 1, $landscape); ?></td>
</tr>
<tr id="row_pagebreak" style="" class="datos">
<td style="font-weight:bold;">
<?php
echo __('Page break at the end of the item (only PDF)');
?>
</td>
<td><?php html_print_checkbox('pagebreak', 1, $pagebreak); ?></td>
</tr>
</tbody> </tbody>
</table> </table>
@ -3501,6 +3506,30 @@ function print_General_list($width, $action, $idItem=null, $type='general')
} }
echo "<div id='message_no_name' title='".__('Item Editor Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Please select a name.').'</p>';
echo '</div>';
echo "<div id='message_no_agent' title='".__('Item Editor Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Please select an agent.').'</p>';
echo '</div>';
echo "<div id='message_no_module' title='".__('Item Editor Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Please select a module.').'</p>';
echo '</div>';
echo "<div id='message_no_sql_query' title='".__('Item Editor Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Please insert a SQL query.').'</p>';
echo '</div>';
echo "<div id='message_no_url' title='".__('Item Editor Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Please insert a URL.').'</p>';
echo '</div>';
echo "<div id='message_no_interval_option' title='".__('Item Editor Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Please checked a custom interval option.').'</p>';
echo '</div>';
ui_require_javascript_file( ui_require_javascript_file(
'pandora_inventory', 'pandora_inventory',
ENTERPRISE_DIR.'/include/javascript/' ENTERPRISE_DIR.'/include/javascript/'
@ -3517,8 +3546,19 @@ $(document).ready (function () {
// Load selected modules by default // Load selected modules by default
$("#id_agents2").trigger('click'); $("#id_agents2").trigger('click');
$('#combo_server').change (function (){
$("#id_agents").html('');
$("#id_agents2").html('');
$("#module").html('');
$("#inventory_modules").html('');
})
$("#combo_group").change ( $("#combo_group").change (
function () { function () {
$("#id_agents").html('');
$("#id_agents2").html('');
$("#module").html('');
$("#inventory_modules").html('');
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente", {"page" : "operation/agentes/ver_agente",
"get_agents_group_json" : 1, "get_agents_group_json" : 1,
@ -3528,9 +3568,6 @@ $(document).ready (function () {
"recursion" : $('#checkbox-recursion').is(':checked') "recursion" : $('#checkbox-recursion').is(':checked')
}, },
function (data, status) { function (data, status) {
$("#id_agents").html('');
$("#id_agents2").html('');
$("#module").html('');
jQuery.each (data, function (id, value) { jQuery.each (data, function (id, value) {
// Remove keys_prefix from the index // Remove keys_prefix from the index
id = id.substring(1); id = id.substring(1);
@ -3558,9 +3595,7 @@ $(document).ready (function () {
"recursion" : $('#checkbox-recursion').is(':checked') "recursion" : $('#checkbox-recursion').is(':checked')
}, },
function (data, status) { function (data, status) {
$("#id_agents").html('');
$("#id_agents2").html(''); $("#id_agents2").html('');
$("#module").html('');
jQuery.each (data, function (id, value) { jQuery.each (data, function (id, value) {
// Remove keys_prefix from the index // Remove keys_prefix from the index
id = id.substring(1); id = id.substring(1);
@ -3700,6 +3735,12 @@ $(document).ready (function () {
$("#submit-create_item").click(function () { $("#submit-create_item").click(function () {
var type = $('#type').val(); var type = $('#type').val();
var name = $('#text-name').val(); var name = $('#text-name').val();
if($('#text-name').val() == ''){
dialog_message('#message_no_name');
return false;
}
switch (type){ switch (type){
case 'alert_report_module': case 'alert_report_module':
case 'alert_report_agent': case 'alert_report_agent':
@ -3718,8 +3759,22 @@ $(document).ready (function () {
case 'historical_data': case 'historical_data':
case 'agent_configuration': case 'agent_configuration':
case 'module_histogram_graph': case 'module_histogram_graph':
case 'increment':
if ($("#hidden-id_agent").val() == 0) { if ($("#hidden-id_agent").val() == 0) {
alert( <?php echo "'".__('Please select Agent')."'"; ?> ); dialog_message('#message_no_agent');
return false;
}
break;
case 'agent_module':
if ($("select#id_agents2>option:selected").val() == undefined) {
dialog_message('#message_no_agent');
return false;
}
break;
case 'inventory':
case 'inventory_changes':
if ($("select#id_agents>option:selected").val() == undefined) {
dialog_message('#message_no_agent');
return false; return false;
} }
break; break;
@ -3727,16 +3782,85 @@ $(document).ready (function () {
break; break;
} }
if($('#text-name').val() == ''){ switch (type){
alert( <?php echo "'".__('Please insert a name')."'"; ?> ); case 'alert_report_module':
case 'event_report_module':
case 'simple_graph':
case 'simple_baseline_graph':
case 'prediction_date':
case 'projection_graph':
case 'monitor_report':
case 'module_histogram_graph':
case 'avg_value':
case 'max_value':
case 'min_value':
case 'database_serialized':
case 'sumatory':
case 'historical_data':
case 'increment':
if ($("#id_agent_module").val() == 0) {
dialog_message('#message_no_module');
return false; return false;
} }
break;
case 'agent_module':
if ($("select#module>option:selected").val() == undefined) {
dialog_message('#message_no_module');
return false;
}
break;
case 'inventory':
case 'inventory_changes':
if ($("select#inventory_modules>option:selected").val() == 0) {
dialog_message('#message_no_module');
return false;
}
break;
case 'sql':
if ($("#textarea_sql").val() == ''
&& $("select#id_custom>option:selected").val() == 0) {
dialog_message('#message_no_sql_query');
return false;
}
break;
case 'sql_graph_pie':
case 'sql_graph_hbar':
case 'sql_graph_vbar':
if ($("#textarea_sql").val() == '') {
dialog_message('#message_no_sql_query');
return false;
}
break;
case 'url':
if ($("#text-url").val() == '') {
dialog_message('#message_no_url');
return false;
}
break;
default:
break;
}
if (type == 'avg_value' || type == 'max_value' || type == 'min_value') {
if (($('input:radio[name=visual_format]:checked').val() != 1
&& $('input:radio[name=visual_format]:checked').val() != 2
&& $('input:radio[name=visual_format]:checked').val() != 3)
&& $("#checkbox-lapse_calc").is(":checked")) {
dialog_message('#message_no_interval_option');
return false;
}
}
}); });
$("#submit-edit_item").click(function () { $("#submit-edit_item").click(function () {
var type = $('#type').val(); var type = $('#type').val();
if($('#text-name').val() == ''){
dialog_message('#message_no_name');
return false;
}
switch (type){ switch (type){
case 'alert_report_module': case 'alert_report_module':
case 'alert_report_agent': case 'alert_report_agent':
@ -3755,14 +3879,97 @@ $(document).ready (function () {
case 'historical_data': case 'historical_data':
case 'agent_configuration': case 'agent_configuration':
case 'module_histogram_graph': case 'module_histogram_graph':
case 'increment':
if ($("#hidden-id_agent").val() == 0) { if ($("#hidden-id_agent").val() == 0) {
alert( <?php echo "'".__('Please select Agent')."'"; ?> ); dialog_message('#message_no_agent');
return false;
}
break;
case 'agent_module':
if ($("select#id_agents2>option:selected").val() == undefined) {
dialog_message('#message_no_agent');
return false;
}
break;
case 'inventory':
if ($("select#id_agents>option:selected").val() == undefined) {
dialog_message('#message_no_agent');
return false; return false;
} }
break; break;
default: default:
break; break;
} }
switch (type){
case 'alert_report_module':
case 'event_report_module':
case 'simple_graph':
case 'simple_baseline_graph':
case 'prediction_date':
case 'projection_graph':
case 'monitor_report':
case 'module_histogram_graph':
case 'avg_value':
case 'max_value':
case 'min_value':
case 'database_serialized':
case 'sumatory':
case 'historical_data':
case 'increment':
if ($("#id_agent_module").val() == 0) {
dialog_message('#message_no_module');
return false;
}
break;
case 'agent_module':
if ($("select#module>option:selected").val() == undefined) {
dialog_message('#message_no_module');
return false;
}
break;
case 'inventory':
if ($("select#inventory_modules>option:selected").val() == 0) {
dialog_message('#message_no_module');
return false;
}
break;
case 'sql':
if ($("#textarea_sql").val() == ''
&& $("select#id_custom>option:selected").val() == 0) {
dialog_message('#message_no_sql_query');
return false;
}
break;
case 'sql_graph_pie':
case 'sql_graph_hbar':
case 'sql_graph_vbar':
if ($("#textarea_sql").val() == '') {
dialog_message('#message_no_sql_query');
return false;
}
break;
case 'url':
if ($("#text-url").val() == '') {
dialog_message('#message_no_url');
return false;
}
break;
default:
break;
}
if (type == 'avg_value' || type == 'max_value' || type == 'min_value') {
if (($('input:radio[name=visual_format]:checked').val() != 1
&& $('input:radio[name=visual_format]:checked').val() != 2
&& $('input:radio[name=visual_format]:checked').val() != 3)
&& $("#checkbox-lapse_calc").is(":checked")) {
dialog_message('#message_no_interval_option');
return false;
}
}
}); });
$("#checkbox-lapse_calc").change(function () { $("#checkbox-lapse_calc").change(function () {
@ -4472,7 +4679,6 @@ function chooseType() {
$("#row_lapse_calc").hide(); $("#row_lapse_calc").hide();
$("#row_lapse").hide(); $("#row_lapse").hide();
$("#row_visual_format").hide(); $("#row_visual_format").hide();
$("#row_show_in_landscape").hide();
$('#row_hide_notinit_agents').hide(); $('#row_hide_notinit_agents').hide();
$('#row_priority_mode').hide(); $('#row_priority_mode').hide();
$("#row_module_group").hide(); $("#row_module_group").hide();
@ -4974,6 +5180,29 @@ function chooseType() {
$("#id_agents").change(event_change_id_agent_inventory); $("#id_agents").change(event_change_id_agent_inventory);
$("#id_agents").trigger('change'); $("#id_agents").trigger('change');
$("#combo_server").change(function() {
$('#hidden-date_selected').val('');
updateInventoryDates(
<?php
echo '"'.ui_get_full_url(
false,
false,
false,
false
).'"';
?>
);
updateAgents($(this).val(),
<?php
echo '"'.ui_get_full_url(
false,
false,
false,
false
).'"';
?>
);
});
$("#combo_group").change(function() { $("#combo_group").change(function() {
updateAgents($(this).val(), updateAgents($(this).val(),
<?php <?php
@ -5003,6 +5232,30 @@ function chooseType() {
$("#row_servers").show(); $("#row_servers").show();
$("#combo_server").change(function() {
$('#hidden-date_selected').val('');
updateInventoryDates(
<?php
echo '"'.ui_get_full_url(
false,
false,
false,
false
).'"';
?>
);
updateAgents($(this).val(),
<?php
echo '"'.ui_get_full_url(
false,
false,
false,
false
).'"';
?>
);
});
$("#combo_group").change(function() { $("#combo_group").change(function() {
$('#hidden-date_selected').val(''); $('#hidden-date_selected').val('');
updateInventoryDates( updateInventoryDates(
@ -5190,4 +5443,20 @@ function source_change_agents() {
"json" "json"
); );
} }
function dialog_message(message_id) {
$(message_id)
.css("display", "inline")
.dialog({
modal: true,
show: "blind",
hide: "blind",
width: "400px",
buttons: {
Close: function() {
$(this).dialog("close");
}
}
});
}
</script> </script>

View File

@ -386,7 +386,7 @@ if ($items) {
} }
$table->head[4] = __('Time lapse'); $table->head[4] = __('Time lapse');
$table->head[5] = __('Name').' / '.__('Description'); $table->head[5] = __('Name or Description');
if (check_acl($config['id_user'], 0, 'RM')) { if (check_acl($config['id_user'], 0, 'RM')) {
$table->head[6] = '<span title="'.__('Options').'">'.__('Op.').'</span>'; $table->head[6] = '<span title="'.__('Options').'">'.__('Op.').'</span>';
if ($report_w || $report_m) { if ($report_w || $report_m) {

View File

@ -147,7 +147,7 @@ if (enterprise_include_once('include/functions_reporting.php') !== ENTERPRISE_NO
} }
// Constant with fonts directory. // Constant with fonts directory.
define('_MPDF_TTFONTPATH', 'include/fonts/'); define('_MPDF_TTFONTPATH', $config['homedir'].'/include/fonts/');
$activeTab = get_parameter('tab', 'main'); $activeTab = get_parameter('tab', 'main');
$action = get_parameter('action', 'list'); $action = get_parameter('action', 'list');
@ -1207,8 +1207,7 @@ switch ($action) {
$report_id_user = get_parameter('report_id_user'); $report_id_user = get_parameter('report_id_user');
$non_interactive = get_parameter('non_interactive', 0); $non_interactive = get_parameter('non_interactive', 0);
// Pretty font by default for pdf. $custom_font = $config['custom_report_front_font'];
$custom_font = 'FreeSans.ttf';
switch ($type_access_selected) { switch ($type_access_selected) {
case 'group_view': case 'group_view':
@ -1284,7 +1283,6 @@ switch ($action) {
$metaconsole_report = (int) is_metaconsole(); $metaconsole_report = (int) is_metaconsole();
if ($config['custom_report_front']) { if ($config['custom_report_front']) {
$custom_font = $config['custom_report_front_font'];
$logo = $config['custom_report_front_logo']; $logo = $config['custom_report_front_logo'];
$header = $config['custom_report_front_header']; $header = $config['custom_report_front_header'];
$first_page = $config['custom_report_front_firstpage']; $first_page = $config['custom_report_front_firstpage'];
@ -1415,6 +1413,9 @@ switch ($action) {
$name_it $name_it
); );
$values['landscape'] = get_parameter('landscape');
$values['pagebreak'] = get_parameter('pagebreak');
/* /*
Added support for projection graphs, Added support for projection graphs,
prediction date and SLA reports prediction date and SLA reports
@ -1924,10 +1925,6 @@ switch ($action) {
'show_in_same_row', 'show_in_same_row',
0 0
); );
$style['show_in_landscape'] = get_parameter(
'show_in_landscape',
0
);
$style['hide_notinit_agents'] = get_parameter( $style['hide_notinit_agents'] = get_parameter(
'hide_notinit_agents', 'hide_notinit_agents',
0 0
@ -2100,6 +2097,9 @@ switch ($action) {
$name_it $name_it
); );
$values['landscape'] = get_parameter('landscape');
$values['pagebreak'] = get_parameter('pagebreak');
// Support for projection graph, prediction date // Support for projection graph, prediction date
// and SLA reports 'top_n_value', 'top_n' and 'text' // and SLA reports 'top_n_value', 'top_n' and 'text'
// fields will be reused for these types of report. // fields will be reused for these types of report.
@ -2490,10 +2490,6 @@ switch ($action) {
'show_in_same_row', 'show_in_same_row',
0 0
); );
$style['show_in_landscape'] = get_parameter(
'show_in_landscape',
0
);
$style['hide_notinit_agents'] = get_parameter( $style['hide_notinit_agents'] = get_parameter(
'hide_notinit_agents', 'hide_notinit_agents',
0 0

View File

@ -1892,21 +1892,40 @@ function toggle_item_palette() {
$("#text-label_ifr") $("#text-label_ifr")
.contents() .contents()
.find("p") .find("p")
.attr("data-mce-style", "line-height:" + $(this).val() + ";"); .attr("data-mce-style", "line-height:" + $(this).val() + ";")
.attr("data-mce-style", "margin-top:", "-10px;");
$("#text-label_ifr") $("#text-label_ifr")
.contents() .contents()
.find("p") .find("p")
.css("line-height", $(this).val()); .css("line-height", $(this).val())
.css("margin-top", "-10px");
$("#text-label_ifr") $("#text-label_ifr")
.contents() .contents()
.find("span") .find("span")
.attr("data-mce-style", "line-height:" + $(this).val() + ";"); .attr("data-mce-style", "line-height:" + $(this).val() + ";")
.attr("data-mce-style", "margin-top:", "-10px;");
$("#text-label_ifr") $("#text-label_ifr")
.contents() .contents()
.find("span") .find("span")
.css("line-height", $(this).val()); .css("line-height", $(this).val())
.css("margin-top", "-10px");
}); });
if (item == "static_graph") {
$("#text-label_ifr")
.contents()
.find("p")
.css("line-height", $("#lineheight").val())
.css("margin-top", "-10px");
$("#text-label_ifr")
.contents()
.find("span")
.css("line-height", $("#lineheight").val());
$("#text-label_ifr")
.contents()
.find("body")
.css("background", "lightgray");
} else {
$("#text-label_ifr") $("#text-label_ifr")
.contents() .contents()
.find("p") .find("p")
@ -1920,6 +1939,7 @@ function toggle_item_palette() {
.find("body") .find("body")
.css("background", "lightgray"); .css("background", "lightgray");
} }
}
if (creationItem != "simple_value") { if (creationItem != "simple_value") {
$("#data_image_check").html("Off"); $("#data_image_check").html("Off");

View File

@ -15,7 +15,7 @@ global $config;
check_login(); check_login();
// Visual console required // Visual console required.
if (empty($visualConsole)) { if (empty($visualConsole)) {
db_pandora_audit( db_pandora_audit(
'ACL Violation', 'ACL Violation',
@ -425,7 +425,7 @@ $table->data['all_one_item_per_agent'][1] .= html_print_input_hidden(
$table->rowstyle['all_4'] = 'display: none;'; $table->rowstyle['all_4'] = 'display: none;';
$table->data['all_4'][0] = __('Agents'); $table->data['all_4'][0] = __('Agents').ui_print_help_tip(__('If you select several agents, only the common modules will be displayed'), true);
$agents_list = []; $agents_list = [];
if (!is_metaconsole()) { if (!is_metaconsole()) {
@ -506,7 +506,7 @@ $table->data['all_8'][1] = html_print_select(
VISUAL_MAP_WIZARD_PARENTS_NONE, VISUAL_MAP_WIZARD_PARENTS_NONE,
true true
); );
$table->data['all_8'][2] = '<span id="parent_column_2_item_in_visual_map">'.__('Item in the map').'</span>'.'<span id="parent_column_2_relationship">'.ui_print_help_tip( $table->data['all_8'][2] = '<span id="parent_column_2_item_in_visual_map">'.__('Item in the map').'</span><span id="parent_column_2_relationship">'.ui_print_help_tip(
__('The parenting relationships in %s will be drawn on the map.', get_product_name()), __('The parenting relationships in %s will be drawn on the map.', get_product_name()),
true true
).'</span>'; ).'</span>';

View File

@ -398,7 +398,7 @@ if (($create != '') || ($view != '')) {
} }
$data[1] .= ' <a href="index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1&id_plugin='.$form_id.'" style="vertical-align: bottom;">'; $data[1] .= ' <a href="index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1&id_plugin='.$form_id.'" style="vertical-align: bottom;">';
$data[1] .= html_print_image('images/file.png', true); $data[1] .= html_print_image('images/file.png', true, false, false, true);
$data[1] .= '</a>'; $data[1] .= '</a>';
$table->data['plugin_command'] = $data; $table->data['plugin_command'] = $data;

View File

@ -133,6 +133,11 @@ $buttons['notifications'] = [
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=notifications').'">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>', 'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=notifications').'">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
]; ];
$buttons['websocket_engine'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=websocket_engine').'">'.html_print_image('images/websocket_small.png', true, ['title' => __('Websocket engine')]).'</a>',
];
$help_header = ''; $help_header = '';
if (enterprise_installed()) { if (enterprise_installed()) {
$subpage = setup_enterprise_add_subsection_main($section, $buttons, $help_header); $subpage = setup_enterprise_add_subsection_main($section, $buttons, $help_header);
@ -183,6 +188,12 @@ switch ($section) {
$subpage = ' &raquo '.__('Notifications'); $subpage = ' &raquo '.__('Notifications');
break; break;
case 'websocket_engine':
$buttons['websocket_engine']['active'] = true;
$subpage = ' &raquo '.__('Pandora Websocket Engine');
$help_header = 'quickshell_settings';
break;
case 'enterprise': case 'enterprise':
$buttons['enterprise']['active'] = true; $buttons['enterprise']['active'] = true;
$subpage = ' &raquo '.__('Enterprise'); $subpage = ' &raquo '.__('Enterprise');
@ -247,6 +258,10 @@ switch ($section) {
include_once $config['homedir'].'/godmode/setup/setup_notifications.php'; include_once $config['homedir'].'/godmode/setup/setup_notifications.php';
break; break;
case 'websocket_engine':
include_once $config['homedir'].'/godmode/setup/setup_websocket_engine.php';
break;
default: default:
enterprise_hook('setup_enterprise_select_tab', [$section]); enterprise_hook('setup_enterprise_select_tab', [$section]);
break; break;

View File

@ -403,50 +403,6 @@ html_print_table($table_mail_conf);
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset>'; echo '<fieldset>';
echo '<legend>'.__('WebSocket settings').'</legend>';
$t = new StdClass();
$t->data = [];
$t->width = '100%';
$t->class = 'databox filters';
$t->data = [];
$t->style[0] = 'font-weight: bold';
$t->data[0][0] = __('Bind address');
$t->data[0][1] = html_print_input_text(
'ws_bind_address',
$config['ws_bind_address'],
'',
30,
100,
true
);
$t->data[1][0] = __('Bind port');
$t->data[1][2] = html_print_input_text(
'ws_port',
$config['ws_port'],
'',
30,
100,
true
);
$t->data[2][0] = __('WebSocket proxy url').ui_print_help_tip(__('If you had configured a wsproxy set here target URL (for instance ws://your.public.fqdn/ws).'), true);
$t->data[2][2] = html_print_input_text(
'ws_proxy_url',
$config['ws_proxy_url'],
'',
30,
100,
true
);
html_print_input_hidden('update_config', 1);
html_print_table($t);
echo '</fieldset>';
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"'); html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');

View File

@ -1039,17 +1039,37 @@ $row++;
$row++; $row++;
$table_report->data[$row][0] = __('PDF font size'); $table_report->data[$row][0] = __('PDF font size (px)');
$table_report->data[$row][1] = "<input type ='number' value=".$config['font_size_item_report']." size='1' name='font_size_item_report' min='1' max='9' step='0.1'>"; $table_report->data[$row][1] = "<input type ='number' value=".$config['global_font_size_report']." name='global_font_size_report' min='1' max='50' step='1'>";
$row++; $row++;
$table_report->data[$row][0] = __('HTML font size for SLA (em)');
$table_report->data[$row][1] = "<input type ='number' value=".$config['font_size_item_report']." name='font_size_item_report' min='1' max='9' step='0.1'>";
$row++;
$table_report->data[$row][0] = __('PDF font family');
$table_report->data[$row][1] = html_print_select(
$fonts,
'custom_report_front_font',
$config['custom_report_front_font'],
false,
__('Default'),
'',
true
);
$row++;
$table_report->data[$row][0] = __('Graph image height for HTML reports'); $table_report->data[$row][0] = __('Graph image height for HTML reports');
$table_report->data[$row][0] .= ui_print_help_tip( $table_report->data[$row][0] .= ui_print_help_tip(
__('This is the height in pixels of the module graph or custom graph in the reports (only: HTML)'), __('This is the height in pixels of the module graph or custom graph in the reports (only: HTML)'),
true true
); );
$table_report->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true); $table_report->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true);
$row++; $row++;
$interval_description = [ $interval_description = [
@ -1073,18 +1093,6 @@ $row++;
} }
} }
// Font
$table_report->data['custom_report_front-font'][0] = __('Custom report front').' - '.__('Font family');
$table_report->data['custom_report_front-font'][1] = html_print_select(
$fonts,
'custom_report_front_font',
$config['custom_report_front_font'],
false,
__('Default'),
'',
true
);
// Logo // Logo
$table_report->data['custom_report_front-logo'][0] = __('Custom report front').' - '.__('Custom logo').ui_print_help_tip( $table_report->data['custom_report_front-logo'][0] = __('Custom report front').' - '.__('Custom logo').ui_print_help_tip(
__("The dir of custom logos is in your www Console in 'images/custom_logo'. You can upload more files (ONLY JPEG AND PNG) in upload tool in console."), __("The dir of custom logos is in your www Console in 'images/custom_logo'. You can upload more files (ONLY JPEG AND PNG) in upload tool in console."),
@ -1150,7 +1158,6 @@ $row++;
html_print_table($table_report); html_print_table($table_report);
echo '</fieldset>'; echo '</fieldset>';
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// OTHER CONFIGURATION // OTHER CONFIGURATION
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
@ -1429,7 +1436,6 @@ function edit_csv_divider () {
function display_custom_report_front (show,table) { function display_custom_report_front (show,table) {
if (show == true) { if (show == true) {
$('tr#'+table+'-custom_report_front-font').show();
$('tr#'+table+'-custom_report_front-logo').show(); $('tr#'+table+'-custom_report_front-logo').show();
$('tr#'+table+'-custom_report_front-preview').show(); $('tr#'+table+'-custom_report_front-preview').show();
$('tr#'+table+'-custom_report_front-header').show(); $('tr#'+table+'-custom_report_front-header').show();
@ -1437,7 +1443,6 @@ function display_custom_report_front (show,table) {
$('tr#'+table+'-custom_report_front-footer').show(); $('tr#'+table+'-custom_report_front-footer').show();
} }
else { else {
$('tr#'+table+'-custom_report_front-font').hide();
$('tr#'+table+'-custom_report_front-logo').hide(); $('tr#'+table+'-custom_report_front-logo').hide();
$('tr#'+table+'-custom_report_front-preview').hide(); $('tr#'+table+'-custom_report_front-preview').hide();
$('tr#'+table+'-custom_report_front-header').hide(); $('tr#'+table+'-custom_report_front-header').hide();

View File

@ -0,0 +1,98 @@
<?php
/**
* Settings for Pandora Websocket engine.
*
* @category UI file
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org 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.
* ============================================================================
*/
global $config;
$url = ui_get_full_url(
'index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=websocket_engine&amp;pure='.$config['pure']
);
echo '<form id="form_setup" method="post" action="'.$url.'">';
echo '<fieldset>';
echo '<legend>'.__('WebSocket settings').'</legend>';
$t = new StdClass();
$t->data = [];
$t->width = '100%';
$t->class = 'databox filters';
$t->data = [];
$t->style[0] = 'font-weight: bold';
$t->data[0][0] = __('Bind address');
$t->data[0][1] = html_print_input_text(
'ws_bind_address',
$config['ws_bind_address'],
'',
30,
100,
true
);
$t->data[1][0] = __('Bind port');
$t->data[1][2] = html_print_input_text(
'ws_port',
$config['ws_port'],
'',
30,
100,
true
);
$t->data[2][0] = __('WebSocket proxy url').ui_print_help_tip(
__('If you had configured a wsproxy set here target URL (for instance ws://your.public.fqdn/ws).'),
true
);
$t->data[2][2] = html_print_input_text(
'ws_proxy_url',
$config['ws_proxy_url'],
'',
30,
100,
true
);
html_print_input_hidden('update_config', 1);
html_print_table($t);
echo '</fieldset>';
if (function_exists('quickShellSettings') === true) {
quickShellSettings();
}
echo '<div class="action-buttons" style="width: 100%;">';
html_print_submit_button(
__('Update'),
'update_button',
false,
'class="sub upd"'
);
echo '</div>';
echo '</form>';

View File

@ -101,7 +101,7 @@
width: 15px; width: 15px;
} }
.fileupload_form ul li div { .fileupload_form ul li div {
display: block; display: block !important;
} }
.fileupload_form ul li.working span { .fileupload_form ul li.working span {
background-position: 0 -12px; background-position: 0 -12px;

View File

@ -243,6 +243,12 @@ if ($create_user) {
$password_new = ''; $password_new = '';
$password_confirm = ''; $password_confirm = '';
$new_user = true; $new_user = true;
} else if (preg_match('/^\s+|\s+$/', io_safe_output($id))) {
ui_print_error_message(__('Invalid user ID: leading or trailing blank spaces not allowed'));
$user_info = $values;
$password_new = '';
$password_confirm = '';
$new_user = true;
} else if ($password_new == '') { } else if ($password_new == '') {
ui_print_error_message(__('Passwords cannot be empty')); ui_print_error_message(__('Passwords cannot be empty'));
$user_info = $values; $user_info = $values;

View File

@ -514,7 +514,9 @@ class Wizard
$output .= '</li>'; $output .= '</li>';
} else { } else {
if ($input['arguments']['type'] != 'hidden') { if ($input['arguments']['type'] != 'hidden'
&& $input['arguments']['type'] != 'hidden_extended'
) {
if (!$direct) { if (!$direct) {
$output .= '<li id="'.$input['id'].'" class="'.$class.'">'; $output .= '<li id="'.$input['id'].'" class="'.$class.'">';
} }
@ -572,7 +574,9 @@ class Wizard
$output .= '</ul></li>'; $output .= '</ul></li>';
} else { } else {
if ($input['arguments']['type'] != 'hidden') { if ($input['arguments']['type'] != 'hidden'
&& $input['arguments']['type'] != 'hidden_extended'
) {
if ($input['arguments']['inline'] != 'true') { if ($input['arguments']['inline'] != 'true') {
$output .= '<div class="edit_discovery_input">'; $output .= '<div class="edit_discovery_input">';
} else { } else {
@ -675,7 +679,9 @@ class Wizard
$output .= '</ul></li>'; $output .= '</ul></li>';
} else { } else {
if ($input['arguments']['type'] != 'hidden') { if ($input['arguments']['type'] != 'hidden'
&& $input['arguments']['type'] != 'hidden_extended'
) {
$output .= '<li id="'.$input['id'].'" class="'.$class.'">'; $output .= '<li id="'.$input['id'].'" class="'.$class.'">';
$output .= '<label>'.$input['label'].'</label>'; $output .= '<label>'.$input['label'].'</label>';
$output .= $this->printInput($input['arguments']); $output .= $this->printInput($input['arguments']);

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

0
pandora_console/images/default_list.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -84,7 +84,7 @@ $delete_event = get_parameter('delete_event', 0);
$get_event_filters = get_parameter('get_event_filters', 0); $get_event_filters = get_parameter('get_event_filters', 0);
$get_comments = get_parameter('get_comments', 0); $get_comments = get_parameter('get_comments', 0);
$get_events_fired = (bool) get_parameter('get_events_fired'); $get_events_fired = (bool) get_parameter('get_events_fired');
$get_id_source_event = get_parameter('get_id_source_event');
if ($get_comments) { if ($get_comments) {
$event = get_parameter('event', false); $event = get_parameter('event', false);
$filter = get_parameter('filter', false); $filter = get_parameter('filter', false);
@ -128,7 +128,7 @@ if ($get_comments) {
); );
if ($events !== false) { if ($events !== false) {
$event = $events[0]; $event = $events;
} }
} }
@ -231,7 +231,7 @@ if ($save_event_filter) {
$values['id_name'] = get_parameter('id_name'); $values['id_name'] = get_parameter('id_name');
$values['id_group'] = get_parameter('id_group'); $values['id_group'] = get_parameter('id_group');
$values['event_type'] = get_parameter('event_type'); $values['event_type'] = get_parameter('event_type');
$values['severity'] = get_parameter('severity'); $values['severity'] = implode(',', get_parameter('severity', -1));
$values['status'] = get_parameter('status'); $values['status'] = get_parameter('status');
$values['search'] = get_parameter('search'); $values['search'] = get_parameter('search');
$values['text_agent'] = get_parameter('text_agent'); $values['text_agent'] = get_parameter('text_agent');
@ -253,7 +253,7 @@ if ($save_event_filter) {
$values['source'] = get_parameter('source'); $values['source'] = get_parameter('source');
$values['id_extra'] = get_parameter('id_extra'); $values['id_extra'] = get_parameter('id_extra');
$values['user_comment'] = get_parameter('user_comment'); $values['user_comment'] = get_parameter('user_comment');
$values['id_source_event'] = get_parameter('id_source_event');
$exists = (bool) db_get_value_filter( $exists = (bool) db_get_value_filter(
'id_filter', 'id_filter',
'tevent_filter', 'tevent_filter',
@ -278,7 +278,7 @@ if ($update_event_filter) {
$id = get_parameter('id'); $id = get_parameter('id');
$values['id_group'] = get_parameter('id_group'); $values['id_group'] = get_parameter('id_group');
$values['event_type'] = get_parameter('event_type'); $values['event_type'] = get_parameter('event_type');
$values['severity'] = get_parameter('severity'); $values['severity'] = implode(',', get_parameter('severity', -1));
$values['status'] = get_parameter('status'); $values['status'] = get_parameter('status');
$values['search'] = get_parameter('search'); $values['search'] = get_parameter('search');
$values['text_agent'] = get_parameter('text_agent'); $values['text_agent'] = get_parameter('text_agent');
@ -300,6 +300,7 @@ if ($update_event_filter) {
$values['source'] = get_parameter('source'); $values['source'] = get_parameter('source');
$values['id_extra'] = get_parameter('id_extra'); $values['id_extra'] = get_parameter('id_extra');
$values['user_comment'] = get_parameter('user_comment'); $values['user_comment'] = get_parameter('user_comment');
$values['id_source_event'] = get_parameter('id_source_event');
if (io_safe_output($values['tag_with']) == '["0"]') { if (io_safe_output($values['tag_with']) == '["0"]') {
$values['tag_with'] = '[]'; $values['tag_with'] = '[]';
@ -376,8 +377,9 @@ if ($load_filter_modal) {
} }
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;'; $table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
if (!is_metaconsole()) { $filter_id_width = '200px';
$table->style[0] = 'width: 50%; width:50%;'; if (is_metaconsole()) {
$filter_id_width = '150px';
} }
$data = []; $data = [];
@ -390,7 +392,12 @@ if ($load_filter_modal) {
'', '',
__('None'), __('None'),
0, 0,
true true,
false,
true,
'',
false,
'margin-left:5px; width:'.$filter_id_width.';'
); );
$data[1] = html_print_submit_button( $data[1] = html_print_submit_button(
__('Load filter'), __('Load filter'),
@ -411,10 +418,11 @@ function show_filter() {
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: false, modal: false,
closeOnEscape: true closeOnEscape: true,
width: 450
}); });
} }
//aki
function load_form_filter() { function load_form_filter() {
jQuery.post ( jQuery.post (
"<?php echo ui_get_full_url('ajax.php', false, false, false); ?>", "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
@ -431,8 +439,10 @@ function load_form_filter() {
$("#id_group").val(val); $("#id_group").val(val);
if (i == 'event_type') if (i == 'event_type')
$("#event_type").val(val); $("#event_type").val(val);
if (i == 'severity') if (i == 'severity') {
$("#severity").val(val); const multiple = val.split(",");
$("#severity").val(multiple);
}
if (i == 'status') if (i == 'status')
$("#status").val(val); $("#status").val(val);
if (i == 'search') if (i == 'search')
@ -465,6 +475,8 @@ function load_form_filter() {
$("#text-id_extra").val(val); $("#text-id_extra").val(val);
if (i == 'user_comment') if (i == 'user_comment')
$("#text-user_comment").val(val); $("#text-user_comment").val(val);
if (i == 'id_source_event')
$("#text-id_source_event").val(val);
}); });
reorder_tags_inputs(); reorder_tags_inputs();
// Update the info with the loaded filter // Update the info with the loaded filter
@ -685,7 +697,8 @@ function save_new_filter() {
"date_to": $("#text-date_to").val(), "date_to": $("#text-date_to").val(),
"source": $("#text-source").val(), "source": $("#text-source").val(),
"id_extra": $("#text-id_extra").val(), "id_extra": $("#text-id_extra").val(),
"user_comment": $("#text-user_comment").val() "user_comment": $("#text-user_comment").val(),
"id_source_event": $("#text-id_source_event").val()
}, },
function (data) { function (data) {
$("#info_box").hide(); $("#info_box").hide();
@ -754,7 +767,9 @@ function save_update_filter() {
"date_to": $("#text-date_to").val(), "date_to": $("#text-date_to").val(),
"source": $("#text-source").val(), "source": $("#text-source").val(),
"id_extra": $("#text-id_extra").val(), "id_extra": $("#text-id_extra").val(),
"user_comment": $("#text-user_comment").val() "user_comment": $("#text-user_comment").val(),
"id_source_event": $("#text-id_source_event").val()
}, },
function (data) { function (data) {
$(".info_box").hide(); $(".info_box").hide();
@ -908,6 +923,8 @@ if ($perform_event_response) {
$event_response = db_get_row('tevent_response', 'id', $response_id); $event_response = db_get_row('tevent_response', 'id', $response_id);
$command_timeout = $event_response['command_timeout'];
if (enterprise_installed()) { if (enterprise_installed()) {
if ($event_response['server_to_exec'] != 0 && $event_response['type'] == 'command') { if ($event_response['server_to_exec'] != 0 && $event_response['type'] == 'command') {
$commandExclusions = [ $commandExclusions = [
@ -939,7 +956,7 @@ if ($perform_event_response) {
break; break;
} }
system('ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$timeout_bin.' 90 '.io_safe_output($command).' 2>&1"', $ret_val); system('ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$timeout_bin.' '.$command_timeout.' '.io_safe_output($command).' 2>&1"', $ret_val);
} }
} else { } else {
switch (PHP_OS) { switch (PHP_OS) {
@ -956,7 +973,7 @@ if ($perform_event_response) {
break; break;
} }
system($timeout_bin.' 90 '.io_safe_output($command).' 2>&1'); system($timeout_bin.' '.$command_timeout.' '.io_safe_output($command).' 2>&1', $ret_val);
} }
} else { } else {
switch (PHP_OS) { switch (PHP_OS) {
@ -973,7 +990,13 @@ if ($perform_event_response) {
break; break;
} }
system($timeout_bin.' 90 '.io_safe_output($command).' 2>&1'); system($timeout_bin.' '.$command_timeout.' '.io_safe_output($command).' 2>&1', $ret_val);
}
if ($ret_val != 0) {
echo "<div style='text-align:left'>";
echo __('Error executing response');
echo '</div><br>';
} }
return; return;
@ -1283,23 +1306,17 @@ if ($get_extended_event) {
// If metaconsole switch to node to get details and custom fields. // If metaconsole switch to node to get details and custom fields.
if ($meta) { if ($meta) {
$server = metaconsole_get_connection_by_id($server_id); $server = metaconsole_get_connection_by_id($server_id);
metaconsole_connect($server);
} else { } else {
$server = ''; $server = '';
} }
$details = events_page_details($event, $server); $details = events_page_details($event, $server);
if ($meta) {
metaconsole_restore_db();
}
if (events_has_extended_info($event['id_evento']) === true) { if (events_has_extended_info($event['id_evento']) === true) {
$related = events_page_related($event, $server); $related = events_page_related($event, $server);
} }
if ($meta) { if ($meta) {
$server = metaconsole_get_connection_by_id($server_id);
metaconsole_connect($server); metaconsole_connect($server);
} }
@ -1564,7 +1581,7 @@ if ($get_list_events_agents) {
$id_agent = get_parameter('id_agent'); $id_agent = get_parameter('id_agent');
$server_id = get_parameter('server_id'); $server_id = get_parameter('server_id');
$event_type = get_parameter('event_type'); $event_type = get_parameter('event_type');
$severity = get_parameter('severity'); $severity = implode(',', get_parameter('severity', -1));
$status = get_parameter('status'); $status = get_parameter('status');
$search = get_parameter('search'); $search = get_parameter('search');
$id_agent_module = get_parameter('id_agent_module'); $id_agent_module = get_parameter('id_agent_module');

View File

@ -171,8 +171,9 @@ if ($get_graphs) {
'', '',
false, false,
$periods, $periods,
'vertical-align: middle;' 'vertical-align: middle; margin-bottom:0;'
); );
$single_table .= html_print_image('images/refresh_mc.png', true, ['id' => 'refresh_custom_time', 'title' => 'Refresh graph', 'style' => 'cursor:pointer; vertical-align: middle; display:none;']);
$single_table .= '</td>'; $single_table .= '</td>';
$single_table .= '</tr>'; $single_table .= '</tr>';
$single_table .= '</table>'; $single_table .= '</table>';

View File

@ -1141,11 +1141,7 @@ if (check_login()) {
$draw_events = 0; $draw_events = 0;
} }
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;id='.$module['id_agente_modulo'].'&amp;label='.rawurlencode( $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;id='.$module['id_agente_modulo'].'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 700)";
urlencode(
base64_encode($module['nombre'])
)
).'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 700)";
if (!is_snapshot_data($module['datos'])) { if (!is_snapshot_data($module['datos'])) {
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;'; $data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;';
} }

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