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
|
@ -9,6 +9,7 @@ RUN yum -y install \
|
|||
epel-release \
|
||||
unzip \
|
||||
perl \
|
||||
python3 \
|
||||
sed \
|
||||
"perl(Sys::Syslog)"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, AIX version
|
||||
# Version 7.0NG.742, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, FreeBSD Version
|
||||
# Version 7.0NG.742, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# 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,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, GNU/Linux
|
||||
# Version 7.0NG.742, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, GNU/Linux
|
||||
# Version 7.0NG.742, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, Solaris Version
|
||||
# Version 7.0NG.742, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (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
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.740, AIX version
|
||||
# Version 7.0NG.742, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.740
|
||||
# Version 7.0NG.742
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.740, HPUX Version
|
||||
# Version 7.0NG.742, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740
|
||||
# Version 7.0NG.742
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740
|
||||
# Version 7.0NG.742
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740
|
||||
# Version 7.0NG.742
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.740, Solaris version
|
||||
# Version 7.0NG.742, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, AIX version
|
||||
# Version 7.0NG.742, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.740-191122
|
||||
Version: 7.0NG.742-200115
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.740-191122"
|
||||
pandora_version="7.0NG.742-200115"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, GNU/Linux
|
||||
# Version 7.0NG.742, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, FreeBSD Version
|
||||
# Version 7.0NG.742, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# 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,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, GNU/Linux
|
||||
# Version 7.0NG.742, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, GNU/Linux
|
||||
# Version 7.0NG.742, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, NetBSD Version
|
||||
# Version 7.0NG.742, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, Solaris Version
|
||||
# Version 7.0NG.742, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -54,8 +54,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.740';
|
||||
use constant AGENT_BUILD => '191122';
|
||||
use constant AGENT_VERSION => '7.0NG.742';
|
||||
use constant AGENT_BUILD => '200115';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -2882,7 +2882,7 @@ sub cron_valid_date {
|
|||
my $utime;
|
||||
eval {
|
||||
local $SIG{__DIE__} = sub {};
|
||||
$utime = timelocal(0, $min, $hour, $mday, $month, $year);
|
||||
$utime = strftime("%s", 0, $min, $hour, $mday, $month, $year);
|
||||
};
|
||||
if ($@) {
|
||||
return 0;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.740
|
||||
%define release 191122
|
||||
%define version 7.0NG.742
|
||||
%define release 200115
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -24,7 +24,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
|
|||
Requires: fileutils textutils unzip
|
||||
Requires: util-linux procps grep
|
||||
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
|
||||
#Requires: sh-utils sed passwd net-tools rpm
|
||||
AutoReq: 0
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.740
|
||||
%define release 191122
|
||||
%define version 7.0NG.742
|
||||
%define release 200115
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -19,7 +19,7 @@ Prefix: /usr/share
|
|||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||
BuildArch: noarch
|
||||
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
|
||||
Provides: %{name}-%{version}
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.740"
|
||||
PI_BUILD="191122"
|
||||
PI_VERSION="7.0NG.742"
|
||||
PI_BUILD="200115"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -89,7 +89,7 @@ fi
|
|||
[ "$4" ] && PANDORA_PERL_PATH=$4
|
||||
|
||||
# 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" ]
|
||||
then
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (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
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.740}
|
||||
{Pandora FMS Windows Agent v7.0NG.742}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{191122}
|
||||
{200115}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -1708,3 +1708,17 @@ void
|
|||
Pandora_Module::setExecutions (long 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;
|
||||
}
|
||||
|
|
|
@ -303,6 +303,7 @@ namespace Pandora_Modules {
|
|||
time_t getTimestamp ();
|
||||
void setIntensiveMatch (unsigned char intensive_match);
|
||||
unsigned char getIntensiveMatch ();
|
||||
bool isIntensive ();
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#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_dir;
|
||||
|
|
|
@ -1918,16 +1918,19 @@ Pandora_Windows_Service::pandora_run_broker (string config, long executions) {
|
|||
}
|
||||
|
||||
/* Evaluate intensive conditions */
|
||||
intensive_match = module->evaluateIntensiveConditions ();
|
||||
if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
|
||||
module->setNoOutput ();
|
||||
this->broker_modules->goNext ();
|
||||
continue;
|
||||
}
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
if (module->isIntensive()) {
|
||||
intensive_match = module->evaluateIntensiveConditions ();
|
||||
if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
|
||||
module->setNoOutput ();
|
||||
this->broker_modules->goNext ();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
}
|
||||
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
}
|
||||
|
||||
/* Evaluate module conditions */
|
||||
|
@ -2038,16 +2041,19 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
|
|||
}
|
||||
|
||||
/* Evaluate intensive conditions */
|
||||
intensive_match = module->evaluateIntensiveConditions ();
|
||||
if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
|
||||
module->setNoOutput ();
|
||||
this->modules->goNext ();
|
||||
continue;
|
||||
}
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
if (module->isIntensive()) {
|
||||
intensive_match = module->evaluateIntensiveConditions ();
|
||||
if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
|
||||
module->setNoOutput ();
|
||||
this->modules->goNext ();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
}
|
||||
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
}
|
||||
|
||||
/* Evaluate module conditions */
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
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"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.740-191122
|
||||
Version: 7.0NG.742-200115
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.740-191122"
|
||||
pandora_version="7.0NG.742-200115"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -798,11 +798,7 @@ function mainAgentsModules()
|
|||
echo "<td style='text-align: center;'>";
|
||||
$win_handle = dechex(crc32($module_id.$module['name']));
|
||||
$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(
|
||||
urlencode(
|
||||
base64_encode($module['name'])
|
||||
)
|
||||
).'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."')";
|
||||
$link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."')";
|
||||
|
||||
echo '<a href="javascript:'.$link.'">';
|
||||
switch ($status) {
|
||||
|
|
|
@ -22,6 +22,17 @@ function dbmanager_query($sql, &$error, $dbconnection)
|
|||
}
|
||||
|
||||
$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']) {
|
||||
$result = mysqli_query($dbconnection, $sql);
|
||||
if ($result === false) {
|
||||
|
|
|
@ -64,9 +64,11 @@ if (!empty($files)) {
|
|||
$document_root = str_replace('\\', '/', io_safe_output($_SERVER['DOCUMENT_ROOT']));
|
||||
$file['location'] = str_replace('\\', '/', io_safe_output($file['location']));
|
||||
$relative_path = str_replace($document_root, '', $file['location']);
|
||||
$file_path = base64_encode($relative_path);
|
||||
$hash = md5($relative_path.$config['dbpass']);
|
||||
$url = ui_get_full_url("include/get_file.php?file=$file_path&hash=$hash");
|
||||
$file_name = explode('/', $file['location']);
|
||||
$file_decoded = $file_name[(count($file_name) - 1)];
|
||||
$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';
|
||||
|
||||
$data[0] = "<a href=\"$url\" target=\"_blank\">".$file['name'].'</a>';
|
||||
|
|
|
@ -312,7 +312,7 @@ function main_net_tools()
|
|||
$ips = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT ip FROM taddress WHERE id_a IN (%s)',
|
||||
join($ids)
|
||||
join(',', $ids)
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -65,17 +65,13 @@ function quickShell()
|
|||
ui_require_css_file('discovery');
|
||||
|
||||
// Settings.
|
||||
// WebSocket host, where to connect.
|
||||
if (isset($config['ws_host']) === false) {
|
||||
config_update_value('ws_host', $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
// WebSocket host, where client should connect.
|
||||
if (isset($config['ws_port']) === false) {
|
||||
config_update_value('ws_port', 8080);
|
||||
}
|
||||
|
||||
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 {
|
||||
preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches);
|
||||
if (isset($_SERVER['HTTPS']) === true) {
|
||||
|
@ -313,7 +309,7 @@ function quickShellSettings()
|
|||
}
|
||||
|
||||
// Parser.
|
||||
if (get_parameter('qs_update', false) !== false) {
|
||||
if (get_parameter('update_config', false) !== false) {
|
||||
// Gotty settings. Internal communication (WS).
|
||||
$gotty = get_parameter(
|
||||
'gotty',
|
||||
|
@ -381,14 +377,6 @@ function quickShellSettings()
|
|||
}
|
||||
}
|
||||
|
||||
// Interface.
|
||||
ui_print_page_header(
|
||||
__('QuickShell settings'),
|
||||
'',
|
||||
false,
|
||||
'quickshell_settings'
|
||||
);
|
||||
|
||||
if ($changes > 0) {
|
||||
$msg = __('%d Updated', $changes);
|
||||
if ($critical > 0) {
|
||||
|
@ -401,100 +389,105 @@ function quickShellSettings()
|
|||
ui_print_success_message($msg);
|
||||
}
|
||||
|
||||
// Form.
|
||||
$wiz = new Wizard();
|
||||
// Form. Using old style.
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('Quickshell').'</legend>';
|
||||
|
||||
$wiz->printForm(
|
||||
[
|
||||
'form' => [
|
||||
'action' => '#',
|
||||
'class' => 'wizard',
|
||||
'method' => 'post',
|
||||
],
|
||||
'inputs' => [
|
||||
[
|
||||
'label' => __('Gotty path').ui_print_help_tip(
|
||||
__('Leave blank if using an external Gotty service'),
|
||||
true
|
||||
),
|
||||
'arguments' => [
|
||||
'type' => 'text',
|
||||
'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,
|
||||
$t = new StdClass();
|
||||
$t->data = [];
|
||||
$t->width = '100%';
|
||||
$t->class = 'databox filters';
|
||||
$t->data = [];
|
||||
$t->style = [];
|
||||
$t->style[0] = 'font-weight: bold; width: 40%;';
|
||||
|
||||
$t->data[0][0] = __('Gotty path');
|
||||
$t->data[0][1] = html_print_input_text(
|
||||
'gotty',
|
||||
$config['gotty'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
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');
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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;
|
||||
|
||||
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 available memory percent','Available memory %',43,34,0,0,300,0,'free | grep Mem | awk '{print $NF/$2 * 100}'','','','',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 available disk /','Available free space in mountpoint /',43,34,0,0,300,0,'df / | tail -n +2 | awk '{print $(NF-1)}' | tr -d '%'','','','',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_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';
|
||||
|
||||
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` (
|
||||
`id` SERIAL,
|
||||
`name` varchar(150) NOT NULL,
|
||||
|
@ -48,6 +84,12 @@ CREATE TABLE `tremote_command_target` (
|
|||
|
||||
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 `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;
|
||||
|
|
|
@ -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;
|
|
@ -1,5 +1,7 @@
|
|||
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"}');
|
||||
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;
|
||||
|
|
|
@ -579,6 +579,39 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` (
|
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
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`
|
||||
|
@ -627,6 +660,9 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` (
|
|||
PRIMARY KEY (`id`)
|
||||
) 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`
|
||||
-- -----------------------------------------------------
|
||||
|
@ -728,6 +764,8 @@ CREATE TABLE IF NOT EXISTS `treport_template` (
|
|||
`footer` MEDIUMTEXT default NULL,
|
||||
`custom_font` varchar(200) default NULL,
|
||||
`metaconsole` tinyint(1) DEFAULT 0,
|
||||
`agent_regex` varchar(600) NOT NULL default '',
|
||||
|
||||
PRIMARY KEY(`id_report`)
|
||||
) 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` int(11) unsigned NOT NULL DEFAULT '300',
|
||||
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`
|
||||
|
@ -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 `module_status` int(4) NOT NULL default '0';
|
||||
ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmetaconsole_event_history`
|
||||
|
@ -1154,6 +1195,8 @@ CREATE TABLE IF NOT EXISTS `tmap` (
|
|||
`generation_method` INTEGER UNSIGNED NOT NULL default 0,
|
||||
`generated` INTEGER UNSIGNED NOT NULL default 0,
|
||||
`filter` TEXT,
|
||||
`id_group_map` INT(10) UNSIGNED NOT NULL default 0,
|
||||
|
||||
PRIMARY KEY(`id`)
|
||||
) 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 ('small_operation_step_datos_purge', '1000');
|
||||
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_support_logo', 'default_support.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';
|
||||
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');
|
||||
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';
|
||||
|
@ -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 `source` 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 `severity` text NOT NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- 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 `failover_mode` 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`
|
||||
|
@ -1736,6 +1783,7 @@ ALTER TABLE tserver ADD COLUMN exec_proxy tinyint(1) UNSIGNED NOT NULL default 0
|
|||
-- 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 command_timeout int(5) unsigned NOT NULL DEFAULT 90;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- 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 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 `tmetaconsole_agent_secondary_group` ADD INDEX `id_tagente` (`id_tagente`);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tautoconfig`
|
||||
|
@ -2357,7 +2406,7 @@ CREATE TABLE `tvisual_console_elements_cache` (
|
|||
CREATE TABLE IF NOT EXISTS `tcredential_store` (
|
||||
`identifier` varchar(100) NOT NULL,
|
||||
`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,
|
||||
`password` text,
|
||||
`extra_1` text,
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
require_once 'include/functions_messages.php';
|
||||
require_once 'include/functions_servers.php';
|
||||
require_once 'include/functions_notifications.php';
|
||||
require_once 'include/ajax/order_interpreter.php';
|
||||
ui_require_css_file('order_interpreter');
|
||||
|
||||
// Check permissions
|
||||
// Global errors/warnings checking.
|
||||
|
@ -99,7 +101,8 @@ if ($config['menu_type'] == 'classic') {
|
|||
|
||||
if ($acl_head_search) {
|
||||
// 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'])) {
|
||||
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
|
||||
} 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'])) {
|
||||
$search_bar .= "value='".__('Enter keywords to search')."'";
|
||||
} else if (strlen($config['search_keywords']) == 0) {
|
||||
|
@ -119,9 +122,11 @@ if ($config['menu_type'] == 'classic') {
|
|||
$search_bar .= "value='".$config['search_keywords']."'";
|
||||
}
|
||||
|
||||
$search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
|
||||
onkeyup="javascript: fieldKeyWordEmpty = false;" class="search_input" />';
|
||||
$search_bar .= 'type="search" onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
|
||||
onkeyup="showinterpreter()" class="search_input"/>';
|
||||
|
||||
|
||||
$search_bar .= '<div id="result_order" class="result_order"></div>';
|
||||
// $search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
|
||||
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
|
||||
$search_bar .= '</form>';
|
||||
|
@ -622,7 +627,7 @@ if ($config['menu_type'] == 'classic') {
|
|||
});
|
||||
}
|
||||
|
||||
// Resize event
|
||||
// Resize event.
|
||||
window.addEventListener("resize", function() {
|
||||
attatch_to_image();
|
||||
});
|
||||
|
@ -630,7 +635,86 @@ if ($config['menu_type'] == 'classic') {
|
|||
var fixed_header = <?php echo json_encode((bool) $config_fixed_header); ?>;
|
||||
|
||||
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.
|
||||
*/
|
||||
|
|
|
@ -82,12 +82,18 @@ if (!empty($page) && !empty($sec)) {
|
|||
}
|
||||
|
||||
$login_body_style = '';
|
||||
$login_body_class = '';
|
||||
// Overrides the default background with the defined by the user.
|
||||
if (!empty($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."');\"";
|
||||
}
|
||||
|
||||
// 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.
|
||||
$custom_fields = [
|
||||
'custom_logo_login',
|
||||
|
@ -111,7 +117,7 @@ foreach ($custom_fields as $field) {
|
|||
// Get the custom icons.
|
||||
$docs_logo = ui_get_docs_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="list_icon_docs_support"><ul>';
|
||||
|
|
|
@ -40,7 +40,7 @@ if (!empty($news)) {
|
|||
// Prints news dialog template
|
||||
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="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>';
|
||||
|
|
|
@ -612,17 +612,19 @@ if (enterprise_installed()) {
|
|||
$cascade_protection,
|
||||
true
|
||||
).__('Cascade protection').' ';
|
||||
|
||||
$table_adv_parent .= __('Module').' '.html_print_select(
|
||||
$modules_values,
|
||||
'cascade_protection_module',
|
||||
$cascade_protection_module,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table_adv_parent .= __('Module').' '.html_print_select(
|
||||
$modules_values,
|
||||
'cascade_protection_module',
|
||||
$cascade_protection_module,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
).'</div></div>';
|
||||
$table_adv_parent .= '</div></div>';
|
||||
|
||||
// Learn mode / Normal mode.
|
||||
$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,
|
||||
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>';
|
||||
|
||||
// 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.
|
||||
$table_adv_options = '
|
||||
<div class="secondary_groups_list">
|
||||
'.$adv_secondary_groups_label.'
|
||||
$table_adv_options = $advanced_div.$adv_secondary_groups_label.'
|
||||
<div class="sg_source">
|
||||
'.$adv_secondary_groups_left.'
|
||||
</div>
|
||||
|
|
|
@ -546,7 +546,7 @@ if ($create_modules) {
|
|||
$module_values = $common_values;
|
||||
|
||||
$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_plugin'] = $plugin['id'];
|
||||
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
<?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;
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
require_once 'include/functions_modules.php';
|
||||
|
@ -23,19 +25,19 @@ require_once 'include/graphs/functions_utils.php';
|
|||
check_login();
|
||||
|
||||
$ip_target = (string) get_parameter('ip_target', $ipAgent);
|
||||
// Host
|
||||
// Host.
|
||||
$plugin_user = (string) get_parameter('plugin_user', 'Administrator');
|
||||
// Username
|
||||
// Username.
|
||||
$plugin_pass = io_safe_output(get_parameter('plugin_pass', ''));
|
||||
// Password
|
||||
// Password.
|
||||
$tcp_send = (string) get_parameter('tcp_send');
|
||||
// Namespace
|
||||
// Namespace.
|
||||
$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;
|
||||
|
||||
// Get passed variables
|
||||
// Get passed variables.
|
||||
$wmiexplore = (int) get_parameter('wmiexplore', 0);
|
||||
$create_modules = (int) get_parameter('create_modules', 0);
|
||||
|
||||
|
@ -44,24 +46,30 @@ $interfaces = [];
|
|||
$wmi_client = 'wmic';
|
||||
|
||||
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 = [];
|
||||
$services = [];
|
||||
$disks = [];
|
||||
$network_component_groups = [];
|
||||
|
||||
// Processes
|
||||
// Processes.
|
||||
$wmi_processes = $wmi_command.' "select Name from Win32_Process"';
|
||||
$processes_name_field = 1;
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if ($server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_processes."'", $output, $rc);
|
||||
} else {
|
||||
exec($wmi_processes, $output);
|
||||
}
|
||||
if (enterprise_installed() && (int) $server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec(
|
||||
'ssh pandora_exec_proxy@'.$server_data['ip_address']."
|
||||
'".$wmi_processes."'",
|
||||
$output,
|
||||
$rc
|
||||
);
|
||||
} else {
|
||||
exec($wmi_processes, $output);
|
||||
}
|
||||
|
@ -73,7 +81,7 @@ if ($wmiexplore) {
|
|||
|
||||
if (!$fail) {
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
|
@ -81,60 +89,74 @@ if ($wmiexplore) {
|
|||
$row_exploded = explode('|', $row);
|
||||
|
||||
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);
|
||||
|
||||
// Services
|
||||
// Services.
|
||||
$wmi_services = $wmi_command.' "select Name from Win32_Service"';
|
||||
$services_name_field = 0;
|
||||
$services_check_field = 1;
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if ($server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_services."'", $output, $rc);
|
||||
} else {
|
||||
exec($wmi_services, $output);
|
||||
}
|
||||
if (enterprise_installed() && (int) $server_to_exec != 0) {
|
||||
$server_data = db_get_row(
|
||||
'tserver',
|
||||
'id_server',
|
||||
$server_to_exec
|
||||
);
|
||||
exec(
|
||||
'ssh pandora_exec_proxy@'.$server_data['ip_address']."
|
||||
'".$wmi_services."'",
|
||||
$output,
|
||||
$rc
|
||||
);
|
||||
} else {
|
||||
exec($wmi_services, $output);
|
||||
}
|
||||
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$row_exploded = explode('|', $row);
|
||||
$row_exploded = explode('|', $row);
|
||||
|
||||
if (!in_array($row_exploded[$services_name_field], $services)) {
|
||||
$services[$row_exploded[$services_name_field]] = $row_exploded[$services_name_field];
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($output);
|
||||
|
||||
// Disks
|
||||
// Disks.
|
||||
$wmi_disks = $wmi_command.' "Select DeviceID from Win32_LogicalDisk"';
|
||||
$disks_name_field = 0;
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if ($server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_disks."'", $output, $rc);
|
||||
} else {
|
||||
exec($wmi_disks, $output);
|
||||
}
|
||||
if (enterprise_installed() && (int) $server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec(
|
||||
'ssh pandora_exec_proxy@'.$server_data['ip_address']."
|
||||
'".$wmi_disks."'",
|
||||
$output,
|
||||
$rc
|
||||
);
|
||||
} else {
|
||||
exec($wmi_disks, $output);
|
||||
}
|
||||
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
|
@ -142,14 +164,21 @@ if ($wmiexplore) {
|
|||
$row_exploded = explode('|', $row);
|
||||
|
||||
if (!in_array($row_exploded[$disks_name_field], $services)) {
|
||||
$disk_string = sprintf(__('Free space on %s'), $row_exploded[$disks_name_field]);
|
||||
$disks[$row_exploded[$disks_name_field]] = $disk_string;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($output);
|
||||
|
||||
// WMI Components
|
||||
// WMI Components.
|
||||
$network_component_groups = network_components_get_groups(MODULE_WMI);
|
||||
}
|
||||
}
|
||||
|
@ -163,14 +192,14 @@ if ($create_modules) {
|
|||
$components = [];
|
||||
|
||||
foreach ($modules as $module) {
|
||||
// Split module data to get type
|
||||
// Split module data to get type.
|
||||
$module_exploded = explode('_', $module);
|
||||
$type = $module_exploded[0];
|
||||
|
||||
// Delete type from module data
|
||||
// Delete type from module data.
|
||||
unset($module_exploded[0]);
|
||||
|
||||
// Rebuild module data
|
||||
// Rebuild module data.
|
||||
$module = implode('_', $module_exploded);
|
||||
|
||||
switch ($type) {
|
||||
|
@ -189,10 +218,14 @@ if ($create_modules) {
|
|||
case 'component':
|
||||
$components[] = $module;
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Common values for WMI modules
|
||||
// Common values for WMI modules.
|
||||
$values = [
|
||||
'ip_target' => $ip_target,
|
||||
'tcp_send' => $tcp_send,
|
||||
|
@ -202,7 +235,10 @@ if ($create_modules) {
|
|||
];
|
||||
|
||||
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);
|
||||
|
||||
if ($row['server_type'] == 13) {
|
||||
|
@ -210,89 +246,146 @@ if ($create_modules) {
|
|||
}
|
||||
}
|
||||
|
||||
// Create Service modules
|
||||
// Create Service modules.
|
||||
$services_values = $values;
|
||||
|
||||
$services_values['snmp_community'] = 'Running';
|
||||
// Key string
|
||||
// Key string.
|
||||
$services_values['tcp_port'] = 1;
|
||||
// Field number (Running/Stopped)
|
||||
// Field number (Running/Stopped).
|
||||
$services_values['id_tipo_modulo'] = 2;
|
||||
// Generic boolean
|
||||
$services_result = wmi_create_wizard_modules($id_agent, $services, 'services', $services_values, 0, 0, $server_to_exec);
|
||||
// Generic boolean.
|
||||
$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['tcp_port'] = 0;
|
||||
// Field number (OID)
|
||||
// Field number (OID).
|
||||
$processes_values['id_tipo_modulo'] = 2;
|
||||
// Generic boolean
|
||||
$processes_result = wmi_create_wizard_modules($id_agent, $processes, 'processes', $processes_values, 0, 0, $server_to_exec);
|
||||
// Generic boolean.
|
||||
$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['tcp_port'] = 1;
|
||||
// Free space in bytes
|
||||
// Free space in bytes.
|
||||
$disks_values['id_tipo_modulo'] = 1;
|
||||
// Generic numeric
|
||||
// Generic numeric.
|
||||
$disks_values['unit'] = 'Bytes';
|
||||
// Unit
|
||||
$disks_result = wmi_create_wizard_modules($id_agent, $disks, 'disks', $disks_values, 0, 0, $server_to_exec);
|
||||
// Unit.
|
||||
$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['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 = '';
|
||||
$error_message = '';
|
||||
if (!empty($services_result)) {
|
||||
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) {
|
||||
$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 (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) {
|
||||
$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 (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) {
|
||||
$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 (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) {
|
||||
$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) {
|
||||
$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 "<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->cellpadding = 0;
|
||||
|
@ -314,18 +409,47 @@ $table->cellspacing = 0;
|
|||
$table->class = 'databox filters';
|
||||
|
||||
$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][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][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][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);
|
||||
|
||||
$servers_to_exec = [];
|
||||
|
@ -346,13 +470,27 @@ if (enterprise_installed()) {
|
|||
}
|
||||
|
||||
$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);
|
||||
|
||||
echo "<div style='text-align:right; width:".$table->width."'>";
|
||||
echo '<span id="oid_loading" class="invisible">'.html_print_image('images/spinner.gif', true).'</span>';
|
||||
html_print_submit_button(__('WMI Explore'), 'wmi_explore', false, ['class' => 'sub next']);
|
||||
echo '<span id="oid_loading" class="invisible">
|
||||
'.html_print_image('images/spinner.gif', true).'</span>';
|
||||
html_print_submit_button(
|
||||
__('WMI Explore'),
|
||||
'wmi_explore',
|
||||
false,
|
||||
['class' => 'sub next']
|
||||
);
|
||||
echo '</div><br>';
|
||||
|
||||
if ($wmiexplore && $fail) {
|
||||
|
@ -365,23 +503,25 @@ echo '</form>';
|
|||
|
||||
if ($wmiexplore && !$fail) {
|
||||
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">';
|
||||
|
||||
html_print_input_hidden('create_modules', 1);
|
||||
html_print_input_hidden('ip_target', $ip_target);
|
||||
// Host
|
||||
// Host.
|
||||
html_print_input_hidden('plugin_user', $plugin_user);
|
||||
// User
|
||||
// User.
|
||||
html_print_input_hidden('plugin_pass', $plugin_pass);
|
||||
// Password
|
||||
// Password.
|
||||
html_print_input_hidden('tcp_send', $tcp_send);
|
||||
// Namespace
|
||||
// Namespace.
|
||||
html_print_input_hidden('server_to_exec', $server_to_exec);
|
||||
|
||||
$table->width = '100%';
|
||||
|
||||
// Mode selector
|
||||
// Mode selector.
|
||||
$modes = [];
|
||||
$modes['services'] = __('Services');
|
||||
$modes['processes'] = __('Processes');
|
||||
|
@ -406,7 +546,7 @@ if ($wmiexplore && !$fail) {
|
|||
$table->data[1][2] = '<b>'.__('Modules').'</b>';
|
||||
$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] .= __('Filter by group').'<br>';
|
||||
$table->data[2][0] .= html_print_select(
|
||||
|
@ -439,7 +579,7 @@ if ($wmiexplore && !$fail) {
|
|||
);
|
||||
$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] .= html_print_select(
|
||||
$services,
|
||||
|
@ -456,8 +596,7 @@ if ($wmiexplore && !$fail) {
|
|||
'width: 300px;'
|
||||
);
|
||||
$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] .= html_print_select(
|
||||
$processes,
|
||||
|
@ -474,11 +613,13 @@ if ($wmiexplore && !$fail) {
|
|||
'width: 300px;'
|
||||
);
|
||||
$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] .= '</span>';
|
||||
|
||||
// Disks list
|
||||
// Disks list.
|
||||
$table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_disks">';
|
||||
$table->data[2][0] .= html_print_select(
|
||||
$disks,
|
||||
|
@ -498,27 +639,79 @@ if ($wmiexplore && !$fail) {
|
|||
$table->cellstyle[2][0] = 'vertical-align: bottom; text-align: center;';
|
||||
|
||||
|
||||
// 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>';
|
||||
// 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>';
|
||||
// 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>';
|
||||
// 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->data[2][2] = html_print_select([], '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->data[2][2] = html_print_select(
|
||||
[],
|
||||
'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;';
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
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>';
|
||||
unset($table);
|
||||
|
||||
|
@ -650,5 +843,4 @@ $(document).ready (function () {
|
|||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
</script>
|
|
@ -466,11 +466,11 @@ $data[1] = html_print_select(
|
|||
|
||||
$array_os = [
|
||||
'inherited' => __('Inherited'),
|
||||
'linux' => __('Linux'),
|
||||
'windows' => __('Windows'),
|
||||
'linux' => __('SSH'),
|
||||
'windows' => __('Windows remote'),
|
||||
];
|
||||
|
||||
$data[2] = __('Target OS');
|
||||
$data[2] = __('Connection method');
|
||||
$data[3] = html_print_select(
|
||||
$array_os,
|
||||
'command_os',
|
||||
|
@ -541,14 +541,12 @@ $(document).ready (function () {
|
|||
$("#simple-field_snmpv3_row2").attr("style", "");
|
||||
$("#simple-field_snmpv3_row3").attr("style", "");
|
||||
$("input[name=active_snmp_v3]").val(1);
|
||||
$("input[name=snmp_community]").attr("disabled", true);
|
||||
}
|
||||
else {
|
||||
$("#simple-field_snmpv3_row1").css("display", "none");
|
||||
$("#simple-field_snmpv3_row2").css("display", "none");
|
||||
$("#simple-field_snmpv3_row3").css("display", "none");
|
||||
$("input[name=active_snmp_v3]").val(0);
|
||||
$("input[name=snmp_community]").removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -32,19 +32,6 @@ if (! check_acl($config['id_user'], 0, 'LM')) {
|
|||
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');
|
||||
$create_action = (bool) get_parameter('create_action');
|
||||
$delete_action = (bool) get_parameter('delete_action');
|
||||
|
@ -57,15 +44,22 @@ if (defined('METACONSOLE')) {
|
|||
$sec = 'galertas';
|
||||
}
|
||||
|
||||
if ((!$copy_action) && (!$delete_action)) {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_action', true);
|
||||
}
|
||||
}
|
||||
// Header.
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
$header_help = 'alerts_action';
|
||||
|
||||
if ($copy_action) {
|
||||
$header_help = 'alerts_config';
|
||||
}
|
||||
|
||||
if ($delete_action) {
|
||||
$header_help = 'alerts_action';
|
||||
}
|
||||
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, $header_help, true);
|
||||
}
|
||||
|
||||
if ($copy_action) {
|
||||
$id = get_parameter('id');
|
||||
|
@ -83,13 +77,6 @@ if ($copy_action) {
|
|||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
} else {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
|
||||
}
|
||||
}
|
||||
} //end if
|
||||
else {
|
||||
|
@ -102,14 +89,7 @@ if ($copy_action) {
|
|||
|
||||
$is_in_group = in_array($al_action['id_group'], $own_groups);
|
||||
// Then action group have to be in his own groups
|
||||
if ($is_in_group) {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
|
||||
}
|
||||
} else {
|
||||
if (!$is_in_group) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access Alert Management'
|
||||
|
@ -118,13 +98,6 @@ if ($copy_action) {
|
|||
exit;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
|
||||
}
|
||||
}
|
||||
|
||||
$result = alerts_clone_alert_action($id);
|
||||
|
@ -162,13 +135,6 @@ if ($delete_action) {
|
|||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
} else {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alert_action', true);
|
||||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
// Then action group have to be in his own groups
|
||||
if ($is_in_group) {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alert_action', true);
|
||||
}
|
||||
} else {
|
||||
if (!$is_in_group) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access Alert Management'
|
||||
|
@ -198,9 +157,6 @@ if ($delete_action) {
|
|||
exit;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Header
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, '', true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -285,10 +241,14 @@ foreach ($actions as $action) {
|
|||
2 => 'action_buttons',
|
||||
3 => 'action_buttons',
|
||||
];
|
||||
$data[2] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&copy_action=1&id='.$action['id'].'&pure='.$pure.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true).'</a>';
|
||||
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&delete_action=1&id='.$action['id'].'&pure='.$pure.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>';
|
||||
|
||||
$id_action = $action['id'];
|
||||
$text_confirm = __('Are you sure?');
|
||||
|
||||
$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);
|
||||
|
@ -308,3 +268,45 @@ echo '</form>';
|
|||
echo '</div>';
|
||||
|
||||
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>
|
||||
|
||||
|
|
|
@ -140,14 +140,8 @@ $table->colspan[0][1] = 2;
|
|||
$table->data[1][0] = __('Group');
|
||||
|
||||
$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->data[2][0] = __('Command');
|
||||
|
@ -173,9 +167,9 @@ $table->data[2][1] = html_print_select_from_sql(
|
|||
);
|
||||
$table->data[2][1] .= ' ';
|
||||
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] .= '<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>';
|
||||
}
|
||||
|
||||
|
@ -320,18 +314,18 @@ $(document).ready (function () {
|
|||
original_command = data["command"];
|
||||
render_command_preview (original_command);
|
||||
command_description = data["description"];
|
||||
render_command_description(command_description);
|
||||
if (command_description != undefined) {
|
||||
render_command_description(command_description);
|
||||
} else {
|
||||
render_command_description('');
|
||||
|
||||
}
|
||||
|
||||
var max_fields = parseInt('<?php echo $config['max_macro_fields']; ?>');
|
||||
|
||||
// Change the selected group
|
||||
$("#group option").each(function(index, value) {
|
||||
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) {
|
||||
$("#group").val(0);
|
||||
|
|
|
@ -55,7 +55,7 @@ if ($id) {
|
|||
$id_group = $filter['id_group'];
|
||||
$id_name = $filter['id_name'];
|
||||
$event_type = $filter['event_type'];
|
||||
$severity = $filter['severity'];
|
||||
$severity = explode(',', $filter['severity']);
|
||||
$status = $filter['status'];
|
||||
$search = $filter['search'];
|
||||
$text_agent = $filter['text_agent'];
|
||||
|
@ -123,7 +123,7 @@ if ($update || $create) {
|
|||
$id_group_filter = get_parameter('id_group_filter');
|
||||
$id_name = (string) get_parameter('id_name');
|
||||
$event_type = get_parameter('event_type', '');
|
||||
$severity = get_parameter('severity', '');
|
||||
$severity = implode(',', get_parameter('severity', -1));
|
||||
$status = get_parameter('status', '');
|
||||
$search = get_parameter('search', '');
|
||||
$text_agent = get_parameter('text_agent', '');
|
||||
|
@ -172,6 +172,8 @@ if ($update || $create) {
|
|||
'user_comment' => $user_comment,
|
||||
'filter_only_alert' => $filter_only_alert,
|
||||
];
|
||||
|
||||
$severity = explode(',', $severity);
|
||||
}
|
||||
|
||||
if ($update) {
|
||||
|
@ -289,15 +291,24 @@ $table->data[3][1] = html_print_select(
|
|||
true
|
||||
);
|
||||
|
||||
if (empty($severity) && $severity !== '0') {
|
||||
$severity = -1;
|
||||
}
|
||||
|
||||
$table->data[4][0] = '<b>'.__('Severity').'</b>';
|
||||
$table->data[4][1] = html_print_select(
|
||||
get_priorities(),
|
||||
'severity',
|
||||
'severity[]',
|
||||
$severity,
|
||||
'',
|
||||
__('All'),
|
||||
'-1',
|
||||
true
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 175px'
|
||||
);
|
||||
|
||||
$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][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§ion=edit_filter&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ if ($event_response_id > 0) {
|
|||
$event_response['modal_height'] = 0;
|
||||
$event_response['params'] = '';
|
||||
$event_response['server_to_exec'] = '';
|
||||
$event_response['command_timeout'] = 90;
|
||||
}
|
||||
|
||||
$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;
|
||||
|
||||
$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) {
|
||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=list&action=create_response&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
|
@ -214,11 +220,17 @@ $('#type').change(function() {
|
|||
$('#new_window').attr('disabled','disabled');
|
||||
$('#server_to_exec_label').css('display','');
|
||||
$('#server_to_exec_value').css('display','');
|
||||
$('#command_timeout_label').css('display','');
|
||||
$('#command_timeout_value').css('display','');
|
||||
|
||||
break;
|
||||
case 'url':
|
||||
$('#new_window').removeAttr('disabled');
|
||||
$('#server_to_exec_label').css('display','none');
|
||||
$('#server_to_exec_value').css('display','none');
|
||||
$('#command_timeout_label').css('display','none');
|
||||
$('#command_timeout_value').css('display','none');
|
||||
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -42,6 +42,7 @@ switch ($action) {
|
|||
$values['new_window'] = get_parameter('new_window');
|
||||
$values['params'] = get_parameter('params');
|
||||
$values['server_to_exec'] = get_parameter('server_to_exec');
|
||||
$values['command_timeout'] = get_parameter('command_timeout', 90);
|
||||
|
||||
$result = event_responses_create_response($values);
|
||||
|
||||
|
@ -65,6 +66,8 @@ switch ($action) {
|
|||
$values['params'] = get_parameter('params');
|
||||
$values['server_to_exec'] = get_parameter('server_to_exec');
|
||||
$response_id = get_parameter('id_response', 0);
|
||||
$values['command_timeout'] = get_parameter('command_timeout', '90');
|
||||
|
||||
|
||||
$result = event_responses_update_response($response_id, $values);
|
||||
|
||||
|
|
|
@ -129,6 +129,7 @@ if ($disabled != '') {
|
|||
|
||||
$extensions = extensions_get_extension_info();
|
||||
|
||||
$table = new StdClass;
|
||||
$table->width = '98%';
|
||||
|
||||
$table->head = [];
|
||||
|
|
|
@ -117,6 +117,14 @@ if ($update_agents) {
|
|||
$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');
|
||||
|
||||
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
|
||||
if (isset($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(
|
||||
'tagente',
|
||||
$values,
|
||||
|
@ -677,6 +704,27 @@ $table->data[6][1] = html_print_select(
|
|||
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
|
||||
).' ';
|
||||
$table->data[7][1] .= __('Module').' '.html_print_select('', 'safe_mode_module', '', '', __('Any'), -1, true).'</div>';
|
||||
ui_toggle(html_print_table($table, true), __('Advanced options'));
|
||||
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() {
|
||||
var get_parameters_count = window.location.href.slice(
|
||||
window.location.href.indexOf('?') + 1).split('&').length;
|
||||
|
@ -833,7 +929,7 @@ $(document).ready (function () {
|
|||
$("#id_group").trigger("change");
|
||||
});
|
||||
|
||||
$("#id_agents").change (function () {
|
||||
$('#id_agents').on('change', function() {
|
||||
var idAgents = Array();
|
||||
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
||||
idAgents.push($(val).val());
|
||||
|
@ -858,6 +954,10 @@ $(document).ready (function () {
|
|||
);
|
||||
|
||||
$("#form_agents").attr("style", "");
|
||||
|
||||
if($("#safe_mode_change").val() == 1) {
|
||||
refreshSafeModules();
|
||||
}
|
||||
});
|
||||
|
||||
$("#id_group").change (function () {
|
||||
|
|
|
@ -316,6 +316,9 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
|||
$sub2['godmode/setup/setup&section=notifications']['text'] = __('Notifications');
|
||||
$sub2['godmode/setup/setup&section=notifications']['refr'] = 0;
|
||||
|
||||
$sub2['godmode/setup/setup&section=websocket_engine']['text'] = __('Websocket Engine');
|
||||
$sub2['godmode/setup/setup&section=websocket_engine']['refr'] = 0;
|
||||
|
||||
if ($config['activate_gis']) {
|
||||
$sub2['godmode/setup/gis']['text'] = __('Map conections GIS');
|
||||
}
|
||||
|
|
|
@ -59,52 +59,36 @@ switch ($action) {
|
|||
$resultOperationDB = false;
|
||||
} else if (!empty($ids_serialize)) {
|
||||
$ids = explode('|', $ids_serialize);
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$items = db_get_all_rows_sql(
|
||||
'
|
||||
SELECT id_gs, `field_order`
|
||||
FROM tgraph_source
|
||||
WHERE id_graph = '.$id_graph.'
|
||||
ORDER BY `field_order`'
|
||||
);
|
||||
break;
|
||||
}
|
||||
$items = db_get_all_rows_sql(
|
||||
'SELECT id_gs, `field_order`
|
||||
FROM tgraph_source
|
||||
WHERE id_graph = '.$id_graph.'
|
||||
ORDER BY `field_order`'
|
||||
);
|
||||
|
||||
if ($items === false) {
|
||||
$items = [];
|
||||
}
|
||||
|
||||
|
||||
// Clean the repeated order values
|
||||
// Clean the repeated order values.
|
||||
$order_temp = 1;
|
||||
foreach ($items as $item) {
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
db_process_sql_update(
|
||||
'tgraph_source',
|
||||
['`field_order`' => $order_temp],
|
||||
['id_gs' => $item['id_rc']]
|
||||
);
|
||||
break;
|
||||
}
|
||||
db_process_sql_update(
|
||||
'tgraph_source',
|
||||
['`field_order`' => $order_temp],
|
||||
['id_gs' => $item['id_rc']]
|
||||
);
|
||||
|
||||
$order_temp++;
|
||||
}
|
||||
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$items = db_get_all_rows_sql(
|
||||
'
|
||||
SELECT id_gs, `field_order`
|
||||
FROM tgraph_source
|
||||
WHERE id_graph = '.$id_graph.'
|
||||
ORDER BY `field_order`'
|
||||
);
|
||||
break;
|
||||
}
|
||||
$items = db_get_all_rows_sql(
|
||||
'SELECT id_gs, `field_order`
|
||||
FROM tgraph_source
|
||||
WHERE id_graph = '.$id_graph.'
|
||||
ORDER BY `field_order`'
|
||||
);
|
||||
|
||||
if ($items === false) {
|
||||
$items = [];
|
||||
|
@ -116,7 +100,7 @@ switch ($action) {
|
|||
|
||||
$temp = [];
|
||||
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) {
|
||||
$temp[$item['field_order']] = $item['id_gs'];
|
||||
}
|
||||
|
@ -150,16 +134,11 @@ switch ($action) {
|
|||
|
||||
|
||||
foreach ($items as $order => $id) {
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
|
||||
db_process_sql_update(
|
||||
'tgraph_source',
|
||||
['`field_order`' => ($order + 1)],
|
||||
['id_gs' => $id]
|
||||
);
|
||||
break;
|
||||
}
|
||||
db_process_sql_update(
|
||||
'tgraph_source',
|
||||
['`field_order`' => ($order + 1)],
|
||||
['id_gs' => $id]
|
||||
);
|
||||
}
|
||||
|
||||
$resultOperationDB = true;
|
||||
|
@ -211,7 +190,7 @@ if ($editGraph) {
|
|||
$weights = implode(',', $weight_array);
|
||||
}
|
||||
|
||||
// Modules table
|
||||
// Modules table.
|
||||
if (count($module_array) > 0) {
|
||||
echo "<table width='100%' cellpadding=4 cellpadding=4 class='databox filters'>";
|
||||
echo '<tr>
|
||||
|
@ -224,7 +203,7 @@ if (count($module_array) > 0) {
|
|||
<th>'.__('Sort').'</th>';
|
||||
$color = 0;
|
||||
for ($a = 0; $a < count($module_array); $a++) {
|
||||
// Calculate table line color
|
||||
// Calculate table line color.
|
||||
if ($color == 1) {
|
||||
$tdcolor = 'datos';
|
||||
$color = 0;
|
||||
|
@ -332,7 +311,7 @@ echo '</form>';
|
|||
echo '<br>';
|
||||
|
||||
|
||||
// Configuration form
|
||||
// Configuration form.
|
||||
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."'>";
|
||||
|
||||
|
@ -352,7 +331,7 @@ echo "<td colspan='3'>".html_print_select_groups(
|
|||
true
|
||||
).'</td>';
|
||||
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 style='vertical-align: top;'>".__('Modules').'</td>';
|
||||
echo '</tr><tr>';
|
||||
|
|
|
@ -125,6 +125,20 @@ if ($report_r && $report_w) {
|
|||
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();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -290,7 +290,7 @@ $table_aux = new stdClass();
|
|||
foreach ($result_graphs as $graph) {
|
||||
$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);
|
||||
|
||||
|
|
|
@ -454,10 +454,10 @@ if (!$maps && !is_metaconsole()) {
|
|||
4 => 'action_buttons',
|
||||
];
|
||||
$data[3] = '<a class="copy_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&copy_layout=1">'.html_print_image('images/copy.png', true).'</a>';
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1">'.html_print_image('images/cross.png', true).'</a>';
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&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 {
|
||||
$data[3] = '<a class="copy_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&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'].'&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'].'&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 {
|
||||
$data[3] = '';
|
||||
|
|
|
@ -163,7 +163,6 @@ switch ($action) {
|
|||
$description = null;
|
||||
$sql = null;
|
||||
$show_in_same_row = 0;
|
||||
$show_in_landscape = 0;
|
||||
$hide_notinit_agents = 0;
|
||||
$priority_mode = REPORT_PRIORITY_MODE_OK;
|
||||
$failover_mode = 0;
|
||||
|
@ -171,6 +170,8 @@ switch ($action) {
|
|||
$server_name = '';
|
||||
$server_id = 0;
|
||||
$dyn_height = 230;
|
||||
$landscape = false;
|
||||
$pagebreak = false;
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
|
@ -208,7 +209,6 @@ switch ($action) {
|
|||
$description = null;
|
||||
$sql = null;
|
||||
$show_in_same_row = 0;
|
||||
$show_in_landscape = 0;
|
||||
$hide_notinit_agents = 0;
|
||||
$server_name = '';
|
||||
$server_id = 0;
|
||||
|
@ -236,12 +236,18 @@ switch ($action) {
|
|||
$name_from_template = $style['name_label'];
|
||||
|
||||
$show_in_same_row = $style['show_in_same_row'];
|
||||
$show_in_landscape = $style['show_in_landscape'];
|
||||
$hide_notinit_agents = $style['hide_notinit_agents'];
|
||||
$dyn_height = $style['dyn_height'];
|
||||
$type = $item['type'];
|
||||
$name = $style['name_label'];
|
||||
|
||||
if ($name === null || $name === '') {
|
||||
$name = $item['name'];
|
||||
}
|
||||
|
||||
$landscape = $item['landscape'];
|
||||
$pagebreak = $item['pagebreak'];
|
||||
|
||||
switch ($type) {
|
||||
case 'event_report_log':
|
||||
$period = $item['period'];
|
||||
|
@ -899,6 +905,28 @@ $class = 'databox filters';
|
|||
</td>
|
||||
</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">
|
||||
<td style="font-weight:bold;">
|
||||
<?php
|
||||
|
@ -1838,28 +1866,6 @@ $class = 'databox filters';
|
|||
<td style="" id="max_items_example"></td>
|
||||
</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">
|
||||
<td style="font-weight:bold;">
|
||||
<?php
|
||||
|
@ -2198,7 +2204,7 @@ $class = 'databox filters';
|
|||
<tr id="row_show_address_agent" style="" class="datos">
|
||||
<td style="font-weight:bold;">
|
||||
<?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.'),
|
||||
true
|
||||
);
|
||||
|
@ -2554,25 +2560,6 @@ $class = 'databox filters';
|
|||
</td>
|
||||
</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">
|
||||
<td style="font-weight:bold;">
|
||||
<?php
|
||||
|
@ -2779,6 +2766,24 @@ $class = 'databox filters';
|
|||
</td>
|
||||
</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>
|
||||
</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(
|
||||
'pandora_inventory',
|
||||
ENTERPRISE_DIR.'/include/javascript/'
|
||||
|
@ -3517,8 +3546,19 @@ $(document).ready (function () {
|
|||
// Load selected modules by default
|
||||
$("#id_agents2").trigger('click');
|
||||
|
||||
$('#combo_server').change (function (){
|
||||
$("#id_agents").html('');
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
$("#inventory_modules").html('');
|
||||
})
|
||||
|
||||
$("#combo_group").change (
|
||||
function () {
|
||||
$("#id_agents").html('');
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
$("#inventory_modules").html('');
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_group_json" : 1,
|
||||
|
@ -3528,9 +3568,6 @@ $(document).ready (function () {
|
|||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents").html('');
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
id = id.substring(1);
|
||||
|
@ -3558,9 +3595,7 @@ $(document).ready (function () {
|
|||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents").html('');
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
id = id.substring(1);
|
||||
|
@ -3700,6 +3735,12 @@ $(document).ready (function () {
|
|||
$("#submit-create_item").click(function () {
|
||||
var type = $('#type').val();
|
||||
var name = $('#text-name').val();
|
||||
|
||||
if($('#text-name').val() == ''){
|
||||
dialog_message('#message_no_name');
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (type){
|
||||
case 'alert_report_module':
|
||||
case 'alert_report_agent':
|
||||
|
@ -3718,25 +3759,108 @@ $(document).ready (function () {
|
|||
case 'historical_data':
|
||||
case 'agent_configuration':
|
||||
case 'module_histogram_graph':
|
||||
case 'increment':
|
||||
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;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if($('#text-name').val() == ''){
|
||||
alert( <?php echo "'".__('Please insert a name')."'"; ?> );
|
||||
return false;
|
||||
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':
|
||||
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 () {
|
||||
var type = $('#type').val();
|
||||
|
||||
if($('#text-name').val() == ''){
|
||||
dialog_message('#message_no_name');
|
||||
return false;
|
||||
}
|
||||
switch (type){
|
||||
case 'alert_report_module':
|
||||
case 'alert_report_agent':
|
||||
|
@ -3755,14 +3879,97 @@ $(document).ready (function () {
|
|||
case 'historical_data':
|
||||
case 'agent_configuration':
|
||||
case 'module_histogram_graph':
|
||||
case 'increment':
|
||||
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;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
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 () {
|
||||
|
@ -4472,7 +4679,6 @@ function chooseType() {
|
|||
$("#row_lapse_calc").hide();
|
||||
$("#row_lapse").hide();
|
||||
$("#row_visual_format").hide();
|
||||
$("#row_show_in_landscape").hide();
|
||||
$('#row_hide_notinit_agents').hide();
|
||||
$('#row_priority_mode').hide();
|
||||
$("#row_module_group").hide();
|
||||
|
@ -4974,6 +5180,29 @@ function chooseType() {
|
|||
$("#id_agents").change(event_change_id_agent_inventory);
|
||||
$("#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() {
|
||||
updateAgents($(this).val(),
|
||||
<?php
|
||||
|
@ -5003,6 +5232,30 @@ function chooseType() {
|
|||
|
||||
$("#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() {
|
||||
$('#hidden-date_selected').val('');
|
||||
updateInventoryDates(
|
||||
|
@ -5190,4 +5443,20 @@ function source_change_agents() {
|
|||
"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>
|
||||
|
|
|
@ -386,7 +386,7 @@ if ($items) {
|
|||
}
|
||||
|
||||
$table->head[4] = __('Time lapse');
|
||||
$table->head[5] = __('Name').' / '.__('Description');
|
||||
$table->head[5] = __('Name or Description');
|
||||
if (check_acl($config['id_user'], 0, 'RM')) {
|
||||
$table->head[6] = '<span title="'.__('Options').'">'.__('Op.').'</span>';
|
||||
if ($report_w || $report_m) {
|
||||
|
|
|
@ -147,7 +147,7 @@ if (enterprise_include_once('include/functions_reporting.php') !== ENTERPRISE_NO
|
|||
}
|
||||
|
||||
// Constant with fonts directory.
|
||||
define('_MPDF_TTFONTPATH', 'include/fonts/');
|
||||
define('_MPDF_TTFONTPATH', $config['homedir'].'/include/fonts/');
|
||||
|
||||
$activeTab = get_parameter('tab', 'main');
|
||||
$action = get_parameter('action', 'list');
|
||||
|
@ -1207,8 +1207,7 @@ switch ($action) {
|
|||
$report_id_user = get_parameter('report_id_user');
|
||||
$non_interactive = get_parameter('non_interactive', 0);
|
||||
|
||||
// Pretty font by default for pdf.
|
||||
$custom_font = 'FreeSans.ttf';
|
||||
$custom_font = $config['custom_report_front_font'];
|
||||
|
||||
switch ($type_access_selected) {
|
||||
case 'group_view':
|
||||
|
@ -1284,7 +1283,6 @@ switch ($action) {
|
|||
$metaconsole_report = (int) is_metaconsole();
|
||||
|
||||
if ($config['custom_report_front']) {
|
||||
$custom_font = $config['custom_report_front_font'];
|
||||
$logo = $config['custom_report_front_logo'];
|
||||
$header = $config['custom_report_front_header'];
|
||||
$first_page = $config['custom_report_front_firstpage'];
|
||||
|
@ -1415,6 +1413,9 @@ switch ($action) {
|
|||
$name_it
|
||||
);
|
||||
|
||||
$values['landscape'] = get_parameter('landscape');
|
||||
$values['pagebreak'] = get_parameter('pagebreak');
|
||||
|
||||
/*
|
||||
Added support for projection graphs,
|
||||
prediction date and SLA reports
|
||||
|
@ -1924,10 +1925,6 @@ switch ($action) {
|
|||
'show_in_same_row',
|
||||
0
|
||||
);
|
||||
$style['show_in_landscape'] = get_parameter(
|
||||
'show_in_landscape',
|
||||
0
|
||||
);
|
||||
$style['hide_notinit_agents'] = get_parameter(
|
||||
'hide_notinit_agents',
|
||||
0
|
||||
|
@ -2100,6 +2097,9 @@ switch ($action) {
|
|||
$name_it
|
||||
);
|
||||
|
||||
$values['landscape'] = get_parameter('landscape');
|
||||
$values['pagebreak'] = get_parameter('pagebreak');
|
||||
|
||||
// Support for projection graph, prediction date
|
||||
// and SLA reports 'top_n_value', 'top_n' and 'text'
|
||||
// fields will be reused for these types of report.
|
||||
|
@ -2490,10 +2490,6 @@ switch ($action) {
|
|||
'show_in_same_row',
|
||||
0
|
||||
);
|
||||
$style['show_in_landscape'] = get_parameter(
|
||||
'show_in_landscape',
|
||||
0
|
||||
);
|
||||
$style['hide_notinit_agents'] = get_parameter(
|
||||
'hide_notinit_agents',
|
||||
0
|
||||
|
|
|
@ -1892,33 +1892,53 @@ function toggle_item_palette() {
|
|||
$("#text-label_ifr")
|
||||
.contents()
|
||||
.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")
|
||||
.contents()
|
||||
.find("p")
|
||||
.css("line-height", $(this).val());
|
||||
.css("line-height", $(this).val())
|
||||
.css("margin-top", "-10px");
|
||||
$("#text-label_ifr")
|
||||
.contents()
|
||||
.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")
|
||||
.contents()
|
||||
.find("span")
|
||||
.css("line-height", $(this).val());
|
||||
.css("line-height", $(this).val())
|
||||
.css("margin-top", "-10px");
|
||||
});
|
||||
|
||||
$("#text-label_ifr")
|
||||
.contents()
|
||||
.find("p")
|
||||
.css("line-height", $("#lineheight").val());
|
||||
$("#text-label_ifr")
|
||||
.contents()
|
||||
.find("span")
|
||||
.css("line-height", $("#lineheight").val());
|
||||
$("#text-label_ifr")
|
||||
.contents()
|
||||
.find("body")
|
||||
.css("background", "lightgray");
|
||||
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")
|
||||
.contents()
|
||||
.find("p")
|
||||
.css("line-height", $("#lineheight").val());
|
||||
$("#text-label_ifr")
|
||||
.contents()
|
||||
.find("span")
|
||||
.css("line-height", $("#lineheight").val());
|
||||
$("#text-label_ifr")
|
||||
.contents()
|
||||
.find("body")
|
||||
.css("background", "lightgray");
|
||||
}
|
||||
}
|
||||
|
||||
if (creationItem != "simple_value") {
|
||||
|
|
|
@ -15,7 +15,7 @@ global $config;
|
|||
|
||||
check_login();
|
||||
|
||||
// Visual console required
|
||||
// Visual console required.
|
||||
if (empty($visualConsole)) {
|
||||
db_pandora_audit(
|
||||
'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->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 = [];
|
||||
if (!is_metaconsole()) {
|
||||
|
@ -506,7 +506,7 @@ $table->data['all_8'][1] = html_print_select(
|
|||
VISUAL_MAP_WIZARD_PARENTS_NONE,
|
||||
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()),
|
||||
true
|
||||
).'</span>';
|
||||
|
|
|
@ -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] .= html_print_image('images/file.png', true);
|
||||
$data[1] .= html_print_image('images/file.png', true, false, false, true);
|
||||
$data[1] .= '</a>';
|
||||
$table->data['plugin_command'] = $data;
|
||||
|
||||
|
|
|
@ -133,6 +133,11 @@ $buttons['notifications'] = [
|
|||
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=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§ion=websocket_engine').'">'.html_print_image('images/websocket_small.png', true, ['title' => __('Websocket engine')]).'</a>',
|
||||
];
|
||||
|
||||
$help_header = '';
|
||||
if (enterprise_installed()) {
|
||||
$subpage = setup_enterprise_add_subsection_main($section, $buttons, $help_header);
|
||||
|
@ -183,6 +188,12 @@ switch ($section) {
|
|||
$subpage = ' » '.__('Notifications');
|
||||
break;
|
||||
|
||||
case 'websocket_engine':
|
||||
$buttons['websocket_engine']['active'] = true;
|
||||
$subpage = ' » '.__('Pandora Websocket Engine');
|
||||
$help_header = 'quickshell_settings';
|
||||
break;
|
||||
|
||||
case 'enterprise':
|
||||
$buttons['enterprise']['active'] = true;
|
||||
$subpage = ' » '.__('Enterprise');
|
||||
|
@ -247,6 +258,10 @@ switch ($section) {
|
|||
include_once $config['homedir'].'/godmode/setup/setup_notifications.php';
|
||||
break;
|
||||
|
||||
case 'websocket_engine':
|
||||
include_once $config['homedir'].'/godmode/setup/setup_websocket_engine.php';
|
||||
break;
|
||||
|
||||
default:
|
||||
enterprise_hook('setup_enterprise_select_tab', [$section]);
|
||||
break;
|
||||
|
|
|
@ -403,50 +403,6 @@ html_print_table($table_mail_conf);
|
|||
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.'">';
|
||||
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');
|
||||
|
|
|
@ -1039,17 +1039,37 @@ $row++;
|
|||
|
||||
$row++;
|
||||
|
||||
$table_report->data[$row][0] = __('PDF font size');
|
||||
$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][0] = __('PDF font size (px)');
|
||||
$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++;
|
||||
|
||||
$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] .= ui_print_help_tip(
|
||||
__('This is the height in pixels of the module graph or custom graph in the reports (only: HTML)'),
|
||||
true
|
||||
);
|
||||
$table_report->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true);
|
||||
|
||||
$row++;
|
||||
|
||||
$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
|
||||
$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."),
|
||||
|
@ -1150,7 +1158,6 @@ $row++;
|
|||
html_print_table($table_report);
|
||||
echo '</fieldset>';
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// OTHER CONFIGURATION
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -1429,7 +1436,6 @@ function edit_csv_divider () {
|
|||
function display_custom_report_front (show,table) {
|
||||
|
||||
if (show == true) {
|
||||
$('tr#'+table+'-custom_report_front-font').show();
|
||||
$('tr#'+table+'-custom_report_front-logo').show();
|
||||
$('tr#'+table+'-custom_report_front-preview').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();
|
||||
}
|
||||
else {
|
||||
$('tr#'+table+'-custom_report_front-font').hide();
|
||||
$('tr#'+table+'-custom_report_front-logo').hide();
|
||||
$('tr#'+table+'-custom_report_front-preview').hide();
|
||||
$('tr#'+table+'-custom_report_front-header').hide();
|
||||
|
|
|
@ -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&section=websocket_engine&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>';
|
|
@ -101,7 +101,7 @@
|
|||
width: 15px;
|
||||
}
|
||||
.fileupload_form ul li div {
|
||||
display: block;
|
||||
display: block !important;
|
||||
}
|
||||
.fileupload_form ul li.working span {
|
||||
background-position: 0 -12px;
|
||||
|
|
|
@ -243,6 +243,12 @@ if ($create_user) {
|
|||
$password_new = '';
|
||||
$password_confirm = '';
|
||||
$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 == '') {
|
||||
ui_print_error_message(__('Passwords cannot be empty'));
|
||||
$user_info = $values;
|
||||
|
|
|
@ -514,7 +514,9 @@ class Wizard
|
|||
|
||||
$output .= '</li>';
|
||||
} else {
|
||||
if ($input['arguments']['type'] != 'hidden') {
|
||||
if ($input['arguments']['type'] != 'hidden'
|
||||
&& $input['arguments']['type'] != 'hidden_extended'
|
||||
) {
|
||||
if (!$direct) {
|
||||
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
|
||||
}
|
||||
|
@ -572,7 +574,9 @@ class Wizard
|
|||
|
||||
$output .= '</ul></li>';
|
||||
} else {
|
||||
if ($input['arguments']['type'] != 'hidden') {
|
||||
if ($input['arguments']['type'] != 'hidden'
|
||||
&& $input['arguments']['type'] != 'hidden_extended'
|
||||
) {
|
||||
if ($input['arguments']['inline'] != 'true') {
|
||||
$output .= '<div class="edit_discovery_input">';
|
||||
} else {
|
||||
|
@ -675,7 +679,9 @@ class Wizard
|
|||
|
||||
$output .= '</ul></li>';
|
||||
} else {
|
||||
if ($input['arguments']['type'] != 'hidden') {
|
||||
if ($input['arguments']['type'] != 'hidden'
|
||||
&& $input['arguments']['type'] != 'hidden_extended'
|
||||
) {
|
||||
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
|
||||
$output .= '<label>'.$input['label'].'</label>';
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
|
|
After Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 485 B |
After Width: | Height: | Size: 268 KiB |
After Width: | Height: | Size: 178 KiB |
After Width: | Height: | Size: 354 KiB |
After Width: | Height: | Size: 389 KiB |
After Width: | Height: | Size: 872 KiB |
After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 344 B |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 3.4 KiB |
|
@ -84,7 +84,7 @@ $delete_event = get_parameter('delete_event', 0);
|
|||
$get_event_filters = get_parameter('get_event_filters', 0);
|
||||
$get_comments = get_parameter('get_comments', 0);
|
||||
$get_events_fired = (bool) get_parameter('get_events_fired');
|
||||
|
||||
$get_id_source_event = get_parameter('get_id_source_event');
|
||||
if ($get_comments) {
|
||||
$event = get_parameter('event', false);
|
||||
$filter = get_parameter('filter', false);
|
||||
|
@ -128,7 +128,7 @@ if ($get_comments) {
|
|||
);
|
||||
|
||||
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_group'] = get_parameter('id_group');
|
||||
$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['search'] = get_parameter('search');
|
||||
$values['text_agent'] = get_parameter('text_agent');
|
||||
|
@ -253,7 +253,7 @@ if ($save_event_filter) {
|
|||
$values['source'] = get_parameter('source');
|
||||
$values['id_extra'] = get_parameter('id_extra');
|
||||
$values['user_comment'] = get_parameter('user_comment');
|
||||
|
||||
$values['id_source_event'] = get_parameter('id_source_event');
|
||||
$exists = (bool) db_get_value_filter(
|
||||
'id_filter',
|
||||
'tevent_filter',
|
||||
|
@ -278,7 +278,7 @@ if ($update_event_filter) {
|
|||
$id = get_parameter('id');
|
||||
$values['id_group'] = get_parameter('id_group');
|
||||
$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['search'] = get_parameter('search');
|
||||
$values['text_agent'] = get_parameter('text_agent');
|
||||
|
@ -300,6 +300,7 @@ if ($update_event_filter) {
|
|||
$values['source'] = get_parameter('source');
|
||||
$values['id_extra'] = get_parameter('id_extra');
|
||||
$values['user_comment'] = get_parameter('user_comment');
|
||||
$values['id_source_event'] = get_parameter('id_source_event');
|
||||
|
||||
if (io_safe_output($values['tag_with']) == '["0"]') {
|
||||
$values['tag_with'] = '[]';
|
||||
|
@ -376,8 +377,9 @@ if ($load_filter_modal) {
|
|||
}
|
||||
|
||||
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
|
||||
if (!is_metaconsole()) {
|
||||
$table->style[0] = 'width: 50%; width:50%;';
|
||||
$filter_id_width = '200px';
|
||||
if (is_metaconsole()) {
|
||||
$filter_id_width = '150px';
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
@ -390,7 +392,12 @@ if ($load_filter_modal) {
|
|||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'margin-left:5px; width:'.$filter_id_width.';'
|
||||
);
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Load filter'),
|
||||
|
@ -411,10 +418,11 @@ function show_filter() {
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: false,
|
||||
closeOnEscape: true
|
||||
closeOnEscape: true,
|
||||
width: 450
|
||||
});
|
||||
}
|
||||
|
||||
//aki
|
||||
function load_form_filter() {
|
||||
jQuery.post (
|
||||
"<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
|
@ -431,8 +439,10 @@ function load_form_filter() {
|
|||
$("#id_group").val(val);
|
||||
if (i == 'event_type')
|
||||
$("#event_type").val(val);
|
||||
if (i == 'severity')
|
||||
$("#severity").val(val);
|
||||
if (i == 'severity') {
|
||||
const multiple = val.split(",");
|
||||
$("#severity").val(multiple);
|
||||
}
|
||||
if (i == 'status')
|
||||
$("#status").val(val);
|
||||
if (i == 'search')
|
||||
|
@ -465,6 +475,8 @@ function load_form_filter() {
|
|||
$("#text-id_extra").val(val);
|
||||
if (i == 'user_comment')
|
||||
$("#text-user_comment").val(val);
|
||||
if (i == 'id_source_event')
|
||||
$("#text-id_source_event").val(val);
|
||||
});
|
||||
reorder_tags_inputs();
|
||||
// Update the info with the loaded filter
|
||||
|
@ -685,7 +697,8 @@ function save_new_filter() {
|
|||
"date_to": $("#text-date_to").val(),
|
||||
"source": $("#text-source").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) {
|
||||
$("#info_box").hide();
|
||||
|
@ -754,7 +767,9 @@ function save_update_filter() {
|
|||
"date_to": $("#text-date_to").val(),
|
||||
"source": $("#text-source").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) {
|
||||
$(".info_box").hide();
|
||||
|
@ -908,6 +923,8 @@ if ($perform_event_response) {
|
|||
|
||||
$event_response = db_get_row('tevent_response', 'id', $response_id);
|
||||
|
||||
$command_timeout = $event_response['command_timeout'];
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if ($event_response['server_to_exec'] != 0 && $event_response['type'] == 'command') {
|
||||
$commandExclusions = [
|
||||
|
@ -939,7 +956,7 @@ if ($perform_event_response) {
|
|||
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 {
|
||||
switch (PHP_OS) {
|
||||
|
@ -956,7 +973,7 @@ if ($perform_event_response) {
|
|||
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 {
|
||||
switch (PHP_OS) {
|
||||
|
@ -973,7 +990,13 @@ if ($perform_event_response) {
|
|||
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;
|
||||
|
@ -1283,24 +1306,18 @@ if ($get_extended_event) {
|
|||
// If metaconsole switch to node to get details and custom fields.
|
||||
if ($meta) {
|
||||
$server = metaconsole_get_connection_by_id($server_id);
|
||||
metaconsole_connect($server);
|
||||
} else {
|
||||
$server = '';
|
||||
}
|
||||
|
||||
$details = events_page_details($event, $server);
|
||||
|
||||
if ($meta) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
if (events_has_extended_info($event['id_evento']) === true) {
|
||||
$related = events_page_related($event, $server);
|
||||
}
|
||||
|
||||
if ($meta) {
|
||||
$server = metaconsole_get_connection_by_id($server_id);
|
||||
metaconsole_connect($server);
|
||||
metaconsole_connect($server);
|
||||
}
|
||||
|
||||
$custom_fields = events_page_custom_fields($event);
|
||||
|
@ -1564,7 +1581,7 @@ if ($get_list_events_agents) {
|
|||
$id_agent = get_parameter('id_agent');
|
||||
$server_id = get_parameter('server_id');
|
||||
$event_type = get_parameter('event_type');
|
||||
$severity = get_parameter('severity');
|
||||
$severity = implode(',', get_parameter('severity', -1));
|
||||
$status = get_parameter('status');
|
||||
$search = get_parameter('search');
|
||||
$id_agent_module = get_parameter('id_agent_module');
|
||||
|
|
|
@ -171,8 +171,9 @@ if ($get_graphs) {
|
|||
'',
|
||||
false,
|
||||
$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 .= '</tr>';
|
||||
$single_table .= '</table>';
|
||||
|
|
|
@ -1141,11 +1141,7 @@ if (check_login()) {
|
|||
$draw_events = 0;
|
||||
}
|
||||
|
||||
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&id='.$module['id_agente_modulo'].'&label='.rawurlencode(
|
||||
urlencode(
|
||||
base64_encode($module['nombre'])
|
||||
)
|
||||
).'&refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 700)";
|
||||
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&id='.$module['id_agente_modulo'].'&refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 700)";
|
||||
if (!is_snapshot_data($module['datos'])) {
|
||||
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> ';
|
||||
}
|
||||
|
|