g,k kjjMerge remote-tracking branch 'origin/develop' into ent-7799-jerarquia-fiels-alertas-snmp-accion-comando-de-alerta

This commit is contained in:
Calvo 2021-11-18 09:37:31 +01:00
commit 37dacfa499
379 changed files with 363565 additions and 739695 deletions

View File

@ -4,7 +4,7 @@
# define variables # define variables
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='2021012801' S_VERSION='2021100601'
LOGFILE="/tmp/pandora-agent-deploy-$(date +%F).log" LOGFILE="/tmp/pandora-agent-deploy-$(date +%F).log"
# Ansi color code variables # Ansi color code variables
@ -83,6 +83,7 @@ execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define e
OS=$([[ $(grep '^ID_LIKE=' /etc/os-release) ]] && grep ^ID_LIKE= /etc/os-release | cut -d '=' -f2 | tr -d '"' || grep ^ID= /etc/os-release | cut -d '=' -f2 | tr -d '"') OS=$([[ $(grep '^ID_LIKE=' /etc/os-release) ]] && grep ^ID_LIKE= /etc/os-release | cut -d '=' -f2 | tr -d '"' || grep ^ID= /etc/os-release | cut -d '=' -f2 | tr -d '"')
[[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS [[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS
[[ $OS == 'fedora' ]] && OS_RELEASE=$OS
[[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS [[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS
[[ $OS == 'debian' ]] && OS_RELEASE=$OS [[ $OS == 'debian' ]] && OS_RELEASE=$OS

View File

@ -151,7 +151,7 @@ execute_cmd "yum install -y $extra_repos" "Installing extra repositories"
execute_cmd "yum-config-manager --enable remi-php73" "Configuring PHP" execute_cmd "yum-config-manager --enable remi-php73" "Configuring PHP"
# Install percona Database # Install percona Database
[ -f /etc/resolv.conf ] && rm -rf /etc/my.cnf [ -f /etc/my.cnf ] && rm -rf /etc/my.cnf
execute_cmd "yum install -y Percona-Server-server-57" "Installing Percona Server" execute_cmd "yum install -y Percona-Server-server-57" "Installing Percona Server"
# Console dependencies # Console dependencies
@ -429,6 +429,7 @@ sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini
sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini
sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini
sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini
sed -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini
cat > /var/www/html/index.html << EOF_INDEX cat > /var/www/html/index.html << EOF_INDEX
<meta HTTP-EQUIV="REFRESH" content="0; url=/pandora_console/"> <meta HTTP-EQUIV="REFRESH" content="0; url=/pandora_console/">

View File

@ -149,6 +149,7 @@ EOF_INDEX
sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini
sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini
sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini
sed -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini
echo "- Setting Public URL: $PUBLICURL" echo "- Setting Public URL: $PUBLICURL"
q=$(mysql -u$DBUSER -p$DBPASS $DBNAME -h$DBHOST -sNe "select token from tconfig;" | grep public_url) q=$(mysql -u$DBUSER -p$DBPASS $DBNAME -h$DBHOST -sNe "select token from tconfig;" | grep public_url)

183203
index.pot

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.756 # Version 7.0NG.758
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version # Foundation; either version 2 of the Licence or any later version

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.756 Version: 7.0NG.758-211117
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -31,7 +31,7 @@ fi
if [ "$#" -ge 2 ]; then if [ "$#" -ge 2 ]; then
VERSION="$2" VERSION="$2"
else else
VERSION="7.0NG.756" VERSION="7.0NG.758"
fi fi
# Path for the generated DMG file # Path for the generated DMG file

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false"> <choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/> <pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice> </choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.756" onConclusion="none">pandorafms_src.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.758" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications"> <choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/> <pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice> </choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.756" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.758" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" /> <!-- <installation-check script="check()" />
<script> <script>
<![CDATA[ <![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string> <key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string> <key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.756</string> <key>CFBundleVersion</key> <string>7.0NG.758</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.756 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string> <key>CFBundleGetInfoString</key> <string>7.0NG.758 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.756</string> <key>CFBundleShortVersionString</key> <string>7.0NG.758</string>
<key>NSPrincipalClass</key><string>NSApplication</string> <key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string> <key>NSMainNibFile</key><string>MainMenu</string>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1014,8 +1014,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.756'; use constant AGENT_VERSION => '7.0NG.758';
use constant AGENT_BUILD => '210721'; use constant AGENT_BUILD => '211117';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.756 %define version 7.0NG.758
%define release 1 %define release 211117
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.756 %define version 7.0NG.758
%define release 1 %define release 211117
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.756" PI_VERSION="7.0NG.758"
PI_BUILD="210721" PI_BUILD="211117"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -21,7 +21,6 @@
use strict; use strict;
use constant TSTAMP_FILE => '/tmp/pandora_inventory.tstamp'; use constant TSTAMP_FILE => '/tmp/pandora_inventory.tstamp';
use Scalar::Util qw(looks_like_number); use Scalar::Util qw(looks_like_number);
use Data::Dumper;
# Set environment language to English # Set environment language to English
$ENV{"LANG"} = "en_US"; $ENV{"LANG"} = "en_US";

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.756 # Version 7.0NG.758
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version # Foundation; either version 2 of the Licence or any later version

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes} {Yes}
AppName AppName
{Pandora FMS Windows Agent v7.0NG.756} {Pandora FMS Windows Agent v7.0NG.758}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{210721} {211117}
ViewReadme ViewReadme
{Yes} {Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No} {No}
Windows,Executable Windows,Executable
{<%AppName%>-Setup<%Ext%>} {<%AppName%>-<%Version%>-Setup<%Ext%>}
Windows,FileDescription Windows,FileDescription
{<%AppName%> <%Version%> Setup} {<%AppName%> <%Version%> Setup}

View File

@ -30,7 +30,7 @@ using namespace Pandora_Modules;
* @param host Host to be pinged. * @param host Host to be pinged.
*/ */
Pandora_Module_Ping::Pandora_Module_Ping (string name, string host, string count, string timeout, string advanced_options) Pandora_Module_Ping::Pandora_Module_Ping (string name, string host, string count, string timeout, string advanced_options)
: Pandora_Module_Exec (name, "ping -n " + count + " -w " + timeout + " " + advanced_options + " " + host) { : Pandora_Module_Exec (name, "ping -n " + count + " -w " + timeout + " " + advanced_options + " " + host + " | find \"TTL=\"") {
this->proc = 1; this->proc = 1;
this->setKind (module_ping_str); this->setKind (module_ping_str);
} }

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.756 Build 210721") #define PANDORA_VERSION ("7.0NG.758 Build 211117")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -2047,8 +2047,6 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
this->pandora_init (); this->pandora_init ();
} }
this->checkCollections (); this->checkCollections ();
}
/* Execute omnishell commands */ /* Execute omnishell commands */
omnishell_path = '"'+Pandora::getPandoraInstallDir (); omnishell_path = '"'+Pandora::getPandoraInstallDir ();
@ -2057,6 +2055,7 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
pandoraLog ("Omnishell: Running"); pandoraLog ("Omnishell: Running");
} }
omnishell_output = getValueFromCmdExec(omnishell_path.c_str(), 6000000); omnishell_output = getValueFromCmdExec(omnishell_path.c_str(), 6000000);
}
server_addr = conf->getValue ("server_ip"); server_addr = conf->getValue ("server_ip");

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.756(Build 210721))" VALUE "ProductVersion", "(7.0NG.758(Build 211117))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,6 +1,9 @@
# pandora disable listing # pandora disable listing
Options -Indexes Options -Indexes
# Avoid clickjacking
Header always append X-Frame-Options SAMEORIGIN
<Files ~ "\.log$"> <Files ~ "\.log$">
Order Allow,Deny Order Allow,Deny
Deny from All Deny from All

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.756 Version: 7.0NG.758-211117
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -331,6 +331,10 @@ function mainAgentsModules()
$offset = (int) get_parameter('offset', 0); $offset = (int) get_parameter('offset', 0);
$hor_offset = (int) get_parameter('hor_offset', 0); $hor_offset = (int) get_parameter('hor_offset', 0);
$block = $config['block_size']; $block = $config['block_size'];
if (intval($block) > 15) {
$block = '15';
}
if (get_parameter('modulegroup') != null) { if (get_parameter('modulegroup') != null) {
$agents_id = (array) get_parameter('id_agents2', null); $agents_id = (array) get_parameter('id_agents2', null);
} }
@ -543,7 +547,7 @@ function mainAgentsModules()
if ($config['pure'] != 1) { if ($config['pure'] != 1) {
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" class="w100p">'; $show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" class="w100p">';
$show_filters .= '<table class="white_table w100p no-border" cellpadding="0" cellspacing="0" border="0">'; $show_filters .= '<table class="w100p no-border" cellpadding="0" cellspacing="0" border="0">';
$show_filters .= '<tr>'; $show_filters .= '<tr>';
$show_filters .= '<td>'.$filter_groups_label.'</td>'; $show_filters .= '<td>'.$filter_groups_label.'</td>';
$show_filters .= '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>'; $show_filters .= '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>';
@ -561,7 +565,7 @@ function mainAgentsModules()
$show_filters .= '<td>'.$filter_modules.'</td>'; $show_filters .= '<td>'.$filter_modules.'</td>';
$show_filters .= '</tr>'; $show_filters .= '</tr>';
$show_filters .= '<tr>'; $show_filters .= '<tr>';
$show_filters .= "<td colspan=6 ><span class='right pdd_r_20px'>".$filter_update.'</span></td>'; $show_filters .= "<td colspan=6 ><span class='right pdd_r_35px mrgn_top_25px'>".$filter_update.'</span></td>';
$show_filters .= '</tr>'; $show_filters .= '</tr>';
$show_filters .= '</table>'; $show_filters .= '</table>';
$show_filters .= '</form>'; $show_filters .= '</form>';
@ -660,7 +664,7 @@ function mainAgentsModules()
$name = $module; $name = $module;
$modules_by_name[$cont]['name'] = $name; $modules_by_name[$cont]['name'] = $name;
$modules_by_name[$cont]['id'][] = $key; $modules_by_name[$cont]['id'][] = $key;
$cont ++; $cont++;
} }
} }

View File

@ -1081,12 +1081,18 @@ function resource_registration_extension_main()
} }
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=advanced/policymanager'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. Go to %s to create a policy.', 'This node is configured with centralized mode. Go to %s to create a policy.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=advanced/policymanager'
).'">'.__('metaconsole').'</a>'
) )
); );
@ -1094,7 +1100,7 @@ function resource_registration_extension_main()
} }
echo '<div class=notify>'; echo '<div class=notify>';
echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'<br> <br>'.__("You can get more resurces in our <a href='http://pandorafms.com/Library/Library/'>Public Resource Library</a>"); echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'<br> <br>'.__('You can get more resurces in our <a href="http://pandorafms.com/Library/Library/">Public Resource Library</a>');
echo '</div>'; echo '</div>';
echo '<br /><br />'; echo '<br /><br />';

View File

@ -33,10 +33,19 @@ function users_extension_main_god($god=true)
$image = 'images/user.png'; $image = 'images/user.png';
} }
// Header // Header.
ui_print_page_header(__('Users connected'), $image, false, '', $god); ui_print_page_header(__('Users connected'), $image, false, '', $god);
// Get groups user has permission $check_profile = db_get_row('tusuario_perfil', 'id_usuario', $config['id_user'], 'id_up');
if ($check_profile === false && !users_is_admin()) {
return ui_print_error_message(
__('This user does not have any associated profile'),
'',
false
);
}
// Get groups user has permission.
$group_um = users_get_groups_UM($config['id_user']); $group_um = users_get_groups_UM($config['id_user']);
// Is admin or has group permissions all. // Is admin or has group permissions all.
$groups = implode(',', array_keys($group_um, 1)); $groups = implode(',', array_keys($group_um, 1));
@ -44,6 +53,15 @@ function users_extension_main_god($god=true)
// Get user conected last 5 minutes.Show only those on which the user has permission. // Get user conected last 5 minutes.Show only those on which the user has permission.
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
if (users_is_admin()) {
$sql = sprintf(
'SELECT tusuario.id_user, tusuario.last_connect
FROM tusuario
WHERE last_connect > (UNIX_TIMESTAMP(NOW()) - '.SECONDS_5MINUTES.')
GROUP BY tusuario.id_user
ORDER BY last_connect DESC'
);
} else {
$sql = sprintf( $sql = sprintf(
'SELECT tusuario.id_user, tusuario.last_connect 'SELECT tusuario.id_user, tusuario.last_connect
FROM tusuario FROM tusuario
@ -54,9 +72,19 @@ function users_extension_main_god($god=true)
ORDER BY last_connect DESC', ORDER BY last_connect DESC',
$groups $groups
); );
}
break; break;
case 'postgresql': case 'postgresql':
if (users_is_admin()) {
$sql = sprintf(
"SELECT tusuario.id_user, tusuario.last_connect
FROM tusuario
WHERE last_connect > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_5MINUTES.')
GROUP BY tusuario.id_user
ORDER BY last_connect DESC'
);
} else {
$sql = sprintf( $sql = sprintf(
"SELECT tusuario.id_user, tusuario.last_connect "SELECT tusuario.id_user, tusuario.last_connect
FROM tusuario FROM tusuario
@ -67,9 +95,19 @@ function users_extension_main_god($god=true)
ORDER BY last_connect DESC', ORDER BY last_connect DESC',
$groups $groups
); );
}
break; break;
case 'oracle': case 'oracle':
if (users_is_admin()) {
$sql = sprintf(
"SELECT tusuario.id_user, tusuario.last_connect
FROM tusuario
WHERE last_connect > (ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_5MINUTES.')
GROUP BY tusuario.id_user
ORDER BY last_connect DESC'
);
} else {
$sql = sprintf( $sql = sprintf(
"SELECT tusuario.id_user, tusuario.last_connect "SELECT tusuario.id_user, tusuario.last_connect
FROM tusuario FROM tusuario
@ -80,15 +118,20 @@ function users_extension_main_god($god=true)
ORDER BY last_connect DESC', ORDER BY last_connect DESC',
$groups $groups
); );
}
break;
default:
// Nothing to do.
break; break;
} }
$rows = db_get_all_rows_sql($sql); $rows = db_get_all_rows_sql($sql);
if (empty($rows)) { if (empty($rows)) {
$rows = []; $rows = [];
echo "<div class='nf'>".__('No other users connected').'</div>'; echo "<div class='nf'>".__('No other users connected').'</div>';
} else { } else {
$table = new StdClass();
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->width = '100%'; $table->width = '100%';
@ -105,7 +148,7 @@ function users_extension_main_god($god=true)
$rowPair = true; $rowPair = true;
$iterator = 0; $iterator = 0;
// Get data // Get data.
foreach ($rows as $row) { foreach ($rows as $row) {
// Get data of user's last login. // Get data of user's last login.
switch ($config['dbtype']) { switch ($config['dbtype']) {
@ -135,6 +178,10 @@ function users_extension_main_god($god=true)
) )
); );
break; break;
default:
// Nothing to do.
break;
} }
if ($rowPair) { if ($rowPair) {
@ -159,7 +206,7 @@ function users_extension_main_god($god=true)
} }
extensions_add_operation_menu_option(__('Users connected'), 'workspace', 'users/icon.png', 'v1r1', '', 'UM'); extensions_add_operation_menu_option(__('Users connected'), 'workspace', 'users/icon.png', 'v1r1', null, 'UM');
extensions_add_godmode_function('users_extension_main_god'); extensions_add_godmode_function('users_extension_main_god');
extensions_add_main_function('users_extension_main'); extensions_add_main_function('users_extension_main');

View File

@ -106,3 +106,11 @@ enterprise/godmode/alerts/alert_events.php
enterprise/godmode/alerts/alert_events_list.php enterprise/godmode/alerts/alert_events_list.php
enterprise/godmode/alerts/alert_events_rules.php enterprise/godmode/alerts/alert_events_rules.php
enterprise/godmode/alerts/configure_alert_rule.php enterprise/godmode/alerts/configure_alert_rule.php
enterprise/include/functions_networkmap.php
enterprise/operation/agentes/pandora_networkmap.view.php
enterprise/include/ajax/map_enterprise.ajax.php
enterprise/include/javascript/SimpleMapController.js
enterprise/include/javascript/tooltipster.bundle.min.js
enterprise/include/styles/tooltipster.bundle.min.css
mobile/include/javascript/jquery.mobile-1.3.1.js
mobile/include/style/jquery.mobile-1.3.1.css

View File

@ -25,20 +25,19 @@ CREATE TABLE IF NOT EXISTS `tsync_queue` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SOURCE './procedures/updateSnmpAlerts.sql';
UPDATE `tlink` SET `link` = 'https://pandorafms.com/manual/' WHERE `id_link` = 0000000001; UPDATE `tlink` SET `link` = 'https://pandorafms.com/manual/' WHERE `id_link` = 0000000001;
UPDATE pandora.tuser_task
SET parameters='a:7:{i:0;a:7:{s:11:"description";s:30:"Template pending to be created";s:5:"table";s:16:"treport_template";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:8:"required";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:7:{s:11:"description";s:6:"Agents";s:5:"table";s:7:"tagente";s:8:"field_id";s:9:"id_agente";s:10:"field_name";s:6:"nombre";s:8:"multiple";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_grupo";}i:2;a:2:{s:11:"description";s:16:"Report per agent";s:10:"select_two";b:1;}i:3;a:2:{s:11:"description";s:11:"Report name";s:4:"type";s:6:"string";}i:4;a:2:{s:11:"description";s:47:"Send to e-mail addresses (separated by a comma)";s:4:"type";s:4:"text";}i:5;a:2:{s:11:"description";s:7:"Subject";s:8:"optional";i:1;}i:6;a:3:{s:11:"description";s:7:"Message";s:4:"type";s:4:"text";s:8:"optional";i:1;}}i:7;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}'
WHERE id=2;
UPDATE `tuser_task_scheduled` SET UPDATE `tuser_task_scheduled` SET
`args` = REPLACE (`args`, 'a:8', 'a:9'), `args`= REPLACE(`args`, 's:15:"first_execution"', 'i:8;s:3:"PDF";s:15:"first_execution"'),
`args`= REPLACE(`args`, 's:15:"first_execution"', 'i:2;s:0:"";i:7;s:3:"PDF";s:15:"first_execution"') `args` = REPLACE (`args`, 'a:8', 'a:10'),
WHERE `id_user_task` = 2; `args` = REPLACE (`args`, 'i:6', 'i:7'),
`args` = REPLACE (`args`, 'i:5', 'i:6'),
`args` = REPLACE (`args`, 'i:4', 'i:5'),
`args` = REPLACE (`args`, 'i:3', 'i:4'),
`args` = REPLACE (`args`, 'i:2', 'i:2;s:0:"";i:3')
WHERE `id_user_task` IN (SELECT id from tuser_task WHERE function_name = 'cron_task_generate_report_by_template');
UPDATE `tconfig` SET `value` = 0 WHERE `token` = `centralized_management`; UPDATE `tconfig` SET `value` = 0 WHERE `token` = 'centralized_management';
DELETE ta FROM `tagente` ta LEFT JOIN `tgrupo` tg on ta.`id_grupo` = tg.`id_grupo` WHERE tg.`id_grupo` IS NULL; DELETE ta FROM `tagente` ta LEFT JOIN `tgrupo` tg on ta.`id_grupo` = tg.`id_grupo` WHERE tg.`id_grupo` IS NULL;

View File

@ -0,0 +1,9 @@
START TRANSACTION;
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
UPDATE `tconfig` set value = 'Lato-Regular.ttf' WHERE token LIKE 'custom_report_front_font';
UPDATE `tconfig` set value = 'Lato-Regular.ttf' WHERE token LIKE 'fontpath';
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';
COMMIT;

View File

@ -0,0 +1,130 @@
START TRANSACTION;
ALTER TABLE `treport_content` ADD COLUMN `ipam_network_filter` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_network_filter` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tevent_alert` ADD COLUMN `id_template_conditions` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `id_template_fields` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tevent_filter` ADD COLUMN `time_from` TIME NULL;
ALTER TABLE `tevent_filter` ADD COLUMN `time_to` TIME NULL;
ALTER TABLE `treport_content_template` ADD COLUMN `time_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `time_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `tlayout_template` ADD COLUMN `auto_adjust` INTEGER UNSIGNED NOT NULL default 0;
INSERT INTO `treport_content` (id_report, id_gs, id_agent_module, type, period, `order`, name, description, id_agent, `text`, external_source, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, style, server_name, time_in_warning_status, checks_in_warning_status, failover_mode) SELECT id_report, 0, id_agent_module, 'availability', period, `order`, name, description, id_agent, NULL, NULL, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, '{&quot;show_in_same_row&quot;:0,&quot;hide_notinit_agents&quot;:0,&quot;priority_mode&quot;:1,&quot;dyn_height&quot;:&quot;230&quot;}', server_name, 1, 1, 0 FROM treport_content WHERE type = 'histogram_data';
INSERT INTO `treport_content_item` (id_report_content, id_agent_module, id_agent_module_failover, operation, server_name) SELECT id_rc, id_agent_module, 0, '', server_name FROM treport_content WHERE type = 'availability' AND id_agent <> 0 AND id_agent_module <> 0;
DELETE FROM `treport_content` WHERE type = 'histogram_data';
ALTER TABLE `tperfil` ADD COLUMN `network_config_view`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_edit`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_management`tinyint(1) NOT NULL DEFAULT 0;
CREATE TABLE IF NOT EXISTS `tncm_vendor` (
`id` serial,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_model` (
`id` serial,
`id_vendor` bigint(20) unsigned NOT NULL,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_template` (
`id` serial,
`name` text,
`vendors` text,
`models` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_script` (
`id` serial,
`type` int unsigned not null default 0,
`content` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_template_scripts` (
`id` serial,
`id_template` bigint(20) unsigned NOT NULL,
`id_script` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_agent` (
`id_agent` int(10) unsigned NOT NULL,
`id_vendor` bigint(20) unsigned,
`id_model` bigint(20) unsigned,
`protocol` int unsigned not null default 0,
`cred_key` varchar(100),
`adv_key` varchar(100),
`port` int(4) unsigned default 22,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
`id_template` bigint(20) unsigned,
`execute_type` int(2) UNSIGNED NOT NULL default 0,
`execute` int(2) UNSIGNED NOT NULL default 0,
`last_error` text,
PRIMARY KEY (`id_agent`),
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_model`) REFERENCES `tncm_model`(`id`) ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
`id` serial,
`id_agent` int(10) unsigned NOT NULL,
`script_type` int unsigned not null,
`data` LONGBLOB,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT IGNORE INTO `tncm_vendor` VALUES
(1,'Cisco'),
(2, 'D-Link Systems, Inc.'),
(3, 'MikroTik'),
(4, 'Alcatel-Lucent Enterprise'),
(5, 'Ubiquiti Networks, Inc.'),
(6, 'Allied Telesis, Inc.'),
(7, 'Frogfoot Networks'),
(8, 'IBM'),
(9, 'Dell Inc.'),
(10, 'Hitachi Communication Technologies, Ltd.'),
(11, 'Netlink'),
(12, 'Ascom'),
(13, 'Synology Inc.'),
(14, 'Fujitsu Network Communications, Inc.');
INSERT IGNORE INTO `tncm_model` VALUES (1,1,'7200');
INSERT IGNORE INTO `tncm_template` VALUES (1,'cisco-base','[\"1\"]','[\"1\"]');
INSERT IGNORE INTO `tncm_script` VALUES
(1,0,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;exit'),
(2,1,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;running-config&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(3,2,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;terminal&#x0d;&#x0a;_applyconfigbackup_&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(4,3,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;version&#x20;|&#x20;i&#x20;IOS&#x20;Software&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(5,5,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;term&#x0d;&#x0a;end&#x0d;&#x0a;end&#x0d;&#x0a;exit&#x0d;&#x0a;');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5);
ALTER TABLE `tevent_alert` ADD COLUMN `last_evaluation` bigint(20) NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `pool_occurrences` int unsigned not null default 0;
COMMIT;

View File

@ -1,39 +0,0 @@
DELIMITER //
CREATE PROCEDURE updateSnmpAlerts()
BEGIN
DECLARE tokenId INT DEFAULT 0;
DECLARE procedureRun INT DEFAULT 0;
DECLARE done BOOLEAN DEFAULT FALSE;
DECLARE a, b INT DEFAULT 0;
DECLARE alertsCur CURSOR FOR SELECT id, id_alert_command FROM talert_actions;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
SELECT id_config, value INTO tokenId, procedureRun FROM tconfig WHERE token = 'update_snmp_alerts_procedure_already_run' LIMIT 1;
IF procedureRun < 1 THEN
SET done = FALSE;
OPEN alertsCur;
read_loop: LOOP
FETCH alertsCur INTO a, b;
IF done THEN
LEAVE read_loop;
END IF;
UPDATE talert_snmp SET id_alert = b WHERE id_alert = a;
UPDATE talert_snmp_action SET alert_type = b WHERE alert_type = a;
END LOOP;
CLOSE alertsCur;
IF tokenId < 1 THEN
INSERT INTO tconfig (id_config, token, value) VALUES ('', 'update_snmp_alerts_procedure_already_run', '1');
ELSE
UPDATE tconfig SET value = 1 WHERE token = 'update_snmp_alerts_procedure_already_run';
END IF;
END IF;
END//
DELIMITER ;
CALL updateSnmpAlerts();
DROP PROCEDURE updateSnmpAlerts;

View File

@ -710,6 +710,10 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` (
ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0; 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; ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400;
ALTER TABLE `tevent_alert` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; ALTER TABLE `tevent_alert` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0;
ALTER TABLE `tevent_alert` ADD COLUMN `id_template_conditions` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `id_template_fields` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `last_evaluation` bigint(20) NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `pool_occurrences` int unsigned not null default 0;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tevent_alert_action` -- Table `tevent_alert_action`
@ -896,6 +900,11 @@ ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNE
ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content_template` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content_template` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `time_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_network_filter` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
-- Table `tnews` -- Table `tnews`
@ -1028,6 +1037,7 @@ ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`); ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`); ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`); ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`);
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tmetaconsole_event_history` -- Table `tmetaconsole_event_history`
@ -1440,13 +1450,13 @@ ALTER TABLE `ttag` MODIFY COLUMN `name` text NOT NULL default '';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 48); INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 50);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 756); INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 758);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
@ -1514,6 +1524,8 @@ ALTER TABLE tevent_filter ADD COLUMN `id_source_event` int(10);
ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL; ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL;
ALTER TABLE `tevent_filter` MODIFY COLUMN `severity` text NOT NULL; ALTER TABLE `tevent_filter` MODIFY COLUMN `severity` text NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `server_id` int(10) NOT NULL default 0; ALTER TABLE tevent_filter ADD COLUMN `server_id` int(10) NOT NULL default 0;
ALTER TABLE `tevent_filter` ADD COLUMN `time_from` TIME NULL;
ALTER TABLE `tevent_filter` ADD COLUMN `time_to` TIME NULL;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tusuario` -- Table `tusuario`
@ -1773,6 +1785,11 @@ ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NUL
ALTER TABLE `treport_content` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content` MODIFY `external_source` MEDIUMTEXT; ALTER TABLE `treport_content` MODIFY `external_source` MEDIUMTEXT;
ALTER TABLE `treport_content` ADD COLUMN `time_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `ipam_network_filter` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tmodule_relationship` -- Table `tmodule_relationship`
@ -2216,6 +2233,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_template` (
) ENGINE = InnoDB DEFAULT CHARSET=utf8; ) ENGINE = InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL; ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL;
ALTER TABLE `tlayout` ADD COLUMN `auto_adjust` INTEGER UNSIGNED NOT NULL default 0;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tlayout_template_data` -- Table `tlayout_template_data`
@ -2350,6 +2368,8 @@ ALTER TABLE `tevento` ADD COLUMN `data` double(50,5) default NULL;
ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0'; ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tevent_extended` -- Table `tevent_extended`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
@ -2567,7 +2587,7 @@ ALTER TABLE `tnetflow_filter` MODIFY COLUMN `router_ip` text NOT NULL;
UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report"; UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
INSERT IGNORE INTO tuser_task VALUES (8, 'cron_task_generate_csv_log', 'a:1:{i:0;a:2:{s:11:"description";s:14:"Send to e-mail";s:4:"type";s:4:"text";}}', 'Send csv log'); INSERT IGNORE INTO tuser_task VALUES (8, 'cron_task_generate_csv_log', 'a:1:{i:0;a:2:{s:11:"description";s:14:"Send to e-mail";s:4:"type";s:4:"text";}}', 'Send csv log');
UPDATE `tuser_task` SET `parameters`='a:4:{i:0;a:6:{s:11:"description";s:28:"Report pending to be created";s:5:"table";s:7:"treport";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:2:{s:11:"description";s:426:"Save to disk in path<a href="javascript:" class="tip" style="" ><img src="http://172.16.0.2/pandora_console/images/tip_help.png" data-title="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" data-use_title_for_force_title="1" class="forced_title" alt="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" /></a>";s:4:"type";s:6:"string";}i:2;a:2:{s:11:"description";s:16:"File nane prefix";s:4:"type";s:6:"string";}i:3;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}' WHERE `id`=3; UPDATE `tuser_task` SET `parameters`='a:4:{i:0;a:6:{s:11:"description";s:28:"Report pending to be created";s:5:"table";s:7:"treport";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:2:{s:11:"description";s:426:"Save to disk in path<a href="javascript:" class="tip" style="" ><img src="http://172.16.0.2/pandora_console/images/tip_help.png" data-title="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" data-use_title_for_force_title="1" class="forced_title" alt="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" /></a>";s:4:"type";s:6:"string";}i:2;a:2:{s:11:"description";s:16:"File nane prefix";s:4:"type";s:6:"string";}i:3;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}' WHERE `id`=3;
UPDATE pandora.tuser_task UPDATE `tuser_task`
SET parameters='a:7:{i:0;a:7:{s:11:"description";s:30:"Template pending to be created";s:5:"table";s:16:"treport_template";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:8:"required";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:7:{s:11:"description";s:6:"Agents";s:5:"table";s:7:"tagente";s:8:"field_id";s:9:"id_agente";s:10:"field_name";s:6:"nombre";s:8:"multiple";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_grupo";}i:2;a:2:{s:11:"description";s:16:"Report per agent";s:10:"select_two";b:1;}i:3;a:2:{s:11:"description";s:11:"Report name";s:4:"type";s:6:"string";}i:4;a:2:{s:11:"description";s:47:"Send to e-mail addresses (separated by a comma)";s:4:"type";s:4:"text";}i:5;a:2:{s:11:"description";s:7:"Subject";s:8:"optional";i:1;}i:6;a:3:{s:11:"description";s:7:"Message";s:4:"type";s:4:"text";s:8:"optional";i:1;}}i:7;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}' WHERE id=2; SET parameters='a:7:{i:0;a:7:{s:11:"description";s:30:"Template pending to be created";s:5:"table";s:16:"treport_template";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:8:"required";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:7:{s:11:"description";s:6:"Agents";s:5:"table";s:7:"tagente";s:8:"field_id";s:9:"id_agente";s:10:"field_name";s:6:"nombre";s:8:"multiple";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_grupo";}i:2;a:2:{s:11:"description";s:16:"Report per agent";s:10:"select_two";b:1;}i:3;a:2:{s:11:"description";s:11:"Report name";s:4:"type";s:6:"string";}i:4;a:2:{s:11:"description";s:47:"Send to e-mail addresses (separated by a comma)";s:4:"type";s:4:"text";}i:5;a:2:{s:11:"description";s:7:"Subject";s:8:"optional";i:1;}i:6;a:3:{s:11:"description";s:7:"Message";s:4:"type";s:4:"text";s:8:"optional";i:1;}}i:7;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}' WHERE id=2;
DELETE FROM `tuser_task` WHERE id = 6; DELETE FROM `tuser_task` WHERE id = 6;
@ -4063,6 +4083,10 @@ ALTER TABLE `tperfil` DROP COLUMN `incident_view`;
ALTER TABLE `tperfil` DROP COLUMN `incident_edit`; ALTER TABLE `tperfil` DROP COLUMN `incident_edit`;
ALTER TABLE `tperfil` DROP COLUMN `incident_management`; ALTER TABLE `tperfil` DROP COLUMN `incident_management`;
ALTER TABLE `tperfil` ADD COLUMN `network_config_view`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_edit`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_management`tinyint(1) NOT NULL DEFAULT 0;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `talert_execution_queue` -- Table `talert_execution_queue`
-- ----------------------------------------------------- -- -----------------------------------------------------
@ -4075,3 +4099,127 @@ CREATE TABLE IF NOT EXISTS `talert_execution_queue` (
`utimestamp` bigint(20) NOT NULL default '0', `utimestamp` bigint(20) NOT NULL default '0',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';
-- ----------------------------------------------------------------------
-- Table `tncm_vendor`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_vendor` (
`id` serial,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_model`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_model` (
`id` serial,
`id_vendor` bigint(20) unsigned NOT NULL,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_template`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_template` (
`id` serial,
`name` text,
`vendors` text,
`models` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_script`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_script` (
`id` serial,
`type` int unsigned not null default 0,
`content` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_template_scripts`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_template_scripts` (
`id` serial,
`id_template` bigint(20) unsigned NOT NULL,
`id_script` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_agent`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_agent` (
`id_agent` int(10) unsigned NOT NULL,
`id_vendor` bigint(20) unsigned,
`id_model` bigint(20) unsigned,
`protocol` int unsigned not null default 0,
`cred_key` varchar(100),
`adv_key` varchar(100),
`port` int(4) unsigned default 22,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
`id_template` bigint(20) unsigned,
`execute_type` int(2) UNSIGNED NOT NULL default 0,
`execute` int(2) UNSIGNED NOT NULL default 0,
`last_error` text,
PRIMARY KEY (`id_agent`),
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_model`) REFERENCES `tncm_model`(`id`) ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_agent_data`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
`id` serial,
`id_agent` int(10) unsigned NOT NULL,
`script_type` int unsigned not null,
`data` LONGBLOB,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `tncm_vendor` VALUES
(1,'Cisco'),
(2, 'D-Link Systems, Inc.'),
(3, 'MikroTik'),
(4, 'Alcatel-Lucent Enterprise'),
(5, 'Ubiquiti Networks, Inc.'),
(6, 'Allied Telesis, Inc.'),
(7, 'Frogfoot Networks'),
(8, 'IBM'),
(9, 'Dell Inc.'),
(10, 'Hitachi Communication Technologies, Ltd.'),
(11, 'Netlink'),
(12, 'Ascom'),
(13, 'Synology Inc.'),
(14, 'Fujitsu Network Communications, Inc.');
INSERT INTO `tncm_model` VALUES (1,1,'7200');
INSERT INTO `tncm_template` VALUES (1,'cisco-base','[\"1\"]','[\"1\"]');
INSERT INTO `tncm_script` VALUES
(1,0,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;exit'),
(2,1,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;running-config&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(3,2,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;terminal&#x0d;&#x0a;_applyconfigbackup_&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(4,3,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;version&#x20;|&#x20;i&#x20;IOS&#x20;Software&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(5,5,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;term&#x0d;&#x0a;end&#x0d;&#x0a;end&#x0d;&#x0a;exit&#x0d;&#x0a;');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5);

View File

@ -46,11 +46,11 @@ ui_require_css_file('first_task');
ui_print_info_message(['no_close' => true, 'message' => __('There are no clusters defined yet.') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no clusters defined yet.') ]);
?> ?>
<div class="new_task_cluster"> <div class="new_task">
<div class="image_task_cluster"> <div class="image_task">
<?php echo html_print_image('images/first_task/icono-cluster-activo.png', true, ['title' => __('Clusters')]); ?> <?php echo html_print_image('images/first_task/icono-cluster-activo.png', true, ['title' => __('Clusters')]); ?>
</div> </div>
<div class="text_task_cluster"> <div class="text_task">
<h3> <?php echo __('Create Cluster'); ?></h3> <h3> <?php echo __('Create Cluster'); ?></h3>
<p id="description_task"> <p id="description_task">
<?php <?php

View File

@ -23,13 +23,8 @@ ui_require_css_file('order_interpreter');
// Global errors/warnings checking. // Global errors/warnings checking.
config_check(); config_check();
echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
if ($config['menu_type'] == 'classic') {
echo '<div id="header_table" class="header_table_classic">';
} else {
echo '<div id="header_table" class="header_table_collapsed">';
}
?> ?>
<div id="header_table_inner"> <div id="header_table_inner">
<?php <?php

View File

@ -63,6 +63,7 @@ switch ($login_screen) {
case 'error_perms': case 'error_perms':
case 'homedir_bad_defined': case 'homedir_bad_defined':
case 'homeurl_bad_defined': case 'homeurl_bad_defined':
case 'disabled_access_node':
$logo_link = 'index.php'; $logo_link = 'index.php';
$logo_title = __('Go to Login'); $logo_title = __('Go to Login');
break; break;
@ -208,6 +209,7 @@ if (is_metaconsole() === true) {
switch ($login_screen) { switch ($login_screen) {
case 'logout': case 'logout':
case 'login': case 'login':
case 'disabled_access_node':
if (!empty($page) && !empty($sec)) { if (!empty($page) && !empty($sec)) {
foreach ($_POST as $key => $value) { foreach ($_POST as $key => $value) {
html_print_input_hidden(io_safe_input($key), io_safe_input($value)); html_print_input_hidden(io_safe_input($key), io_safe_input($value));
@ -508,9 +510,29 @@ if ($login_screen == 'logout') {
echo '</div>'; echo '</div>';
} }
if ($login_screen === 'disabled_access_node') {
echo '<div id="disabled_access_node" title="'.__('User node access not enabled').'">';
echo '<div class="content_alert">';
echo '<div class="icon_message_alert">';
echo html_print_image('images/icono_logo_pandora.png', true, ['alt' => __('Centralized user in metaconsole'), 'border' => 0]);
echo '</div>';
echo '<div class="content_message_alert">';
echo '<div class="text_message_alert">';
echo '<h1>'.__('Centralized user in metaconsole').'</h1>';
echo '<p>'.__('This user does not have access on node, please enable node access on this user from metaconsole.').'</p>';
echo '</div>';
echo '<div class="button_message_alert">';
html_print_submit_button('Ok', 'hide-login-logout', false);
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
switch ($login_screen) { switch ($login_screen) {
case 'error_dbconfig': case 'error_dbconfig':
case 'error_authconfig': case 'error_authconfig':
case 'disabled_node_access':
if (!isset($config['rb_product_name_alt'])) { if (!isset($config['rb_product_name_alt'])) {
$title = __('Problem with %s database', get_product_name()); $title = __('Problem with %s database', get_product_name());
} else { } else {
@ -694,6 +716,29 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
}); });
break; break;
case 'disabled_access_node':
$(document).ready (function () {
$(function() {
$("#disabled_access_node").dialog({
resizable: true,
draggable: true,
modal: true,
height: 220,
width: 528,
clickOutside: true,
overlay: {
opacity: 0.5,
background: "black"
}
});
});
$("#submit-hide-login-logout").click (function () {
document.location = "<?php echo ui_get_full_url('index.php'); ?>";
});
});
break;
default: default:
$(document).ready (function () { $(document).ready (function () {
// IE9- modal warning window // IE9- modal warning window

View File

@ -64,6 +64,8 @@ $data['monitor_critical'] = (int) $all_data['_monitors_critical_'];
$data['monitor_not_normal'] = (int) $all_data['_monitor_not_normal_']; $data['monitor_not_normal'] = (int) $all_data['_monitor_not_normal_'];
$data['monitor_alerts'] = (int) $all_data['_monitors_alerts_']; $data['monitor_alerts'] = (int) $all_data['_monitors_alerts_'];
$data['monitor_alerts_fired'] = (int) $all_data['_monitors_alerts_fired_']; $data['monitor_alerts_fired'] = (int) $all_data['_monitors_alerts_fired_'];
$data['monitor_total'] = (int) $all_data['_monitor_total_'];
$data['total_agents'] = (int) $all_data['_total_agents_']; $data['total_agents'] = (int) $all_data['_total_agents_'];

View File

@ -1,17 +1,33 @@
<?php <?php
/**
* Lateral Main Menu.
*
* @category Main Menu.
* @package Pandora FMS.
* @subpackage OpenSource.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 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.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com // Begin.
// ================================================== if (isset($config['id_user']) === false) {
// Copyright (c) 2005-2021 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.
if (! isset($config['id_user'])) {
include 'general/login_page.php'; include 'general/login_page.php';
exit(); exit();
} }
@ -20,9 +36,9 @@ if (! isset($config['id_user'])) {
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(document).ready(function(){ $(document).ready(function(){
var menuType_value = "<?php echo $config['menu_type']; ?>"; var menuType_value = "<?php echo $_SESSION['menu_type']; ?>";
if (menuType_value == 'classic') { if (menuType_value === '' || menuType_value === 'classic') {
$('ul.submenu').css('left', '214px'); $('ul.submenu').css('left', '214px');
} }
else{ else{
@ -34,26 +50,22 @@ $(document).ready(function(){
<?php <?php
$autohidden_menu = 0; $autohidden_menu = 0;
if (isset($config['autohidden_menu']) && $config['autohidden_menu']) { if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_menu'] === true) {
$autohidden_menu = 1; $autohidden_menu = 1;
} }
// Menu container prepared to autohide menu // Start of full lateral menu.
if ($config['menu_type'] == 'classic') { echo sprintf('<div id="menu_full" class="menu_full_%s">', $menuTypeClass);
echo '<div id="menu_full" class="menu_full_classic">';
} else {
echo '<div id="menu_full" class="menu_full_collapsed">';
}
$custom_logo = 'images/custom_logo/'.$config['custom_logo']; $custom_logo = 'images/custom_logo/'.$config['custom_logo'];
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed']; $custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
if (!defined('PANDORA_ENTERPRISE')) { if (defined('PANDORA_ENTERPRISE') === false) {
$logo_title = get_product_name().' Opensource'; $logo_title = get_product_name().' Opensource';
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png'; $custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png'; $custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
} else { } else {
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) { if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo) === true) {
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo; $custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
} }
@ -61,54 +73,48 @@ if (!defined('PANDORA_ENTERPRISE')) {
} }
echo '<div class="logo_green"><a href="index.php?sec=main">'; echo '<div class="logo_green"><a href="index.php?sec=main">';
if (isset($config['custom_logo'])) {
if ($config['menu_type'] == 'classic') { if (isset($config['custom_logo']) === true) {
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:block']); echo html_print_image(
} else { $custom_logo,
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:none']); true,
} [
'border' => '0',
'width' => '215',
'alt' => $logo_title,
'class' => 'logo_full',
'style' => ($menuCollapsed === true) ? 'display:none' : 'display:block',
]
);
} }
if (isset($config['custom_logo_collapsed'])) { if (isset($config['custom_logo_collapsed']) === true) {
if ($config['menu_type'] == 'classic') { echo html_print_image(
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:none']); $custom_logo_collapsed,
} else { true,
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:block']); [
} 'border' => '0',
'width' => '60',
'alt' => $logo_title,
'class' => 'logo_icon',
'style' => ($menuCollapsed === true) ? 'display:block' : 'display:none',
]
);
} }
echo '</a></div>'; echo '</a></div>';
// echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
require 'operation/menu.php'; require 'operation/menu.php';
// Check all enterprise ACL used in godmenu items to print menu headers
if (check_acl($config['id_user'], 0, 'AW')
|| check_acl($config['id_user'], 0, 'PM')
|| check_acl($config['id_user'], 0, 'LM')
|| check_acl($config['id_user'], 0, 'UM')
|| check_acl($config['id_user'], 0, 'LW')
|| check_acl($config['id_user'], 0, 'EW')
|| check_acl($config['id_user'], 0, 'DW')
) {
// echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
}
require 'godmode/menu.php'; require 'godmode/menu.php';
if ($config['menu_type'] == 'classic') { echo sprintf('<div id="button_collapse" class="button_%s button_collapse"></div>', $menuTypeClass);
echo '<div id="button_collapse" class="button_classic button_collapse"></div>';
} else {
echo '<div id="button_collapse" class="button_collapsed button_collapse"></div>';
}
// require ("links_menu.php");
echo '</div>'; echo '</div>';
// menu_container // Menu_container.
ui_require_jquery_file('cookie'); ui_require_jquery_file('cookie');
$config_fixed_header = false; $config_fixed_header = false;
if (isset($config['fixed_header'])) { if (isset($config['fixed_header']) === true) {
$config_fixed_header = $config['fixed_header']; $config_fixed_header = $config['fixed_header'];
} }
?> ?>

View File

@ -341,6 +341,7 @@ if (isset($groups[$grupo]) || $new_agent) {
'selected' => $grupo, 'selected' => $grupo,
'return' => true, 'return' => true,
'required' => true, 'required' => true,
'privilege' => 'AW',
] ]
); );
} else { } else {
@ -349,7 +350,14 @@ if (isset($groups[$grupo]) || $new_agent) {
} }
$table_primary_group .= '<div class="label_select_child_icons"><span id="group_preview">'; $table_primary_group .= '<div class="label_select_child_icons"><span id="group_preview">';
$table_primary_group .= ui_print_group_icon($grupo, true); if ($id_agente === 0) {
$hidden = 'display: none;';
} else {
$hidden = '';
}
$table_primary_group .= ui_print_group_icon($grupo, true, 'groups_small', $hidden);
$table_primary_group .= '</span></div></div></div>'; $table_primary_group .= '</span></div></div></div>';
$table_interval = '<div class="label_select"><p class="input_label">'.__('Interval').'</p>'; $table_interval = '<div class="label_select"><p class="input_label">'.__('Interval').'</p>';
@ -500,7 +508,10 @@ if (enterprise_installed()) {
false, false,
// Delete_groups. // Delete_groups.
// Do not show the primary group in this selection. // Do not show the primary group in this selection.
array_merge(($secondary_groups_selected['plain'] ?? []), [$agent['id_grupo']]) array_merge(
(empty($secondary_groups_selected['plain']) === false) ? $secondary_groups_selected['plain'] : [],
[$agent['id_grupo']]
)
// Include_groups. // Include_groups.
// Size. // Size.
// Simple_multiple_options. // Simple_multiple_options.
@ -1243,6 +1254,9 @@ ui_require_jquery_file('bgiframe');
}); });
$("select#id_os").pandoraSelectOS (); $("select#id_os").pandoraSelectOS ();
$('select#grupo').pandoraSelectGroupIcon ();
var checked = $("#checkbox-cascade_protection").is(":checked"); var checked = $("#checkbox-cascade_protection").is(":checked");
if (checked) { if (checked) {

View File

@ -196,6 +196,13 @@ if ($create_agent) {
$nombre_agente = hash('sha256', $alias.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000))); $nombre_agente = hash('sha256', $alias.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
$grupo = (int) get_parameter_post('grupo'); $grupo = (int) get_parameter_post('grupo');
if ((bool) check_acl($config['id_user'], $grupo, 'AW') === false) {
db_pandora_audit('ACL Violation', 'Trying to access agent manager');
include $config['homedir'].'/general/noaccess.php';
return;
}
$intervalo = (string) get_parameter_post('intervalo', SECONDS_5MINUTES); $intervalo = (string) get_parameter_post('intervalo', SECONDS_5MINUTES);
$comentarios = (string) get_parameter_post('comentarios', ''); $comentarios = (string) get_parameter_post('comentarios', '');
$modo = (int) get_parameter_post('modo'); $modo = (int) get_parameter_post('modo');
@ -485,6 +492,13 @@ if ($id_agente) {
$collectiontab = ''; $collectiontab = '';
} }
// NetworkConfigManager tab.
$ncm_tab = enterprise_hook('networkconfigmanager_tab');
if ($ncm_tab === ENTERPRISE_NOT_HOOK) {
$ncm_tab = '';
}
// Group tab. // Group tab.
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image( $grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image(
'images/group.png', 'images/group.png',
@ -616,6 +630,7 @@ if ($id_agente) {
'main' => $maintab, 'main' => $maintab,
'remote_configuration' => $remote_configuration_tab, 'remote_configuration' => $remote_configuration_tab,
'module' => $moduletab, 'module' => $moduletab,
'ncm' => $ncm_tab,
'alert' => $alerttab, 'alert' => $alerttab,
'template' => $templatetab, 'template' => $templatetab,
'inventory' => $inventorytab, 'inventory' => $inventorytab,
@ -631,6 +646,7 @@ if ($id_agente) {
'separator' => '', 'separator' => '',
'main' => $maintab, 'main' => $maintab,
'module' => $moduletab, 'module' => $moduletab,
'ncm' => $ncm_tab,
'alert' => $alerttab, 'alert' => $alerttab,
'template' => $templatetab, 'template' => $templatetab,
'inventory' => $inventorytab, 'inventory' => $inventorytab,
@ -699,6 +715,11 @@ if ($id_agente) {
$tab_name = 'Collection'; $tab_name = 'Collection';
break; break;
case 'ncm':
$tab_description = '- '.__('Network config manager');
$tab_name = 'Network config manager';
break;
case 'inventory': case 'inventory':
$tab_description = '- '.__('Inventory'); $tab_description = '- '.__('Inventory');
$help_header = 'inventory_tab'; $help_header = 'inventory_tab';
@ -976,6 +997,8 @@ if ($update_agent) {
$cps = get_parameter_switch('cps', -1); $cps = get_parameter_switch('cps', -1);
$old_values = db_get_row('tagente', 'id_agente', $id_agente); $old_values = db_get_row('tagente', 'id_agente', $id_agente);
$fields = db_get_all_fields_in_table('tagent_custom_fields'); $fields = db_get_all_fields_in_table('tagent_custom_fields');
$secondary_groups = (string) get_parameter('secondary_hidden', '');
if ($fields === false) { if ($fields === false) {
$fields = []; $fields = [];
@ -1205,7 +1228,16 @@ if ($update_agent) {
"Quiet":"'.(int) $quiet.'", "Quiet":"'.(int) $quiet.'",
"Cps":"'.(int) $cps.'"}'; "Cps":"'.(int) $cps.'"}';
enterprise_hook('update_agent', [$id_agente]); // Create the secondary groups.
enterprise_hook(
'agents_update_secondary_groups',
[
$id_agente,
explode(',', $secondary_groups),
[],
]
);
ui_print_success_message(__('Successfully updated')); ui_print_success_message(__('Successfully updated'));
db_pandora_audit( db_pandora_audit(
'Agent management', 'Agent management',
@ -2095,7 +2127,7 @@ if ($delete_module) {
exit; exit;
} }
// Also call base function to delete modules madafakas de los cojones. // Also call base function to delete modules.
modules_delete_agent_module($id_borrar_modulo); modules_delete_agent_module($id_borrar_modulo);
// Check for errors. // Check for errors.
@ -2313,6 +2345,10 @@ switch ($tab) {
include 'agent_incidents.php'; include 'agent_incidents.php';
break; break;
case 'ncm':
enterprise_hook('ncm_agent_tab', [$id_agente]);
break;
case 'remote_configuration': case 'remote_configuration':
enterprise_include('godmode/agentes/agent_disk_conf_editor.php'); enterprise_include('godmode/agentes/agent_disk_conf_editor.php');
break; break;
@ -2368,7 +2404,7 @@ switch ($tab) {
var aget_id_os = '<?php echo agents_get_os(modules_get_agentmodule_agent(get_parameter('id_agent_module'))); ?>'; var aget_id_os = '<?php echo agents_get_os(modules_get_agentmodule_agent(get_parameter('id_agent_module'))); ?>';
if('<?php echo html_entity_decode(modules_get_agentmodule_name(get_parameter('id_agent_module'))); ?>' != $('#text-name').val() && if('<?php echo modules_get_agentmodule_name(get_parameter('id_agent_module')); ?>' != $('#text-name').val() &&
'<?php echo agents_get_os(modules_get_agentmodule_agent(get_parameter('id_agent_module'))); ?>' == 19){ '<?php echo agents_get_os(modules_get_agentmodule_agent(get_parameter('id_agent_module'))); ?>' == 19){
event.preventDefault(); event.preventDefault();
@ -2402,7 +2438,7 @@ switch ($tab) {
var module_type_snmp = '<?php echo modules_get_agentmodule_type(get_parameter('id_agent_module')); ?>'; var module_type_snmp = '<?php echo modules_get_agentmodule_type(get_parameter('id_agent_module')); ?>';
if('<?php echo html_entity_decode(modules_get_agentmodule_name(get_parameter('id_agent_module'))); ?>' != $('#text-name').val() && ( if('<?php echo modules_get_agentmodule_name(get_parameter('id_agent_module')); ?>' != $('#text-name').val() && (
module_type_snmp == 15 || module_type_snmp == 16 || module_type_snmp == 17 || module_type_snmp == 18)){ module_type_snmp == 15 || module_type_snmp == 16 || module_type_snmp == 17 || module_type_snmp == 18)){
event.preventDefault(); event.preventDefault();

View File

@ -111,12 +111,18 @@ ui_print_standard_header(
); );
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=monitoring&sec2=monitoring/wizard/wizard'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. Go to %s to delete an agent', 'This node is configured with centralized mode. Go to %s to delete an agent',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=monitoring&sec2=monitoring/wizard/wizard'
).'">'.__('metaconsole').'</a>'
) )
); );
} }
@ -904,7 +910,7 @@ if ($agents !== false) {
echo ' onClick="if (!confirm(\' '.__('You are going to enable a cluster agent. Are you sure?').'\')) return false;">'; echo ' onClick="if (!confirm(\' '.__('You are going to enable a cluster agent. Are you sure?').'\')) return false;">';
} }
echo html_print_image('images/lightbulb_off.png', true, ['alt' => __('Enable agent'), 'title' => __('Enable agent')]).'</a>'; echo html_print_image('images/lightbulb_off.png', true, ['alt' => __('Enable agent'), 'title' => __('Enable agent'), 'class' => 'filter_none']).'</a>';
} else { } else {
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente& echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
disable_agent=".$agent['id_agente']."&group_id=$ag_group&recursion=$recursion&search=$search&offset=$offsetArg&sort_field=$sortField&sort=$sort&disabled=$disabled'"; disable_agent=".$agent['id_agente']."&group_id=$ag_group&recursion=$recursion&search=$search&offset=$offsetArg&sort_field=$sortField&sort=$sort&disabled=$disabled'";

View File

@ -1130,6 +1130,7 @@ foreach ($modules as $module) {
[ [
'alt' => __('Enable module'), 'alt' => __('Enable module'),
'title' => __('Enable module'), 'title' => __('Enable module'),
'class' => 'filter_none',
] ]
).'</a>'; ).'</a>';
} else { } else {
@ -1139,7 +1140,6 @@ foreach ($modules as $module) {
[ [
'alt' => __('Disable module'), 'alt' => __('Disable module'),
'title' => __('Disable module'), 'title' => __('Disable module'),
'class' => 'invert_filter',
] ]
).'</a>'; ).'</a>';
} }

View File

@ -26,7 +26,7 @@
* ============================================================================ * ============================================================================
*/ */
// Begin // Begin.
require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_modules.php';
require_once $config['homedir'].'/include/functions_categories.php'; require_once $config['homedir'].'/include/functions_categories.php';
require_once $config['homedir'].'/include/graphs/functions_d3.php'; require_once $config['homedir'].'/include/graphs/functions_d3.php';
@ -139,7 +139,7 @@ function add_component_selection($id_network_component_type)
true, true,
'', '',
false, false,
'width: 460px; ' 'width: 350px; '
); );
$data[1] .= '</span>'; $data[1] .= '</span>';
$data[1] .= ' <span id="component_loading" class="invisible">'; $data[1] .= ' <span id="component_loading" class="invisible">';
@ -215,7 +215,7 @@ $table_simple->colspan[3][1] = 3;
$table_simple->data[0][0] = __('Name'); $table_simple->data[0][0] = __('Name');
$table_simple->data[0][1] = html_print_input_text_extended( $table_simple->data[0][1] = html_print_input_text_extended(
'name', 'name',
io_safe_input(html_entity_decode($name, ENT_QUOTES, 'UTF-8')), $name,
'text-name', 'text-name',
'', '',
45, 45,
@ -273,7 +273,8 @@ $table_simple->data[0][3] .= html_print_select_from_sql(
true, true,
false, false,
true, true,
$disabledBecauseInPolicy $disabledBecauseInPolicy,
'width: 150px'
); );
if ((isset($id_agent_module) && $id_agent_module) || $id_policy_module != 0) { if ((isset($id_agent_module) && $id_agent_module) || $id_policy_module != 0) {
@ -358,7 +359,7 @@ if (!$edit) {
false, false,
'', '',
false, false,
false, 'width:200px',
false, false,
100 100
); );
@ -637,7 +638,7 @@ $table_advanced->data[1][4] = html_print_extended_select_for_post_process(
'0', '0',
false, false,
true, true,
false, 'width:10em',
false, false,
$disabledBecauseInPolicy $disabledBecauseInPolicy
); );

View File

@ -443,6 +443,13 @@ $data[1] = html_print_input_text_extended(
$largeClassDisabledBecauseInPolicy, $largeClassDisabledBecauseInPolicy,
true true
); );
$data[1] .= ui_print_help_tip(
__(
'Please use single quotation marks when necessary. '."\n".'
If double quotation marks are needed, please escape them with a backslash (\&quot;)'
),
true
);
$table_simple->colspan['row-cmd-row-1'][1] = 3; $table_simple->colspan['row-cmd-row-1'][1] = 3;
push_table_simple($data, 'row-cmd-row-1'); push_table_simple($data, 'row-cmd-row-1');
@ -577,12 +584,7 @@ $(document).ready (function () {
$('#text-ip_target').keyup(function() { $('#text-ip_target').keyup(function() {
$('#text-target_ip').val($(this).val()); $('#text-target_ip').val($(this).val());
}); });
$('#text-target_ip').keyup(function() {
$('#text-ip_target').val($(this).val());
});
$('#text-community').keyup(function() {
$('#text-snmp_community').val($(this).val());
});
$('#text-snmp_community').keyup(function() { $('#text-snmp_community').keyup(function() {
$('#text-community').val($(this).val()); $('#text-community').val($(this).val());
}); });
@ -591,61 +593,25 @@ $(document).ready (function () {
// Display or collapse the SNMP browser's v3 options // Display or collapse the SNMP browser's v3 options
checkSNMPVersion (); checkSNMPVersion ();
}); });
$('#snmp_browser_version').change(function() {
$('#snmp_version').val($(this).val());
// Display or collapse the SNMP v3 options in the main window
if ($(this).val() == "3") {
$("#simple-field_snmpv3_row1").attr("style", "");
$("#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');
}
});
$('#snmp3_auth_user').keyup(function() { $('#snmp3_auth_user').keyup(function() {
$('#snmp3_browser_auth_user').val($(this).val()); $('#snmp3_browser_auth_user').val($(this).val());
}); });
$('#snmp3_browser_auth_user').keyup(function() {
$('#snmp3_auth_user').val($(this).val());
});
$('#snmp3_security_level').change(function() { $('#snmp3_security_level').change(function() {
$('#snmp3_browser_security_level').val($(this).val()); $('#snmp3_browser_security_level').val($(this).val());
}); });
$('#snmp3_browser_security_level').change(function() {
$('#snmp3_security_level').val($(this).val());
});
$('#snmp3_auth_method').change(function() { $('#snmp3_auth_method').change(function() {
$('#snmp3_browser_auth_method').val($(this).val()); $('#snmp3_browser_auth_method').val($(this).val());
}); });
$('#snmp3_browser_auth_method').change(function() {
$('#snmp3_auth_method').val($(this).val());
});
$('#snmp3_auth_pass').keyup(function() { $('#snmp3_auth_pass').keyup(function() {
$('#snmp3_browser_auth_pass').val($(this).val()); $('#snmp3_browser_auth_pass').val($(this).val());
}); });
$('#snmp3_browser_auth_pass').keyup(function() {
$('#snmp3_auth_pass').val($(this).val());
});
$('#snmp3_privacy_method').change(function() { $('#snmp3_privacy_method').change(function() {
$('#snmp3_browser_privacy_method').val($(this).val()); $('#snmp3_browser_privacy_method').val($(this).val());
}); });
$('#snmp3_browser_privacy_method').change(function() {
$('#snmp3_privacy_method').val($(this).val());
});
$('#snmp3_privacy_pass').keyup(function() { $('#snmp3_privacy_pass').keyup(function() {
$('#snmp3_browser_privacy_pass').val($(this).val()); $('#snmp3_browser_privacy_pass').val($(this).val());
}); });
$('#snmp3_browser_privacy_pass').keyup(function() {
$('#snmp3_privacy_pass').val($(this).val());
});
var custom_ip_target = "<?php echo $custom_ip_target; ?>"; var custom_ip_target = "<?php echo $custom_ip_target; ?>";
if(custom_ip_target == ''){ if(custom_ip_target == ''){
$("#text-custom_ip_target").hide(); $("#text-custom_ip_target").hide();

View File

@ -0,0 +1,195 @@
<?php
/**
* Empty Network map editor.
*
* @category View
* @package Pandora FMS
* @subpackage Enterprise
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 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.
* ============================================================================
*/
// Begin.
global $config;
// Check user credentials
check_login();
$id = (int) get_parameter('id_networkmap', 0);
$new_empty_networkmap = (bool) get_parameter('new_empty_networkmap', false);
$edit_networkmap = (bool) get_parameter('edit_networkmap', false);
$not_found = false;
if (empty($id)) {
$new_empty_networkmap = true;
$edit_networkmap = false;
}
if ($new_empty_networkmap) {
$name = '';
$id_group = 0;
$node_radius = 40;
$description = '';
}
if ($edit_networkmap) {
if (enterprise_installed()) {
$disabled_generation_method_select = true;
}
$disabled_source = true;
$values = db_get_row('tmap', 'id', $id);
$not_found = false;
if ($values === false) {
$not_found = true;
} else {
$id_group = $values['id_group'];
// ACL for the network map
// $networkmap_read = check_acl ($config['id_user'], $id_group, "MR");
$networkmap_write = check_acl($config['id_user'], $id_group, 'MW');
$networkmap_manage = check_acl($config['id_user'], $id_group, 'MM');
if (!$networkmap_write && !$networkmap_manage) {
db_pandora_audit(
'ACL Violation',
'Trying to access networkmap'
);
include 'general/noaccess.php';
return;
}
$name = io_safe_output($values['name']);
$description = $values['description'];
$filter = json_decode($values['filter'], true);
$node_radius = $filter['node_radius'];
}
}
// Header.
ui_print_standard_header(
__('Empty Network maps editor'),
'images/bricks.png',
false,
'network_map_enterprise_edit',
false,
[],
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Networkmap'),
],
]
);
if ($not_found) {
ui_print_error_message(__('Not found networkmap.'));
} else {
$table = new StdClass();
$table->id = 'form_editor';
$table->width = '98%';
$table->class = 'databox_color';
$table->head = [];
$table->size = [];
$table->size[0] = '30%';
$table->style = [];
$table->style[0] = 'font-weight: bold; width: 150px;';
$table->data = [];
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text(
'name',
$name,
'',
30,
100,
true
);
$table->data[1][0] = __('Group');
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
false,
'AR',
true,
'id_group',
$id_group,
'',
'',
0,
true
).'</div>';
$table->data[2][0] = __('Node radius');
$table->data[2][1] = html_print_input_text(
'node_radius',
$node_radius,
'',
2,
10,
true
);
$table->data[3][0] = __('Description');
$table->data[3][1] = html_print_textarea('description', 7, 25, $description, '', true);
echo '<form method="post" action="index.php?sec=network&amp;sec2=operation/agentes/pandora_networkmap">';
html_print_table($table);
echo "<div style='width: ".$table->width."; text-align: right; margin-top:20px;'>";
if ($new_empty_networkmap) {
html_print_input_hidden('save_empty_networkmap', 1);
html_print_submit_button(
__('Save networkmap'),
'crt',
false,
'class="sub next"'
);
}
if ($edit_networkmap) {
html_print_input_hidden('id_networkmap', $id);
html_print_input_hidden('update_empty_networkmap', 1);
html_print_submit_button(
__('Update networkmap'),
'crt',
false,
'class="sub upd"'
);
}
echo '</form>';
echo '</div>';
}

View File

@ -215,12 +215,18 @@ if ($delete_action) {
$is_management_allowed = is_management_allowed(); $is_management_allowed = is_management_allowed();
if ($is_management_allowed === false) { if ($is_management_allowed === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/alerts/alert_actions&tab=action&pure=0'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All alert actions information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All alert actions information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/alerts/alert_actions&tab=action&pure=0'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -616,12 +616,18 @@ if ($copy_command) {
$is_management_allowed = is_management_allowed(); $is_management_allowed = is_management_allowed();
if ($is_management_allowed === false) { if ($is_management_allowed === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/alerts/alert_commands&tab=command&pure=0'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All alert commands information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All alert commands information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/alerts/alert_commands&tab=command&pure=0'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -708,7 +708,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '<div id="add_action-div-'.$alert['id'].'" class="invisible left">'; $data[3] .= '<div id="add_action-div-'.$alert['id'].'" class="invisible left">';
$data[3] .= '<form id="add_action_form-'.$alert['id'].'" method="post">'; $data[3] .= '<form id="add_action_form-'.$alert['id'].'" method="post">';
$data[3] .= '<table class="databox_color w100p">'; $data[3] .= '<table class="databox_color w100p bg_color222">';
$data[3] .= html_print_input_hidden('add_action', 1, true); $data[3] .= html_print_input_hidden('add_action', 1, true);
$data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true); $data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true);
@ -811,7 +811,7 @@ foreach ($simple_alerts as $alert) {
1, 1,
'padding:0px', 'padding:0px',
true, true,
['class' => 'invert_filter'] ['class' => 'filter_none']
); );
$data[4] .= html_print_input_hidden('enable_alert', 1, true); $data[4] .= html_print_input_hidden('enable_alert', 1, true);
} else { } else {
@ -861,10 +861,16 @@ foreach ($simple_alerts as $alert) {
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$policyInfo = policies_is_alert_in_policy2($alert['id'], false); $policyInfo = policies_is_alert_in_policy2($alert['id'], false);
if ($policyInfo === false) { $module_linked = policies_is_module_linked($alert['id_agent_module']);
$data[1] .= ''; if (is_array($policyInfo) === false && $module_linked === false) {
$data[$index['policy']] = '';
} else {
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png';
} else { } else {
$img = 'images/policies_mc.png'; $img = 'images/policies_mc.png';
}
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>'; $data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
} }
@ -886,7 +892,7 @@ foreach ($simple_alerts as $alert) {
] ]
); );
} else { } else {
if ((int) $alert['id_policy_alerts'] === 0) { if ((int) $alert['id_policy_alerts'] === 0 || $module_linked === '0') {
$data[4] .= '<a href="javascript:show_add_action(\''.$alert['id'].'\');">'; $data[4] .= '<a href="javascript:show_add_action(\''.$alert['id'].'\');">';
$data[4] .= html_print_image('images/add.png', true, ['title' => __('Add action'), 'class' => 'invert_filter']); $data[4] .= html_print_image('images/add.png', true, ['title' => __('Add action'), 'class' => 'invert_filter']);
$data[4] .= '</a>'; $data[4] .= '</a>';
@ -992,7 +998,7 @@ if (! $id_agente) {
echo '"'.html_print_image( echo '"'.html_print_image(
'images/lightbulb_off.png', 'images/lightbulb_off.png',
true, true,
false, ['class' => 'filter_none'],
true true
).'"'; ).'"';
?> ?>
@ -1031,7 +1037,7 @@ if (! $id_agente) {
echo '"'.html_print_image( echo '"'.html_print_image(
'images/lightbulb_off.png', 'images/lightbulb_off.png',
true, true,
false, ['class' => 'filter_none'],
true true
).'"'; ).'"';
?> ?>
@ -1120,6 +1126,12 @@ function show_add_action(id_alert) {
opacity: 0.5, opacity: 0.5,
background: "black" background: "black"
}, },
open: function() {
$("#action_select, #action_select").select2({
tags: true,
dropdownParent: $("#add_action-div-" + id_alert)
});
},
width: 500, width: 500,
height: 300 height: 300
}) })
@ -1150,6 +1162,12 @@ function show_display_update_action(id_module_action, alert_id, alert_id_agent_m
opacity: 0.5, opacity: 0.5,
background: "black" background: "black"
}, },
open: function() {
$("#action_select_ajax, #action_select_ajax").select2({
tags: true,
dropdownParent: $("#update_action-div")
});
},
width: 500, width: 500,
height: 300 height: 300
}) })

View File

@ -260,12 +260,18 @@ if ($delete_template) {
} }
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/alerts/alert_templates&tab=template'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All alert templates information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All alert templates information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/alerts/alert_templates&tab=template'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -104,12 +104,18 @@ if (!$is_in_group && $al_action['id_group'] != 0) {
$is_management_allowed = is_management_allowed(); $is_management_allowed = is_management_allowed();
if ($is_management_allowed === false) { if ($is_management_allowed === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/alerts/configure_alert_action&tab=action&pure=0&id='.$id
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All alert actions information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All alert actions information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/alerts/configure_alert_action&tab=action&pure=0&id='.$id
).'">'.__('metaconsole').'</a>'
) )
); );
} }
@ -135,6 +141,10 @@ if ($id) {
$create_wu_integria = $action['create_wu_integria']; $create_wu_integria = $action['create_wu_integria'];
} }
if (users_can_manage_group_all('LW') === false && !$id) {
$group = users_get_first_group(false, 'LW', false);
}
// Hidden div with help hint to fill with javascript. // Hidden div with help hint to fill with javascript.
html_print_div( html_print_div(
[ [
@ -227,7 +237,7 @@ $create_ticket_command_id = db_get_value('id', 'talert_commands', 'name', io_saf
$sql_exclude_command_id = ''; $sql_exclude_command_id = '';
if ($config['integria_enabled'] == 0 && $create_ticket_command_id !== false) { if (!is_metaconsole() && $config['integria_enabled'] == 0 && $create_ticket_command_id !== false) {
$sql_exclude_command_id = ' AND id <> '.$create_ticket_command_id; $sql_exclude_command_id = ' AND id <> '.$create_ticket_command_id;
} }
@ -587,6 +597,7 @@ $(document).ready (function () {
$("#id_command").change (function () { $("#id_command").change (function () {
values = Array (); values = Array ();
// No se envia el valor del commando.
values.push({ values.push({
name: "page", name: "page",
value: "godmode/alerts/alert_commands"}); value: "godmode/alerts/alert_commands"});
@ -623,9 +634,6 @@ $(document).ready (function () {
$("#group option").each(function(index, value) { $("#group option").each(function(index, value) {
var current_group = $(value).val(); var current_group = $(value).val();
}); });
if (data.id_group != 0 && $("#group").val() != data.id_group) {
$("#group").val(0);
}
var integria_custom_fields_values = []; var integria_custom_fields_values = [];
var integria_custom_fields_rvalues = []; var integria_custom_fields_rvalues = [];

View File

@ -105,6 +105,7 @@ if ($update_command) {
$alert['command'] = $command; $alert['command'] = $command;
$alert['description'] = $description; $alert['description'] = $description;
$alert['id_group'] = $id_group; $alert['id_group'] = $id_group;
$alert['fields_hidden'] = io_json_mb_encode($fields_hidden);
} }
} }
@ -158,12 +159,18 @@ if (empty($fields_hidden) === false) {
$is_management_allowed = is_management_allowed(); $is_management_allowed = is_management_allowed();
if ($is_management_allowed === false) { if ($is_management_allowed === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/alerts/configure_alert_command&pure=0&id='.$id
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All alert commands information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All alert commands information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/alerts/configure_alert_command&pure=0&id='.$id
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -373,12 +373,18 @@ function update_template($step)
$is_management_allowed = is_management_allowed(); $is_management_allowed = is_management_allowed();
if ($is_management_allowed === false) { if ($is_management_allowed === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/alerts/configure_alert_template&pure=0&id='.$id.'&step='.$step
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All alerts templates information is read only. Go to Go to %s to manage it.', 'This node is configured with centralized mode. All alerts templates information is read only. Go to Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/alerts/configure_alert_template&pure=0&id='.$id.'&step='.$step
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -92,12 +92,18 @@ if (is_metaconsole() === true) {
$is_management_allowed = true; $is_management_allowed = true;
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
$is_management_allowed = false; $is_management_allowed = false;
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure']
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All categories information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All categories information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure']
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -95,6 +95,7 @@ $fields_available['id_evento'] = __('Event Id');
$fields_available['evento'] = __('Event Name'); $fields_available['evento'] = __('Event Name');
$fields_available['id_agente'] = __('Agent ID'); $fields_available['id_agente'] = __('Agent ID');
$fields_available['agent_name'] = __('Agent Name'); $fields_available['agent_name'] = __('Agent Name');
$fields_available['direccion'] = __('Agent IP');
$fields_available['id_usuario'] = __('User'); $fields_available['id_usuario'] = __('User');
$fields_available['id_grupo'] = __('Group'); $fields_available['id_grupo'] = __('Group');
$fields_available['estado'] = __('Status'); $fields_available['estado'] = __('Status');

View File

@ -254,7 +254,7 @@ foreach ($extensions as $file => $extension) {
if ($file != 'update_manager.php') { if ($file != 'update_manager.php') {
$table->cellclass[][10] = 'action_buttons'; $table->cellclass[][10] = 'action_buttons';
if (!$extension['enabled']) { if (!$extension['enabled']) {
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.disabled.png', true).'</a>'.' <a title="'.__('Enable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file.'" class="mn">'.html_print_image('images/lightbulb_off.png', true).'</a>'; $data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.disabled.png', true, ['class' => 'filter_none']).'</a>'.' <a title="'.__('Enable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file.'" class="mn">'.html_print_image('images/lightbulb_off.png', true, ['class' => 'filter_none']).'</a>';
} else { } else {
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>'.' <a title="'.__('Disable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&disabled='.$file.'" class="mn">'.html_print_image('images/lightbulb.png', true).'</a>'; $data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>'.' <a title="'.__('Disable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&disabled='.$file.'" class="mn">'.html_print_image('images/lightbulb.png', true).'</a>';
} }

View File

@ -382,12 +382,18 @@ if (is_metaconsole() === true) {
$is_management_allowed = true; $is_management_allowed = true;
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
$is_management_allowed = false; $is_management_allowed = false;
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/groups/group_list&tab=groups'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All groups information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All groups information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/groups/group_list&tab=groups'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -79,12 +79,18 @@ if (is_metaconsole() === false) {
$is_management_allowed = true; $is_management_allowed = true;
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
$is_management_allowed = false; $is_management_allowed = false;
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=advanced/component_management&tab=module_group'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All module groups information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All module groups information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=advanced/component_management&tab=module_group'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -39,12 +39,18 @@ if (!check_acl($config['id_user'], 0, 'UM')) {
} }
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=advanced/users_setup&tab=profile&pure='.(int) $config['pure']
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All profiles user information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All profiles user information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=advanced/users_setup&tab=profile&pure=0'
).'">'.__('metaconsole').'</a>'
) )
); );
@ -79,7 +85,7 @@ if ($create_profiles) {
); );
$return = profile_create_user_profile($user, $profile, $group); $return = profile_create_user_profile($user, $profile, $group);
if ($return !== false) { if ($return !== false) {
$n_added ++; $n_added++;
} }
} }
} }

View File

@ -404,7 +404,8 @@ $(document).ready (function () {
"get_agent_modules_json" : 1, "get_agent_modules_json" : 1,
"get_id_and_name" : 1, "get_id_and_name" : 1,
"disabled" : 0, "disabled" : 0,
"id_agent" : id_agent "id_agent" : id_agent,
"safe_name": 1,
}; };
var tags_to_search = $('#tags').val(); var tags_to_search = $('#tags').val();
@ -434,7 +435,7 @@ $(document).ready (function () {
jQuery.each (data, function (i, val) { jQuery.each (data, function (i, val) {
option = $("<option></option>") option = $("<option></option>")
.attr ("value", val["id_agente_modulo"]) .attr ("value", val["id_agente_modulo"])
.append (val["nombre"]); .append (val["safe_name"]);
$("#target_modules").append (option); $("#target_modules").append (option);
}); });

View File

@ -685,7 +685,8 @@ $(document).ready (function () {
"get_agent_modules_json" : 1, "get_agent_modules_json" : 1,
"get_distinct_name" : 1, "get_distinct_name" : 1,
"indexed" : 0, "indexed" : 0,
"privilege" : "AW" "privilege" : "AW",
"safe_name": 1
}; };
if (this.value != '0') if (this.value != '0')
@ -712,7 +713,7 @@ $(document).ready (function () {
jQuery.each (data, function (id, value) { jQuery.each (data, function (id, value) {
option = $("<option></option>") option = $("<option></option>")
.attr("value", value["nombre"]) .attr("value", value["nombre"])
.html(value["nombre"]); .html(value["safe_name"]);
$("#module_name").append (option); $("#module_name").append (option);
}); });
hideSpinner(); hideSpinner();

View File

@ -39,12 +39,18 @@ if (! check_acl($config['id_user'], 0, 'UM')) {
} }
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=advanced/users_setup&tab=profile&pure='.(int) $config['pure']
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All profiles user information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All profiles user information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=advanced/users_setup&tab=profile&pure=0'
).'">'.__('metaconsole').'</a>'
) )
); );

View File

@ -1326,7 +1326,8 @@ $(document).ready (function () {
"page" : "operation/agentes/ver_agente", "page" : "operation/agentes/ver_agente",
"get_agent_modules_json" : 1, "get_agent_modules_json" : 1,
"get_distinct_name" : 1, "get_distinct_name" : 1,
"indexed" : 0 "indexed" : 0,
"safe_name" : 1
}; };
if (this.value != '0') if (this.value != '0')
@ -1346,12 +1347,12 @@ $(document).ready (function () {
showSpinner(); showSpinner();
$("tr#delete_table-edit1, tr#delete_table-edit0, tr#delete_table-edit2").hide (); $("tr#delete_table-edit1, tr#delete_table-edit0, tr#delete_table-edit2").hide ();
$("#module_name").attr ("disabled", "disabled") $("#module_name").attr ("disabled", "disabled")
$("#module_name option[value!=0]").remove (); $("#module_name option[value!=0]").remove();
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
params, params,
function (data, status) { function (data, status) {
jQuery.each (data, function (id, value) { jQuery.each (data, function (id, value) {
option = $("<option></option>").attr ("value", value["nombre"]).html (value["nombre"]); option = $("<option></option>").attr("value", value["nombre"]).html(value["safe_name"]);
$("#module_name").append (option); $("#module_name").append (option);
}); });
hideSpinner(); hideSpinner();

View File

@ -219,7 +219,8 @@ $alertstab = [
'title' => __('Alerts operations'), 'title' => __('Alerts operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_alerts', ).'</a>',
'active' => $tab == 'massive_alerts',
]; ];
$userstab = [ $userstab = [
@ -230,7 +231,8 @@ $userstab = [
'title' => __('Users operations'), 'title' => __('Users operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_users', ).'</a>',
'active' => $tab == 'massive_users',
]; ];
$agentstab = [ $agentstab = [
@ -241,7 +243,8 @@ $agentstab = [
'title' => __('Agents operations'), 'title' => __('Agents operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_agents', ).'</a>',
'active' => $tab == 'massive_agents',
]; ];
$modulestab = [ $modulestab = [
@ -252,7 +255,8 @@ $agentstab = [
'title' => __('Modules operations'), 'title' => __('Modules operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_modules', ).'</a>',
'active' => $tab == 'massive_modules',
]; ];
$pluginstab = [ $pluginstab = [
@ -263,7 +267,8 @@ $agentstab = [
'title' => __('Plugins operations'), 'title' => __('Plugins operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_plugins', ).'</a>',
'active' => $tab == 'massive_plugins',
]; ];
$policiestab = enterprise_hook('massive_policies_tab'); $policiestab = enterprise_hook('massive_policies_tab');
@ -334,12 +339,18 @@ $agentstab = [
} }
if ($tab == 'massive_policies' && is_management_allowed() === false) { if ($tab == 'massive_policies' && is_management_allowed() === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=advanced/policymanager'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All policies information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All policies information is read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=advanced/policymanager'
).'">'.__('metaconsole').'</a>'
) )
); );
return; return;
@ -401,12 +412,18 @@ $agentstab = [
<?php <?php
if (is_management_allowed() === false && $option == 'delete_agents') { if (is_management_allowed() === false && $option == 'delete_agents') {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=monitoring&sec2=monitoring/wizard/wizard'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. To delete agents go to %s', 'This node is configured with centralized mode. To delete agents go to %s',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=monitoring&sec2=monitoring/wizard/wizard'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -175,6 +175,10 @@ if (check_acl($config['id_user'], 0, 'AW')) {
enterprise_hook('agents_submenu'); enterprise_hook('agents_submenu');
} }
if (check_acl($config['id_user'], 0, 'NW')) {
enterprise_hook('agents_ncm_submenu');
}
if (check_acl($config['id_user'], 0, 'AW')) { if (check_acl($config['id_user'], 0, 'AW')) {
$sub['gmassive']['text'] = __('Bulk operations'); $sub['gmassive']['text'] = __('Bulk operations');
$sub['gmassive']['id'] = 'Bulk operations'; $sub['gmassive']['id'] = 'Bulk operations';
@ -458,9 +462,9 @@ if (is_array($config['extensions'])) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['refr'] = 0; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['refr'] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['icon'] = $extmenu['icon']; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
if ($extmenu['name'] == 'Cron jobs') { if ($extmenu['name'] == 'Cron jobs') {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = 'extensions'; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = $extmenu['fatherId'];
} else { } else {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = 'gextensions'; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = $extmenu['fatherId'];
} }
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['extension'] = true; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['extension'] = true;
@ -521,14 +525,12 @@ $menu_godmode['links']['sub'] = $sub;
// Update Manager // Update Manager
if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager']) { if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager']) {
$menu_godmode['messages']['text'] = __('Update manager'); $menu_godmode['messages']['text'] = __('Update manager');
$menu_godmode['messages']['sec2'] = '';
$menu_godmode['messages']['id'] = 'god-um_messages'; $menu_godmode['messages']['id'] = 'god-um_messages';
$menu_godmode['messages']['sec2'] = 'godmode/update_manager/update_manager';
$sub = []; $sub = [];
if ($config['enterprise_installed']) {
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline'); $sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
$sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline'; $sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline';
}
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update Manager online'); $sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update Manager online');
$sub['godmode/update_manager/update_manager&tab=online']['id'] = 'Online'; $sub['godmode/update_manager/update_manager&tab=online']['id'] = 'Online';
@ -541,7 +543,6 @@ if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager'])
// Module library. // Module library.
if (check_acl($config['id_user'], 0, 'AR')) { if (check_acl($config['id_user'], 0, 'AR')) {
$menu_godmode['gmodule_library']['text'] = __('Module library'); $menu_godmode['gmodule_library']['text'] = __('Module library');
$menu_godmode['gmodule_library']['sec2'] = 'godmode/module_library/module_library_view';
$menu_godmode['gmodule_library']['id'] = 'god-module_library'; $menu_godmode['gmodule_library']['id'] = 'god-module_library';
$sub = []; $sub = [];

View File

@ -271,12 +271,18 @@ foreach ($groups as $group) {
} }
if (is_management_allowed() === false && is_metaconsole() === false) { if (is_management_allowed() === false && is_metaconsole() === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/modules/manage_nc_groups'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. Component groups are read only. Go to %s to manage it.', 'This node is configured with centralized mode. Component groups are read only. Go to %s to manage it.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/modules/manage_nc_groups'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -297,12 +297,18 @@ if (is_metaconsole() === true) {
} }
if ($is_management_allowed === false) { if ($is_management_allowed === false) {
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/modules/manage_network_components&tab=network&pure='.(int) $config['pure']
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All remote components are read only. Go to %s to manage them.', 'This node is configured with centralized mode. All remote components are read only. Go to %s to manage them.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=godmode/modules/manage_network_components&tab=network&pure=0'
).'">'.__('metaconsole').'</a>'
) )
); );
} }
@ -575,7 +581,7 @@ if ($is_management_allowed === true && $multiple_delete) {
$id = 0; $id = 0;
} }
if ($id || $new_component if ((bool) $id !== false || $new_component
|| $create_network_from_module || $create_network_from_module
|| $create_network_from_snmp_browser || $create_network_from_snmp_browser
) { ) {
@ -592,6 +598,7 @@ $url = ui_get_url_refresh(
'offset' => false, 'offset' => false,
'search_string' => $search_string, 'search_string' => $search_string,
'search_id_group' => $search_id_group, 'search_id_group' => $search_id_group,
'id' => $id,
], ],
true, true,
false false

View File

@ -182,6 +182,7 @@ if (isset($id)) {
$snmp3_privacy_pass = io_output_password( $snmp3_privacy_pass = io_output_password(
$component['custom_string_2'] $component['custom_string_2']
); );
unset($tcp_send);
$snmp3_security_level = $component['custom_string_3']; $snmp3_security_level = $component['custom_string_3'];
} else if ($type >= MODULE_TYPE_REMOTE_CMD && $type <= MODULE_TYPE_REMOTE_CMD_INC) { } else if ($type >= MODULE_TYPE_REMOTE_CMD && $type <= MODULE_TYPE_REMOTE_CMD_INC) {
$command_text = $component['tcp_send']; $command_text = $component['tcp_send'];

View File

@ -331,9 +331,9 @@ echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting
echo "<table width='100%' cellpadding='4' cellpadding='4' class='databox filters'>"; echo "<table width='100%' cellpadding='4' cellpadding='4' class='databox filters'>";
echo '<tr>'; echo '<tr>';
echo "<td colspan='3'>".__('Filter group').'</td>'; echo "<td colspan='1'>".__('Filter group').'</td>';
echo '</tr><tr>'; echo '</tr><tr>';
echo "<td colspan='3'>".html_print_select_groups( echo "<td colspan='1'>".html_print_select_groups(
$config['id_user'], $config['id_user'],
($report_w == true) ? 'RW' : (($report_m == true) ? 'RM' : 'RW'), ($report_w == true) ? 'RW' : (($report_m == true) ? 'RM' : 'RW'),
true, true,

View File

@ -162,12 +162,14 @@ $filter_exclude = '';
$total_time = true; $total_time = true;
$time_failed = true; $time_failed = true;
$time_in_ok_status = true; $time_in_ok_status = true;
$time_in_warning_status = false;
$time_in_unknown_status = true; $time_in_unknown_status = true;
$time_of_not_initialized_module = true; $time_of_not_initialized_module = true;
$time_of_downtime = true; $time_of_downtime = true;
$total_checks = true; $total_checks = true;
$checks_failed = true; $checks_failed = true;
$checks_in_ok_status = true; $checks_in_ok_status = true;
$checks_in_warning_status = true;
$unknown_checks = true; $unknown_checks = true;
$agent_max_value = true; $agent_max_value = true;
$agent_min_value = true; $agent_min_value = true;
@ -358,7 +360,6 @@ switch ($action) {
$failover_type = $item['failover_type']; $failover_type = $item['failover_type'];
break; break;
case 'histogram_data':
case 'module_histogram_graph': case 'module_histogram_graph':
$description = $item['description']; $description = $item['description'];
$period = $item['period']; $period = $item['period'];
@ -399,6 +400,12 @@ switch ($action) {
$sla_sorted_by = $item['top_n']; $sla_sorted_by = $item['top_n'];
break; break;
case 'IPAM_network':
$network_filter = $item['ipam_network_filter'];
$alive_ip = $item['ipam_alive_ips'];
$agent_not_assigned_to_ip = $item['ipam_ip_not_assigned_to_agent'];
break;
case 'monitor_report': case 'monitor_report':
$description = $item['description']; $description = $item['description'];
$idAgentModule = $item['id_agent_module']; $idAgentModule = $item['id_agent_module'];
@ -673,12 +680,14 @@ switch ($action) {
$total_time = $item['total_time']; $total_time = $item['total_time'];
$time_failed = $item['time_failed']; $time_failed = $item['time_failed'];
$time_in_ok_status = $item['time_in_ok_status']; $time_in_ok_status = $item['time_in_ok_status'];
$time_in_warning_status = $item['time_in_warning_status'];
$time_in_unknown_status = $item['time_in_unknown_status']; $time_in_unknown_status = $item['time_in_unknown_status'];
$time_of_not_initialized_module = $item['time_of_not_initialized_module']; $time_of_not_initialized_module = $item['time_of_not_initialized_module'];
$time_of_downtime = $item['time_of_downtime']; $time_of_downtime = $item['time_of_downtime'];
$total_checks = $item['total_checks']; $total_checks = $item['total_checks'];
$checks_failed = $item['checks_failed']; $checks_failed = $item['checks_failed'];
$checks_in_ok_status = $item['checks_in_ok_status']; $checks_in_ok_status = $item['checks_in_ok_status'];
$checks_in_warning_status = $item['checks_in_warning_status'];
$unknown_checks = $item['unknown_checks']; $unknown_checks = $item['unknown_checks'];
$agent_max_value = $item['agent_max_value']; $agent_max_value = $item['agent_max_value'];
$agent_min_value = $item['agent_min_value']; $agent_min_value = $item['agent_min_value'];
@ -748,6 +757,7 @@ switch ($action) {
$selected_agent_group_filter = $es['agent_group_filter']; $selected_agent_group_filter = $es['agent_group_filter'];
$selected_agents_inventory_display_options = $es['agents_inventory_display_options']; $selected_agents_inventory_display_options = $es['agents_inventory_display_options'];
$selected_agent_os_filter = $es['agent_os_filter']; $selected_agent_os_filter = $es['agent_os_filter'];
$selected_agent_custom_fields = $es['agent_custom_fields'];
$selected_agent_custom_field_filter = $es['agent_custom_field_filter']; $selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
$selected_agent_status_filter = $es['agent_status_filter']; $selected_agent_status_filter = $es['agent_status_filter'];
$selected_agent_module_search_filter = $es['agent_module_search_filter']; $selected_agent_module_search_filter = $es['agent_module_search_filter'];
@ -836,7 +846,6 @@ switch ($action) {
case 'database_serialized': case 'database_serialized':
case 'last_value': case 'last_value':
case 'monitor_report': case 'monitor_report':
case 'histogram_data':
case 'min_value': case 'min_value':
case 'max_value': case 'max_value':
case 'avg_value': case 'avg_value':
@ -1067,6 +1076,51 @@ $class = 'databox filters';
</td> </td>
</tr> </tr>
<tr id="row_network_filter" class="datos">
<td class="bolder"><?php echo __('Filter by network'); ?></td>
<td>
<?php
$sql = 'SELECT id, CONCAT(name_network, " (", network, ")")
FROM tipam_network';
html_print_select_from_sql(
$sql,
'network_filter',
$network_filter,
'',
'',
'0'
);
?>
</td>
</tr>
<tr id="row_alive_ip" class="datos">
<td class="bolder"><?php echo __('Show alive IPs only'); ?></td>
<td>
<?php
html_print_checkbox_switch(
'alive_ip',
1,
$alive_ip
);
?>
</td>
</tr>
<tr id="row_agent_not_assigned_to_ip" class="datos">
<td class="bolder"><?php echo __('Show IPs not assigned to an agent'); ?></td>
<td>
<?php
html_print_checkbox_switch(
'agent_not_assigned_to_ip',
1,
$agent_not_assigned_to_ip
);
?>
</td>
</tr>
<tr id="row_period" class="datos"> <tr id="row_period" class="datos">
<td class="bolder"> <td class="bolder">
<?php <?php
@ -2309,6 +2363,14 @@ $class = 'databox filters';
</p> </p>
</td> </td>
<td> <td>
<p class="mrgn_right_30px">
<?php
echo __('Time in warning status').'<br>';
html_print_checkbox_switch('time_in_warning_status', 1, $time_in_warning_status);
?>
</p>
</td>
<td>
<p class="mrgn_right_30px"> <p class="mrgn_right_30px">
<?php <?php
echo __('Time in unknown status').'<br>'; echo __('Time in unknown status').'<br>';
@ -2421,6 +2483,18 @@ $class = 'databox filters';
</p> </p>
</td> </td>
<td> <td>
<p class="mrgn_right_30px">
<?php
echo __('Checks in Warning status');
html_print_checkbox(
'checks_in_warning_status',
1,
$checks_in_warning_status
);
?>
</p>
</td>
<td>
<p class="mrgn_right_30px"> <p class="mrgn_right_30px">
<?php <?php
echo __('Unknown checks'); echo __('Unknown checks');
@ -3080,6 +3154,7 @@ $class = 'databox filters';
</tr> </tr>
<?php <?php
if (is_metaconsole()) {
$server_fields = []; $server_fields = [];
$server_fields[0] = __('All'); $server_fields[0] = __('All');
@ -3106,7 +3181,6 @@ $class = 'databox filters';
'min-width: 180px' 'min-width: 180px'
).'</td></tr>'; ).'</td></tr>';
if (is_metaconsole()) {
echo $server_filter_markup; echo $server_filter_markup;
} }
?> ?>
@ -3158,6 +3232,28 @@ $class = 'databox filters';
</tr> </tr>
<tr id="row_custom_field" class="datos"> <tr id="row_custom_field" class="datos">
<td class="bolder">
<?php
echo __('Agent custom field');
?>
</td>
<td >
<?php
html_print_select_from_sql(
'SELECT id_field, name FROM tagent_custom_fields',
'agent_custom_fields[]',
$selected_agent_custom_fields,
'',
__('All'),
'0',
false,
true
);
?>
</td>
</tr>
<tr id="row_custom_field_filter" class="datos">
<td class="bolder"> <td class="bolder">
<?php <?php
echo __('Agent custom field filter'); echo __('Agent custom field filter');
@ -3409,7 +3505,7 @@ function print_SLA_list($width, $action, $idItem=null)
<tr id="sla_template" class="datos"> <tr id="sla_template" class="datos">
<td colspan="6"> <td colspan="6">
<?php <?php
echo __('Please save the SLA for start to add items in this list.'); echo __('Please save the item before adding entries to this list.');
?> ?>
</td> </td>
</tr> </tr>
@ -4410,7 +4506,6 @@ $(document).ready (function () {
case 'max_value': case 'max_value':
case 'min_value': case 'min_value':
case 'monitor_report': case 'monitor_report':
case 'histogram_data':
case 'database_serialized': case 'database_serialized':
case 'last_value': case 'last_value':
case 'sumatory': case 'sumatory':
@ -4464,7 +4559,6 @@ $(document).ready (function () {
case 'prediction_date': case 'prediction_date':
case 'projection_graph': case 'projection_graph':
case 'monitor_report': case 'monitor_report':
case 'histogram_data':
case 'module_histogram_graph': case 'module_histogram_graph':
case 'avg_value': case 'avg_value':
case 'max_value': case 'max_value':
@ -4550,7 +4644,6 @@ $(document).ready (function () {
case 'max_value': case 'max_value':
case 'min_value': case 'min_value':
case 'monitor_report': case 'monitor_report':
case 'histogram_data':
case 'database_serialized': case 'database_serialized':
case 'last_value': case 'last_value':
case 'sumatory': case 'sumatory':
@ -4599,7 +4692,6 @@ $(document).ready (function () {
case 'prediction_date': case 'prediction_date':
case 'projection_graph': case 'projection_graph':
case 'monitor_report': case 'monitor_report':
case 'histogram_data':
case 'module_histogram_graph': case 'module_histogram_graph':
case 'avg_value': case 'avg_value':
case 'max_value': case 'max_value':
@ -5159,7 +5251,6 @@ function addSLARow() {
$("input[name=id_agent_failover]").val(''); $("input[name=id_agent_failover]").val('');
$("input[name=id_server]").val(''); $("input[name=id_server]").val('');
$("input[name=agent_sla]").val(''); $("input[name=agent_sla]").val('');
$("input[name=agent_sla]").css("background","url('<?php echo $autocompleteImage; ?>') right center no-repeat")
$("input[name=agent_failover]").val(''); $("input[name=agent_failover]").val('');
$("#id_agent_module_sla").empty(); $("#id_agent_module_sla").empty();
$("#id_agent_module_sla").attr('disabled', 'true'); $("#id_agent_module_sla").attr('disabled', 'true');
@ -5486,12 +5577,15 @@ function chooseType() {
$("#row_agent_server_filter").hide(); $("#row_agent_server_filter").hide();
$("#row_agent_group_filter").hide(); $("#row_agent_group_filter").hide();
$("#row_os").hide(); $("#row_os").hide();
$("#row_custom_field_filter").hide();
$("#row_custom_field").hide(); $("#row_custom_field").hide();
$("#row_agent_status").hide(); $("#row_agent_status").hide();
$("#row_agent_version").hide(); $("#row_agent_version").hide();
$("#row_agent_remote_conf").hide(); $("#row_agent_remote_conf").hide();
$("#row_module_free_search").hide(); $("#row_module_free_search").hide();
$("#row_network_filter").hide();
$("#row_alive_ip").hide();
$("#row_agent_not_assigned_to_ip").hide();
// SLA list default state. // SLA list default state.
$("#sla_list").hide(); $("#sla_list").hide();
@ -5627,7 +5721,6 @@ function chooseType() {
$("#row_summary").show(); $("#row_summary").show();
break; break;
case 'histogram_data':
case 'module_histogram_graph': case 'module_histogram_graph':
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
@ -6039,11 +6132,26 @@ function chooseType() {
$("#row_group").show(); $("#row_group").show();
$("#row_os").show(); $("#row_os").show();
$("#row_custom_field").show(); $("#row_custom_field").show();
$("#row_custom_field_filter").show();
$("#row_agent_status").show(); $("#row_agent_status").show();
$("#row_agent_version").show(); $("#row_agent_version").show();
$("#row_agent_remote_conf").show(); $("#row_agent_remote_conf").show();
$("#row_module_free_search").show(); $("#row_module_free_search").show();
if ($('#agent_custom_fields :selected').length > 0) {
$('#text-agent_custom_field_filter').removeAttr('disabled');
} else {
$('#text-agent_custom_field_filter').prop('disabled', true);
}
$("#agent_custom_fields").change(function(e) {
if ($('#agent_custom_fields :selected').length > 0) {
$('#text-agent_custom_field_filter').removeAttr('disabled');
} else {
$('#text-agent_custom_field_filter').prop('disabled', true);
}
});
break; break;
case 'inventory': case 'inventory':
@ -6193,6 +6301,13 @@ function chooseType() {
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
break; break;
case 'IPAM_network':
$("#row_network_filter").show();
$("#row_alive_ip").show();
$("#row_agent_not_assigned_to_ip").show();
$("#row_historical_db_check").hide();
break;
case 'permissions_report': case 'permissions_report':
$("#row_description").show(); $("#row_description").show();
$("#row_users").show(); $("#row_users").show();

View File

@ -1251,16 +1251,7 @@ switch ($action) {
array_push($table->data, $data); array_push($table->data, $data);
} }
if ($columnview) {
$count = 0;
foreach ($table->data as $datos) {
if (!isset($datos[9])) {
$table->data[$count][9] = '';
}
$count++;
}
}
html_print_table($table); html_print_table($table);
ui_pagination( ui_pagination(
@ -1759,6 +1750,9 @@ switch ($action) {
$values['time_in_ok_status'] = get_parameter( $values['time_in_ok_status'] = get_parameter(
'time_in_ok_status' 'time_in_ok_status'
); );
$values['time_in_warning_status'] = get_parameter(
'time_in_warning_status'
);
$values['time_in_unknown_status'] = get_parameter( $values['time_in_unknown_status'] = get_parameter(
'time_in_unknown_status' 'time_in_unknown_status'
); );
@ -1777,6 +1771,9 @@ switch ($action) {
$values['checks_in_ok_status'] = get_parameter( $values['checks_in_ok_status'] = get_parameter(
'checks_in_ok_status' 'checks_in_ok_status'
); );
$values['checks_in_warning_status'] = get_parameter(
'checks_in_warning_status'
);
$values['unknown_checks'] = get_parameter( $values['unknown_checks'] = get_parameter(
'unknown_checks' 'unknown_checks'
); );
@ -1832,6 +1829,13 @@ switch ($action) {
$good_format = true; $good_format = true;
break; break;
case 'IPAM_network':
$values['ipam_network_filter'] = get_parameter('network_filter');
$values['ipam_alive_ips'] = get_parameter('alive_ip');
$values['ipam_ip_not_assigned_to_agent'] = get_parameter('agent_not_assigned_to_ip');
$good_format = true;
break;
default: default:
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['top_n'] = get_parameter( $values['top_n'] = get_parameter(
@ -1895,6 +1899,10 @@ switch ($action) {
'time_in_ok_status', 'time_in_ok_status',
0 0
); );
$values['time_in_warning_status'] = get_parameter(
'time_in_warning_status',
0
);
$values['time_in_unknown_status'] = get_parameter( $values['time_in_unknown_status'] = get_parameter(
'time_in_unknown_status', 'time_in_unknown_status',
0 0
@ -1919,6 +1927,10 @@ switch ($action) {
'checks_in_ok_status', 'checks_in_ok_status',
0 0
); );
$values['checks_in_warning_status'] = get_parameter(
'checks_in_warning_status',
0
);
$values['unknown_checks'] = get_parameter( $values['unknown_checks'] = get_parameter(
'unknown_checks', 'unknown_checks',
0 0
@ -1958,9 +1970,11 @@ switch ($action) {
); );
$values['id_group'] = get_parameter('combo_group'); $values['id_group'] = get_parameter('combo_group');
if ($values['server_name'] == '') {
$values['server_name'] = get_parameter( $values['server_name'] = get_parameter(
'combo_server' 'combo_server'
); );
}
if ((($values['type'] == 'custom_graph') if ((($values['type'] == 'custom_graph')
|| ($values['type'] == 'automatic_custom_graph')) || ($values['type'] == 'automatic_custom_graph'))
@ -2185,7 +2199,6 @@ switch ($action) {
break; break;
case 'module_histogram_graph': case 'module_histogram_graph':
case 'histogram_data':
case 'agent_configuration': case 'agent_configuration':
case 'alert_report_agent': case 'alert_report_agent':
case 'alert_report_module': case 'alert_report_module':
@ -2219,6 +2232,7 @@ switch ($action) {
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options'); $es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter'); $es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['agent_os_filter'] = get_parameter('agent_os_filter'); $es['agent_os_filter'] = get_parameter('agent_os_filter');
$es['agent_custom_fields'] = get_parameter('agent_custom_fields');
$es['agent_status_filter'] = get_parameter('agent_status_filter'); $es['agent_status_filter'] = get_parameter('agent_status_filter');
$es['agent_version_filter'] = get_parameter('agent_version_filter'); $es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter'); $es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
@ -2228,6 +2242,14 @@ switch ($action) {
$values['external_source'] = json_encode($es); $values['external_source'] = json_encode($es);
break; break;
case 'IPAM_network':
$es['network_filter'] = get_parameter('network_filter');
$es['alive_ip'] = get_parameter('alive_ip');
$es['agent_not_assigned_to_ip'] = get_parameter('agent_not_assigned_to_ip');
// $values['external_source'] = json_encode($es);
break;
default: default:
// Default. // Default.
break; break;
@ -2535,6 +2557,10 @@ switch ($action) {
); );
} }
$values['ipam_network_filter'] = get_parameter('network_filter', 0);
$values['ipam_alive_ips'] = get_parameter('alive_ip', 0);
$values['ipam_ip_not_assigned_to_agent'] = get_parameter('agent_not_assigned_to_ip', 0);
$values['only_display_wrong'] = (int) get_parameter( $values['only_display_wrong'] = (int) get_parameter(
'checkbox_only_display_wrong', 'checkbox_only_display_wrong',
0 0
@ -2559,6 +2585,10 @@ switch ($action) {
'time_in_ok_status', 'time_in_ok_status',
0 0
); );
$values['time_in_warning_status'] = get_parameter(
'time_in_warning_status',
0
);
$values['time_in_unknown_status'] = get_parameter( $values['time_in_unknown_status'] = get_parameter(
'time_in_unknown_status', 'time_in_unknown_status',
0 0
@ -2583,6 +2613,10 @@ switch ($action) {
'checks_in_ok_status', 'checks_in_ok_status',
0 0
); );
$values['checks_in_warning_status'] = get_parameter(
'checks_in_warning_status',
0
);
$values['unknown_checks'] = get_parameter( $values['unknown_checks'] = get_parameter(
'unknown_checks', 'unknown_checks',
0 0
@ -2824,7 +2858,6 @@ switch ($action) {
break; break;
case 'module_histogram_graph': case 'module_histogram_graph':
case 'histogram_data':
case 'agent_configuration': case 'agent_configuration':
case 'alert_report_agent': case 'alert_report_agent':
case 'alert_report_module': case 'alert_report_module':
@ -2858,6 +2891,7 @@ switch ($action) {
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options'); $es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter'); $es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['agent_os_filter'] = get_parameter('agent_os_filter'); $es['agent_os_filter'] = get_parameter('agent_os_filter');
$es['agent_custom_fields'] = get_parameter('agent_custom_fields');
$es['agent_status_filter'] = get_parameter('agent_status_filter'); $es['agent_status_filter'] = get_parameter('agent_status_filter');
$es['agent_version_filter'] = get_parameter('agent_version_filter'); $es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter'); $es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
@ -2867,6 +2901,12 @@ switch ($action) {
$values['external_source'] = json_encode($es); $values['external_source'] = json_encode($es);
break; break;
case 'IPAM_network':
$es['network_filter'] = get_parameter('network_filter');
$es['alive_ip'] = get_parameter('alive_ip');
$es['agent_not_assigned_to_ip'] = get_parameter('agent_not_assigned_to_ip');
break;
default: default:
// Default. // Default.
break; break;
@ -3370,7 +3410,7 @@ $buttons['view'] = [
$buttons[$activeTab]['active'] = true; $buttons[$activeTab]['active'] = true;
if ($idReport != 0) { if ($idReport != 0) {
$textReportName = $reportName; $textReportName = (empty($reportName) === false) ? $reportName : $report['name'];
} else { } else {
$temp = $buttons['main']; $temp = $buttons['main'];
$buttons = null; $buttons = null;

View File

@ -204,6 +204,15 @@ foreach ($layoutDatas as $layoutData) {
); );
break; break;
case CIRCULAR_INTERIOR_PROGRESS_BAR:
case CIRCULAR_PROGRESS_BAR:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/percentile_item.png',
true,
['title' => __('Percentile')]
);
break;
case MODULE_GRAPH: case MODULE_GRAPH:
$table->data[($i + 1)]['icon'] = html_print_image( $table->data[($i + 1)]['icon'] = html_print_image(
'images/chart_curve.png', 'images/chart_curve.png',
@ -306,6 +315,16 @@ foreach ($layoutDatas as $layoutData) {
break; break;
case NETWORK_LINK: case NETWORK_LINK:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/network_link_item.png',
true,
[
'title' => __('Network link'),
'class' => 'invert_filter',
]
);
break;
case LINE_ITEM: case LINE_ITEM:
$table->data[($i + 1)]['icon'] = html_print_image( $table->data[($i + 1)]['icon'] = html_print_image(
'images/line_item.png', 'images/line_item.png',
@ -325,6 +344,30 @@ foreach ($layoutDatas as $layoutData) {
); );
break; break;
case BASIC_CHART:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/basic_chart.png',
true,
['title' => __('Basic chart')]
);
break;
case ODOMETER:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/odometer.png',
true,
['title' => __('Odometer')]
);
break;
case CLOCK:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/clock-tab.png',
true,
['title' => __('Clock')]
);
break;
default: default:
if (enterprise_installed()) { if (enterprise_installed()) {
$table->data[($i + 1)]['icon'] = enterprise_visual_map_print_list_element('icon', $layoutData); $table->data[($i + 1)]['icon'] = enterprise_visual_map_print_list_element('icon', $layoutData);
@ -394,6 +437,13 @@ foreach ($layoutDatas as $layoutData) {
$table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true).' x '.html_print_input_text('height_'.$idLayoutData, $layoutData['width'], '', 2, 5, true); $table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true).' x '.html_print_input_text('height_'.$idLayoutData, $layoutData['width'], '', 2, 5, true);
break; break;
case CIRCULAR_PROGRESS_BAR:
case CIRCULAR_INTERIOR_PROGRESS_BAR:
case PERCENTILE_BUBBLE:
case PERCENTILE_BAR:
$table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true);
break;
default: default:
$table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true).' x '.html_print_input_text('height_'.$idLayoutData, $layoutData['height'], '', 2, 5, true); $table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true).' x '.html_print_input_text('height_'.$idLayoutData, $layoutData['height'], '', 2, 5, true);
break; break;
@ -478,6 +528,7 @@ foreach ($layoutDatas as $layoutData) {
case LABEL: case LABEL:
case NETWORK_LINK: case NETWORK_LINK:
case LINE_ITEM: case LINE_ITEM:
case CLOCK:
$table->data[($i + 2)][0] = ''; $table->data[($i + 2)][0] = '';
break; break;
@ -520,7 +571,7 @@ foreach ($layoutDatas as $layoutData) {
$params['value'] = db_get_value('alias', 'tagente', 'id_agente', $layoutData['id_agent']); $params['value'] = db_get_value('alias', 'tagente', 'id_agente', $layoutData['id_agent']);
} }
if ($layoutData['id_agent'] == 0 and $layoutData['id_custom_graph'] != 0) { if ($layoutData['id_custom_graph'] != 0) {
$table->data[($i + 2)][0] = __('Custom graph'); $table->data[($i + 2)][0] = __('Custom graph');
} else { } else {
$table->data[($i + 2)][0] = ui_print_agent_autocomplete_input($params); $table->data[($i + 2)][0] = ui_print_agent_autocomplete_input($params);
@ -540,6 +591,7 @@ foreach ($layoutDatas as $layoutData) {
case NETWORK_LINK: case NETWORK_LINK:
case LINE_ITEM: case LINE_ITEM:
case GROUP_ITEM: case GROUP_ITEM:
case CLOCK:
$table->data[($i + 2)][1] = ''; $table->data[($i + 2)][1] = '';
break; break;
@ -569,7 +621,7 @@ foreach ($layoutDatas as $layoutData) {
$modules = io_safe_output($modules); $modules = io_safe_output($modules);
if ($layoutData['id_agent'] == 0 and $layoutData['id_custom_graph'] != 0) { if ($layoutData['id_custom_graph'] != 0) {
if (is_metaconsole()) { if (is_metaconsole()) {
$graphs = []; $graphs = [];
$graphs = metaconsole_get_custom_graphs(true); $graphs = metaconsole_get_custom_graphs(true);

View File

@ -433,7 +433,10 @@ switch ($activeTab) {
$idsElements = db_get_all_rows_filter( $idsElements = db_get_all_rows_filter(
'tlayout_data', 'tlayout_data',
['id_layout' => $idVisualConsole], ['id_layout' => $idVisualConsole],
['id'] [
'id',
'type',
]
); );
if ($idsElements === false) { if ($idsElements === false) {
@ -449,18 +452,33 @@ switch ($activeTab) {
$values['height'] = get_parameter('height_'.$id, 0); $values['height'] = get_parameter('height_'.$id, 0);
$values['pos_x'] = get_parameter('left_'.$id, 0); $values['pos_x'] = get_parameter('left_'.$id, 0);
$values['pos_y'] = get_parameter('top_'.$id, 0); $values['pos_y'] = get_parameter('top_'.$id, 0);
$type = db_get_value('type', 'tlayout_data', 'id', $id); switch ($idElement['type']) {
switch ($type) { case NETWORK_LINK:
case MODULE_GRAPH: case LINE_ITEM:
continue 2;
break;
case SIMPLE_VALUE_MAX: case SIMPLE_VALUE_MAX:
case SIMPLE_VALUE_MIN: case SIMPLE_VALUE_MIN:
case SIMPLE_VALUE_AVG: case SIMPLE_VALUE_AVG:
$values['period'] = get_parameter('period_'.$id, 0); $values['period'] = get_parameter('period_'.$id, 0);
break; break;
case MODULE_GRAPH:
$values['period'] = get_parameter('period_'.$id, 0);
unset($values['image']);
break;
case GROUP_ITEM: case GROUP_ITEM:
$values['id_group'] = get_parameter('group_'.$id, 0); $values['id_group'] = get_parameter('group_'.$id, 0);
$values['show_statistics'] = get_parameter('show_statistics', 0); break;
case CIRCULAR_PROGRESS_BAR:
case CIRCULAR_INTERIOR_PROGRESS_BAR:
case PERCENTILE_BUBBLE:
case PERCENTILE_BAR:
unset($values['height']);
break; break;
} }

View File

@ -231,8 +231,8 @@ if (isset($_GET['server'])) {
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
$(document).ready (function () { $(document).ready (function () {
var id_server = <?php echo $id_server; ?>; var id_server = '<?php echo $id_server; ?>';
var server_type = <?php echo $row['server_type']; ?>; var server_type = '<?php echo $row['server_type']; ?>';
$("#check_exec_server img").on("click", function () { $("#check_exec_server img").on("click", function () {
$("#check_exec_server img").attr("src", "images/spinner.gif"); $("#check_exec_server img").attr("src", "images/spinner.gif");

View File

@ -219,34 +219,15 @@ if ($filemanager) {
$id_plugin = (int) get_parameter('id_plugin', 0); $id_plugin = (int) get_parameter('id_plugin', 0);
// Add custom directories here // Add custom directories here.
$fallback_directory = 'attachment/plugin'; $fallback_directory = 'attachment/plugin';
// Get directory.
$directory = (string) get_parameter('directory', $fallback_directory); $directory = (string) get_parameter('directory');
if (empty($directory) === true) {
$directory = $fallback_directory;
} else {
$directory = str_replace('\\', '/', $directory); $directory = str_replace('\\', '/', $directory);
$directory = filemanager_safe_directory($directory, $fallback_directory);
// A miminal security check to avoid directory traversal
if (preg_match('/\.\./', $directory)) {
$directory = $fallback_directory;
}
if (preg_match('/^\//', $directory)) {
$directory = $fallback_directory;
}
if (preg_match('/^manager/', $directory)) {
$directory = $fallback_directory;
}
$banned_directories['include'] = true;
$banned_directories['godmode'] = true;
$banned_directories['operation'] = true;
$banned_directories['reporting'] = true;
$banned_directories['general'] = true;
$banned_directories[ENTERPRISE_DIR] = true;
if (isset($banned_directories[$directory])) {
$directory = $fallback_directory;
} }
$real_directory = realpath($config['homedir'].'/'.$directory); $real_directory = realpath($config['homedir'].'/'.$directory);
@ -263,12 +244,12 @@ if ($filemanager) {
$default_real_directory = realpath($config['homedir'].'/'.$fallback_directory); $default_real_directory = realpath($config['homedir'].'/'.$fallback_directory);
if ($upload_file_or_zip) { if ($upload_file_or_zip === true) {
upload_file($upload_file_or_zip, $default_real_directory); upload_file($upload_file_or_zip, $default_real_directory, $real_directory);
} }
if ($create_text_file) { if ($create_text_file === true) {
create_text_file($default_real_directory); create_text_file($default_real_directory, $real_directory);
} }
filemanager_file_explorer( filemanager_file_explorer(

View File

@ -47,26 +47,15 @@ if (isset($config['filemanager']['message']) === true) {
$config['filemanager']['message'] = null; $config['filemanager']['message'] = null;
} }
$directory = (string) get_parameter('directory');
if (empty($directory) === true) {
$directory = 'images';
} else {
$directory = str_replace('\\', '/', $directory);
$directory = filemanager_safe_directory($directory, 'images');
}
// Add custom directories here. // Add custom directories here.
$fallback_directory = 'images'; $fallback_directory = 'images';
// Banned directories. // Get directory.
$banned_directories['include'] = true; $directory = (string) get_parameter('directory');
$banned_directories['godmode'] = true; if (empty($directory) === true) {
$banned_directories['operation'] = true;
$banned_directories['reporting'] = true;
$banned_directories['general'] = true;
$banned_directories[ENTERPRISE_DIR] = true;
if (isset($banned_directories[$directory]) === true) {
$directory = $fallback_directory; $directory = $fallback_directory;
} else {
$directory = str_replace('\\', '/', $directory);
$directory = filemanager_safe_directory($directory, $fallback_directory);
} }
$real_directory = realpath($config['homedir'].'/'.$directory); $real_directory = realpath($config['homedir'].'/'.$directory);
@ -76,14 +65,14 @@ echo '<h4>'.__('Index of %s', $directory).'</h4>';
$upload_file_or_zip = (bool) get_parameter('upload_file_or_zip'); $upload_file_or_zip = (bool) get_parameter('upload_file_or_zip');
$create_text_file = (bool) get_parameter('create_text_file'); $create_text_file = (bool) get_parameter('create_text_file');
$default_real_directory = realpath($config['homedir'].'/'.$fallback_directory); $default_real_directory = realpath($config['homedir'].'/');
if ($upload_file_or_zip === true) { if ($upload_file_or_zip === true) {
upload_file($upload_file_or_zip, $default_real_directory); upload_file($upload_file_or_zip, $default_real_directory, $real_directory);
} }
if ($create_text_file === true) { if ($create_text_file === true) {
create_text_file($default_real_directory); create_text_file($default_real_directory, $real_directory);
} }
filemanager_file_explorer( filemanager_file_explorer(
@ -96,5 +85,6 @@ filemanager_file_explorer(
'', '',
false, false,
'', '',
false,
false false
); );

View File

@ -40,12 +40,18 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user
$is_management_allowed = true; $is_management_allowed = true;
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
$is_management_allowed = false; $is_management_allowed = false;
if (is_metaconsole() === false) {
$url = '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=list&pure='.(int) $config['pure']
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All OS definitions are read only. Go to %s to manage them.', 'This node is configured with centralized mode. All OS definitions are read only. Go to %s to manage them.',
'<a target="_blank" href="'.ui_get_meta_url( $url
'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=list&pure=0'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -571,7 +571,7 @@ $table_remote->data['integria_test'] = $row;
// Print. // Print.
echo '<div class="center pdd_b_20px">'; echo '<div class="center pdd_b_20px">';
echo '<a target="_blank" rel="noopener noreferrer" href="http://integriaims.com">'; echo '<a target="_blank" rel="noopener noreferrer" href="http://integriaims.com">';
html_print_image('images/integria_logo.png'); html_print_image('images/integria_logo.svg');
echo '</a>'; echo '</a>';
echo '<br />'; echo '<br />';
echo '<div clsas="integria_title">'; echo '<div clsas="integria_title">';

View File

@ -97,7 +97,7 @@ $table->data['editor'] = [
'oid' => html_print_input_text('oid_editor', '', '', 40, 255, true), 'oid' => html_print_input_text('oid_editor', '', '', 40, 255, true),
'description' => html_print_input_text('description_editor', '', '', 40, 255, true), 'description' => html_print_input_text('description_editor', '', '', 40, 255, true),
'post_process' => html_print_input_text('post_process_editor', '', '', 20, 255, true), 'post_process' => html_print_input_text('post_process_editor', '', '', 20, 255, true),
'op' => '<img class="loading invisible" src="'.'images/spinner.gif'.'" />'.'<a class="button_save_snmp" href="javascript: save_translation();">'.html_print_image('images/save_mc.png', true, ['title' => __('Save')]).'</a>'.'<a class="button_update_snmp invisible" href="javascript: update_snmp();">'.html_print_image('images/update.png', true, ['title' => __('Update'), 'class' => 'invert_filter']).'</a>'.'<a class="cancel_button_snmp invisible" href="javascript: cancel_snmp();">'.html_print_image('images/cancel.png', true, ['title' => __('Cancel')]).'</a>', 'op' => '<img class="loading invisible" src="'.'images/spinner.gif'.'" />'.'<a class="button_save_snmp" href="javascript: save_translation();">'.html_print_image('images/save_mc.png', true, ['title' => __('Save'), 'class' => 'invert_filter']).'</a>'.'<a class="button_update_snmp invisible" href="javascript: update_snmp();">'.html_print_image('images/update.png', true, ['title' => __('Update'), 'class' => 'invert_filter']).'</a>'.'<a class="cancel_button_snmp invisible" href="javascript: cancel_snmp();">'.html_print_image('images/cancel.png', true, ['title' => __('Cancel')]).'</a>',
]; ];

View File

@ -986,12 +986,11 @@ if ($create_alert || $update_alert) {
echo html_print_select(get_priorities(), 'priority', $priority, '', '', '0', false, false, false); echo html_print_select(get_priorities(), 'priority', $priority, '', '', '0', false, false, false);
echo '</td></tr>'; echo '</td></tr>';
// Alert type (e-mail, event etc.) // Alert type (e-mail, event etc.).
echo '<tr><td class="datos">'.__('Alert commands').'</td><td class="datos">'; echo '<tr><td class="datos">'.__('Alert action').'</td><td class="datos">';
html_print_select_from_sql( html_print_select_from_sql(
'SELECT id, name 'SELECT id, name
FROM talert_commands FROM talert_actions
ORDER BY name', ORDER BY name',
'alert_type', 'alert_type',
$alert_type, $alert_type,
@ -1481,7 +1480,7 @@ $(document).ready (function () {
value: "1" value: "1"
}); });
values.push ({ values.push ({
name: "id", name: "id_action",
value: this.value value: this.value
}); });
values.push ({ values.push ({
@ -1514,7 +1513,7 @@ $(document).ready (function () {
$('#table_macros-field' + i) $('#table_macros-field' + i)
.removeAttr('class'); .removeAttr('class');
$("[name=field" + i + "_value]").val(old_value); $("[name=field" + i + "_value]").val(old_value).trigger('change');
$('#table_macros-field').show(); $('#table_macros-field').show();
} }
} }

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