Merge branch 'develop' of brutus.artica.es:artica/pandorafms into ent-7972-funcionalidad-historico-de-alertas-lanzadas

This commit is contained in:
Jose Gonzalez 2021-10-08 14:03:25 +02:00
commit 0414b9991a
197 changed files with 10253 additions and 2573 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

@ -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.757, 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.757, 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.757, 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.757, 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.757, 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.757, 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.757
# 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.757, 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.757
# 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.757, 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.757
# 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.757
# 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.757
# 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.757, 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.757, 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-210913 Version: 7.0NG.757-211008
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-210913" pandora_version="7.0NG.757-211008"
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.757"
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.757" 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.757" 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.757</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.757 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.757</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.757, 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.757, 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.757, 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.757, 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.757, 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.757, 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.757, 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.757';
use constant AGENT_BUILD => '210913'; use constant AGENT_BUILD => '211008';
# 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.757
%define release 210913 %define release 211008
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.757
%define release 210913 %define release 211008
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.757"
PI_BUILD="210913" PI_BUILD="211008"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

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.757
# 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.757}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{210913} {211008}
ViewReadme ViewReadme
{Yes} {Yes}

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 210913") #define PANDORA_VERSION ("7.0NG.757 Build 211008")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

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 210913))" VALUE "ProductVersion", "(7.0NG.757(Build 211008))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.756-210913 Version: 7.0NG.757-211008
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-210913" pandora_version="7.0NG.757-211008"
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>';

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

@ -106,3 +106,9 @@ 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

View File

@ -1,7 +1,5 @@
START TRANSACTION; START TRANSACTION;
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
ALTER TABLE `tmetaconsole_setup` ADD COLUMN `unified` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0; ALTER TABLE `tmetaconsole_setup` ADD COLUMN `unified` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tlayout` ADD COLUMN `auto_adjust` INTEGER UNSIGNED NOT NULL default 0; ALTER TABLE `tlayout` ADD COLUMN `auto_adjust` INTEGER UNSIGNED NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `title` TEXT default ''; ALTER TABLE `tlayout_data` ADD COLUMN `title` TEXT default '';

View File

@ -1,5 +1,7 @@
START TRANSACTION; 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 'custom_report_front_font';
UPDATE `tconfig` set value = 'Lato-Regular.ttf' WHERE token LIKE 'fontpath'; UPDATE `tconfig` set value = 'Lato-Regular.ttf' WHERE token LIKE 'fontpath';
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de'; UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';

View File

@ -0,0 +1,22 @@
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';
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';
COMMIT;

View File

@ -710,6 +710,8 @@ 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;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tevent_alert_action` -- Table `tevent_alert_action`
@ -896,6 +898,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`
@ -1441,13 +1448,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', 49);
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', 757);
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';
@ -1774,6 +1781,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`

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

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

@ -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 { } else {
$img = 'images/policies_mc.png'; $module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png';
} else {
$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
).'"'; ).'"';
?> ?>

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>'
) )
); );
} }

View File

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

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

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

@ -334,12 +334,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 +407,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

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

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'];
@ -837,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':
@ -1068,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
@ -2310,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>';
@ -2422,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');
@ -4433,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':
@ -4487,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':
@ -4573,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':
@ -4622,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':
@ -5514,7 +5583,9 @@ function chooseType() {
$("#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();
@ -5650,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();
@ -6231,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
@ -2185,7 +2197,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':
@ -2229,6 +2240,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;
@ -2536,6 +2555,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
@ -2560,6 +2583,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
@ -2584,6 +2611,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
@ -2825,7 +2856,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':
@ -2869,6 +2899,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;

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

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

@ -171,12 +171,18 @@ if ($delete !== 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=advanced/component_management'
).'">'.__('metaconsole').'</a>';
} else {
$url = __('any node');
}
ui_print_warning_message( ui_print_warning_message(
__( __(
'This node is configured with centralized mode. All tags information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All tags 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'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -87,7 +87,8 @@ if (function_exists('enterprise_hook') === true) {
$days_to_expiry = ((strtotime($license_data['expiry_date']) - time()) / (60 * 60 * 24)); $days_to_expiry = ((strtotime($license_data['expiry_date']) - time()) / (60 * 60 * 24));
if ((int) $license_data['limit_mode'] === 0) { if ((int) $license_data['limit_mode'] === 0) {
$limit = db_get_value('count(*)', 'tagente', 'disabled', 0); $agent_table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
$limit = db_get_value('count(*)', $agent_table, 'disabled', 0);
} else { } else {
$limit = db_get_value('count(*)', 'tagente_modulo', 'disabled', 0); $limit = db_get_value('count(*)', 'tagente_modulo', 'disabled', 0);
} }

View File

@ -721,6 +721,7 @@ if ($update_user) {
); );
} }
if ($values['strict_acl']) { if ($values['strict_acl']) {
$count_groups = 0; $count_groups = 0;
$count_tags = 0; $count_tags = 0;
@ -991,7 +992,7 @@ $email = '<div class="label_select_simple">'.html_print_input_text_extended(
$view_mode, $view_mode,
'', '',
[ [
'class' => 'input input_line email_icon_input invert_filter', 'class' => 'input input_line email_icon_input',
'placeholder' => __('E-mail'), 'placeholder' => __('E-mail'),
], ],
true true
@ -1226,7 +1227,10 @@ $session_time .= html_print_input_text(
'class="input_line_small"' 'class="input_line_small"'
).'</div>'; ).'</div>';
$event_filter_data = db_get_all_rows_sql('SELECT id_name, id_filter FROM tevent_filter');
$user_groups = implode(',', array_keys((users_get_groups($id, 'AR', $display_all_group))));
$event_filter_data = db_get_all_rows_sql('SELECT id_name, id_filter FROM tevent_filter WHERE id_group_filter IN ('.$user_groups.')');
if ($event_filter_data === false) { if ($event_filter_data === false) {
$event_filter_data = []; $event_filter_data = [];
} }

View File

@ -102,12 +102,18 @@ $id_profile = (int) get_parameter('id');
$is_management_allowed = true; $is_management_allowed = true;
if (is_metaconsole() === false && is_management_allowed() === false) { if (is_metaconsole() === false && 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/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 information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All profiles 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

@ -397,12 +397,18 @@ $table->data[0][4] = html_print_submit_button(
$is_management_allowed = true; $is_management_allowed = true;
if (is_metaconsole() === false && is_management_allowed() === false) { if (is_metaconsole() === false && 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/users_setup&tab=user&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 users information is read only. Go to %s to manage it.', 'This node is configured with centralized mode. All users 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=user&pure=0'
).'">'.__('metaconsole').'</a>'
) )
); );
} }
@ -710,10 +716,12 @@ foreach ($info as $user_id => $user_info) {
$toDoString = __('Disable'); $toDoString = __('Disable');
$toDoAction = '1'; $toDoAction = '1';
$toDoImage = 'images/lightbulb.png'; $toDoImage = 'images/lightbulb.png';
$toDoClass = '';
} else { } else {
$toDoString = __('Enable'); $toDoString = __('Enable');
$toDoAction = '0'; $toDoAction = '0';
$toDoImage = 'images/lightbulb_off.png'; $toDoImage = 'images/lightbulb_off.png';
$toDoClass = 'filter_none';
} }
$data[6] = '<form method="POST" action="index.php?sec='.$sec.'&amp;sec2=godmode/users/user_list&amp;pure='.$pure.'" class="inline">'; $data[6] = '<form method="POST" action="index.php?sec='.$sec.'&amp;sec2=godmode/users/user_list&amp;pure='.$pure.'" class="inline">';
@ -736,7 +744,7 @@ foreach ($info as $user_id => $user_info) {
[ [
'data-title' => $toDoString, 'data-title' => $toDoString,
'data-use_title_for_force_title' => '1', 'data-use_title_for_force_title' => '1',
'class' => 'forced_title no-padding', 'class' => 'forced_title no-padding '.$toDoClass,
] ]
); );
$data[6] .= '</form>'; $data[6] .= '</form>';

View File

@ -961,7 +961,10 @@ class DiscoveryTaskList extends HTML
).'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image( ).'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image(
'images/lightbulb_off.png', 'images/lightbulb_off.png',
true, true,
['title' => __('enable task')] [
'title' => __('enable task'),
'class' => 'filter_none',
]
).'</a>'; ).'</a>';
} else if ($task['disabled'] == 0) { } else if ($task['disabled'] == 0) {
$data[9] .= '<a href="'.ui_get_full_url( $data[9] .= '<a href="'.ui_get_full_url(
@ -1652,9 +1655,9 @@ class DiscoveryTaskList extends HTML
$license = enterprise_hook('license_get_info'); $license = enterprise_hook('license_get_info');
if (is_array($license) === true if (is_array($license) === true
&& $n_agents > ($license['limit'] - $license['count']) && $n_agents > ($license['limit'] - $license['count_enabled'])
) { ) {
$limit = ($license['limit'] - $license['count']); $limit = ($license['limit'] - $license['count_enabled']);
echo json_encode( echo json_encode(
[ [
'error' => __( 'error' => __(

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -252,7 +252,9 @@ if ($save_event_filter) {
$values['filter_only_alert'] = get_parameter('filter_only_alert'); $values['filter_only_alert'] = get_parameter('filter_only_alert');
$values['id_group_filter'] = get_parameter('id_group_filter'); $values['id_group_filter'] = get_parameter('id_group_filter');
$values['date_from'] = get_parameter('date_from'); $values['date_from'] = get_parameter('date_from');
$values['time_from'] = get_parameter('time_from');
$values['date_to'] = get_parameter('date_to'); $values['date_to'] = get_parameter('date_to');
$values['time_to'] = get_parameter('time_to');
$values['source'] = get_parameter('source'); $values['source'] = get_parameter('source');
$values['id_extra'] = get_parameter('id_extra'); $values['id_extra'] = get_parameter('id_extra');
$values['user_comment'] = get_parameter('user_comment'); $values['user_comment'] = get_parameter('user_comment');
@ -304,13 +306,15 @@ if ($update_event_filter) {
$values['filter_only_alert'] = get_parameter('filter_only_alert'); $values['filter_only_alert'] = get_parameter('filter_only_alert');
$values['id_group_filter'] = get_parameter('id_group_filter'); $values['id_group_filter'] = get_parameter('id_group_filter');
$values['date_from'] = get_parameter('date_from'); $values['date_from'] = get_parameter('date_from');
$values['time_from'] = get_parameter('time_from');
$values['date_to'] = get_parameter('date_to'); $values['date_to'] = get_parameter('date_to');
$values['time_to'] = get_parameter('time_to');
$values['source'] = get_parameter('source'); $values['source'] = get_parameter('source');
$values['id_extra'] = get_parameter('id_extra'); $values['id_extra'] = get_parameter('id_extra');
$values['user_comment'] = get_parameter('user_comment'); $values['user_comment'] = get_parameter('user_comment');
$values['id_source_event'] = get_parameter('id_source_event'); $values['id_source_event'] = get_parameter('id_source_event');
if (is_metaconsole()) { if (is_metaconsole() === true) {
$values['server_id'] = get_parameter('server_id'); $values['server_id'] = get_parameter('server_id');
} }
@ -355,7 +359,9 @@ if ($get_filter_values) {
'id_extra' => '', 'id_extra' => '',
'id_user_ack' => '', 'id_user_ack' => '',
'date_from' => '', 'date_from' => '',
'time_from' => '',
'date_to' => '', 'date_to' => '',
'time_to' => '',
'severity' => '', 'severity' => '',
'event_type' => '', 'event_type' => '',
'group_rep' => 0, 'group_rep' => 0,
@ -380,7 +386,7 @@ if ($get_filter_values) {
} }
} }
if (is_metaconsole()) { if (is_metaconsole() === true) {
$server_name = db_get_value('server_name', 'tmetaconsole_setup', 'id', $event_filter['server_id']); $server_name = db_get_value('server_name', 'tmetaconsole_setup', 'id', $event_filter['server_id']);
if ($server_name !== false) { if ($server_name !== false) {
$event_filter['server_name'] = $server_name; $event_filter['server_name'] = $server_name;
@ -543,8 +549,12 @@ function load_form_filter() {
$("#select2-server_id-container").text(val); $("#select2-server_id-container").text(val);
if(i == 'date_from') if(i == 'date_from')
$("#text-date_from").val(val); $("#text-date_from").val(val);
if(i == 'time_from')
$("#text-time_from").val(val);
if(i == 'date_to') if(i == 'date_to')
$("#text-date_to").val(val); $("#text-date_to").val(val);
if(i == 'time_to')
$("#text-time_to").val(val);
if(i == 'module_search') if(i == 'module_search')
$('input[name=module_search]').val(val); $('input[name=module_search]').val(val);
if(i == 'group_name') if(i == 'group_name')
@ -767,7 +777,9 @@ function save_new_filter() {
"filter_only_alert" : $("#filter_only_alert").val(), "filter_only_alert" : $("#filter_only_alert").val(),
"id_group_filter": $("#id_group_filter").val(), "id_group_filter": $("#id_group_filter").val(),
"date_from": $("#text-date_from").val(), "date_from": $("#text-date_from").val(),
"time_from": $("#text-time_from").val(),
"date_to": $("#text-date_to").val(), "date_to": $("#text-date_to").val(),
"time_to": $("#text-time_to").val(),
"source": $("#text-source").val(), "source": $("#text-source").val(),
"id_extra": $("#text-id_extra").val(), "id_extra": $("#text-id_extra").val(),
"user_comment": $("#text-user_comment").val(), "user_comment": $("#text-user_comment").val(),
@ -838,7 +850,9 @@ function save_update_filter() {
"filter_only_alert" : $("#filter_only_alert").val(), "filter_only_alert" : $("#filter_only_alert").val(),
"id_group_filter": $("#id_group_filter").val(), "id_group_filter": $("#id_group_filter").val(),
"date_from": $("#text-date_from").val(), "date_from": $("#text-date_from").val(),
"time_from": $("#text-time_from").val(),
"date_to": $("#text-date_to").val(), "date_to": $("#text-date_to").val(),
"time_to": $("#text-time_to").val(),
"source": $("#text-source").val(), "source": $("#text-source").val(),
"id_extra": $("#text-id_extra").val(), "id_extra": $("#text-id_extra").val(),
"user_comment": $("#text-user_comment").val(), "user_comment": $("#text-user_comment").val(),
@ -1783,7 +1797,9 @@ if ($get_list_events_agents) {
$tag_without = get_parameter('tag_without'); $tag_without = get_parameter('tag_without');
$filter_only_alert = get_parameter('filter_only_alert'); $filter_only_alert = get_parameter('filter_only_alert');
$date_from = get_parameter('date_from'); $date_from = get_parameter('date_from');
$time_from = get_parameter('time_from', '00:00:00');
$date_to = get_parameter('date_to'); $date_to = get_parameter('date_to');
$time_to = get_parameter('time_to', '23:59:59');
$id_user = $config['id_user']; $id_user = $config['id_user'];
$returned_sql = events_sql_events_grouped_agents( $returned_sql = events_sql_events_grouped_agents(
@ -1800,7 +1816,9 @@ if ($get_list_events_agents) {
$tag_without, $tag_without,
$filter_only_alert, $filter_only_alert,
$date_from, $date_from,
$time_from,
$date_to, $date_to,
$time_to,
$id_user $id_user
); );

View File

@ -0,0 +1,102 @@
<?php
// ______ __ _______ _______ _______
// | __ \.---.-.-----.--| |.-----.----.---.-. | ___| | | __|
// | __/| _ | | _ || _ | _| _ | | ___| |__ |
// |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
//
// ============================================================================
// Copyright (c) 2007-2021 Artica Soluciones Tecnologicas, http://www.artica.es
// This code is NOT free software. This code is NOT licenced under GPL2 licence
// You cannnot redistribute it without written permission of copyright holder.
// ============================================================================
$networkmap = get_parameter('networkmap', false);
global $config;
require_once $config['homedir'].'/include/class/NetworkMap.class.php';
if ((bool) is_metaconsole() === true) {
$node = get_parameter('node', 0);
if ($node > 0) {
metaconsole_connect(null, $node);
}
}
if ($networkmap) {
$networkmap_id = get_parameter('networkmap_id', 0);
$x_offset = get_parameter('x_offset', 0);
$y_offset = get_parameter('y_offset', 0);
$zoom_dash = get_parameter('zoom_dash', 0.5);
// Dashboard mode.
$ignore_acl = (bool) get_parameter('ignore_acl', 0);
$networkmap = db_get_row_filter('tmap', ['id' => $networkmap_id]);
if ($ignore_acl === false) {
// ACL for the network map.
$networkmap_read = check_acl($config['id_user'], $networkmap['id_group'], 'MR');
$networkmap_write = check_acl($config['id_user'], $networkmap['id_group'], 'MW');
$networkmap_manage = check_acl($config['id_user'], $networkmap['id_group'], 'MM');
if (!$networkmap_read && !$networkmap_write && !$networkmap_manage) {
db_pandora_audit(
'ACL Violation',
'Trying to access networkmap'
);
include 'general/noaccess.php';
if ($node > 0) {
metaconsole_restore_db();
}
return;
}
}
ob_start();
if ($networkmap['generation_method'] == LAYOUT_RADIAL_DYNAMIC) {
$data['name'] = '<a href="index.php?'.'sec=network&'.'sec2=operation/agentes/networkmap.dinamic&'.'activeTab=radial_dynamic&'.'id_networkmap='.$networkmap['id'].'">'.$networkmap['name'].'</a>';
global $id_networkmap;
$id_networkmap = $networkmap['id'];
$tab = 'radial_dynamic';
include_once 'operation/agentes/networkmap.dinamic.php';
} else {
$map = new NetworkMap(
[
'id_map' => $networkmap_id,
'widget' => 1,
'pure' => 1,
'no_popup' => 1,
'map_options' => [
'x_offs' => $x_offset,
'y_offs' => $y_offset,
'z_dash' => $zoom_dash,
],
]
);
$map->printMap(false, $ignore_acl);
}
$return = ob_get_clean();
echo $return;
if ($node > 0) {
metaconsole_restore_db();
}
return;
}
if ($node > 0) {
metaconsole_restore_db();
}

View File

@ -40,6 +40,7 @@ if (is_ajax() === true) {
include_once $config['homedir'].'/include/class/TreeGroup.class.php'; include_once $config['homedir'].'/include/class/TreeGroup.class.php';
include_once $config['homedir'].'/include/class/TreeService.class.php'; include_once $config['homedir'].'/include/class/TreeService.class.php';
include_once $config['homedir'].'/include/class/TreeGroupEdition.class.php'; include_once $config['homedir'].'/include/class/TreeGroupEdition.class.php';
enterprise_include_once('include/class/TreeIPAMSupernet.class.php');
enterprise_include_once('include/class/TreePolicies.class.php'); enterprise_include_once('include/class/TreePolicies.class.php');
enterprise_include_once('include/class/TreeGroupMeta.class.php'); enterprise_include_once('include/class/TreeGroupMeta.class.php');
include_once $config['homedir'].'/include/functions_reporting.php'; include_once $config['homedir'].'/include/functions_reporting.php';
@ -190,6 +191,18 @@ if (is_ajax() === true) {
); );
break; break;
case 'IPAM_supernets':
$tree = new TreeIPAMSupernet(
$type,
$rootType,
$id,
$rootID,
$serverID,
$childrenMethod,
$access
);
break;
default: default:
// No error handler. // No error handler.
return; return;

View File

@ -770,7 +770,7 @@ function ldap_process_user_login($login, $password)
io_safe_output($config['ldap_base_dn']), io_safe_output($config['ldap_base_dn']),
$config['ldap_login_attr'], $config['ldap_login_attr'],
io_safe_output($config['ldap_admin_login']), io_safe_output($config['ldap_admin_login']),
$config['ldap_admin_pass'], io_safe_output($config['ldap_admin_pass']),
io_safe_output($login) io_safe_output($login)
); );

View File

@ -1227,7 +1227,7 @@ class AgentWizard extends HTML
$this->idPolicy, $this->idPolicy,
io_safe_input($module['name']) io_safe_input($module['name'])
); );
$msgError = __('Module exist in policy'); $msgError = __('Module exists in policy');
} else { } else {
$sql = sprintf( $sql = sprintf(
"SELECT id_agente_modulo "SELECT id_agente_modulo
@ -1237,7 +1237,7 @@ class AgentWizard extends HTML
$this->idAgent, $this->idAgent,
io_safe_input($module['name']) io_safe_input($module['name'])
); );
$msgError = __('Module exist in agent'); $msgError = __('Module exists in agent');
} }
$existInDb = db_get_value_sql($sql); $existInDb = db_get_value_sql($sql);
@ -1931,7 +1931,7 @@ class AgentWizard extends HTML
// Already defined. // Already defined.
$this->message['type'][] = 'error'; $this->message['type'][] = 'error';
$this->message['message'][] = __( $this->message['message'][] = __(
'Module "%s" exits in this agent', 'Module "%s" exists in this agent',
$candidate['name'] $candidate['name']
); );
$errorflag = true; $errorflag = true;
@ -3965,7 +3965,7 @@ class AgentWizard extends HTML
$class = ''; $class = '';
if ($activeModules === 1) { if ($activeModules === 1) {
$class = 'alpha50'; $class = 'alpha50 pdd_0px';
} }
$table->head[6] = html_print_checkbox_switch_extended( $table->head[6] = html_print_checkbox_switch_extended(
@ -3997,7 +3997,7 @@ class AgentWizard extends HTML
'', '',
true, true,
'', '',
'alpha50' 'alpha50 pdd_0px'
); );
} }
@ -4196,7 +4196,9 @@ class AgentWizard extends HTML
false, false,
'switchBlockControl(event)', 'switchBlockControl(event)',
'', '',
true true,
'',
'pdd_0px'
); );
} else { } else {
// WIP. Current value of this module. // WIP. Current value of this module.
@ -4222,7 +4224,9 @@ class AgentWizard extends HTML
false, false,
'switchBlockControl(event)', 'switchBlockControl(event)',
'form="form-create-modules"', 'form="form-create-modules"',
true true,
'',
'pdd_0px'
); );
} }
@ -5681,22 +5685,28 @@ class AgentWizard extends HTML
.parent() .parent()
.removeClass("alpha50"); .removeClass("alpha50");
if (selectedBlock.prop("checked")) { if (selectedBlock.prop("checked")) {
// Set to active the values of fields. // Set all inputs in block to checked.
for (i = 0; i<=15; i++) { var blockItems = document.querySelectorAll('[id^="hidden-module-active-'+switchName[2]+'"]');
document.getElementById("hidden-module-active-" + switchName[2] + "_"+i+"-"+i).value = 1;
} blockItems.forEach(function(item) {
// Set checked. item.value = 1;
});
// Set block selector to checked.
$("[id*=checkbox-sel_module_" + blockNumber + "]") $("[id*=checkbox-sel_module_" + blockNumber + "]")
.each(function() { .each(function() {
$(this).prop("checked", true); $(this).prop("checked", true);
}); });
imageInfoModules.removeClass('hidden'); imageInfoModules.removeClass('hidden');
} else { } else {
// Set to inactive the values of fields. // Set all inputs in block to unchecked.
for (i = 0; i<=15; i++) { var blockItems = document.querySelectorAll('[id^="hidden-module-active-'+switchName[2]+'"]');
document.getElementById("hidden-module-active-" + switchName[2] + "_"+i+"-"+i).value = 0;
} blockItems.forEach(function(item) {
// Set unchecked. item.value = 0;
});
// Set block selector to unchecked.
$("[id*=checkbox-sel_module_" + blockNumber + "]") $("[id*=checkbox-sel_module_" + blockNumber + "]")
.each(function() { .each(function() {
$(this).prop("checked", false); $(this).prop("checked", false);

View File

@ -1400,6 +1400,10 @@ class ConsoleSupervisor
$PHPmemory_limit_min = config_return_in_bytes('800M'); $PHPmemory_limit_min = config_return_in_bytes('800M');
$PHPSerialize_precision = ini_get('serialize_precision'); $PHPSerialize_precision = ini_get('serialize_precision');
if (is_metaconsole() === true) {
$PHPmemory_limit_min = config_return_in_bytes('-1');
}
// PhantomJS status. // PhantomJS status.
$phantomjs_dir = io_safe_output($config['phantomjs_bin']); $phantomjs_dir = io_safe_output($config['phantomjs_bin']);
$result_ejecution = exec($phantomjs_dir.'/phantomjs --version'); $result_ejecution = exec($phantomjs_dir.'/phantomjs --version');
@ -1504,6 +1508,11 @@ class ConsoleSupervisor
$url = 'http://php.net/manual/es/ini.core.php#ini.memory-limit'; $url = 'http://php.net/manual/es/ini.core.php#ini.memory-limit';
} }
$recommended_memory = '800M';
if (is_metaconsole() === true) {
$recommended_memory = '-1';
}
$this->notify( $this->notify(
[ [
'type' => 'NOTIF.PHP.MEMORY_LIMIT', 'type' => 'NOTIF.PHP.MEMORY_LIMIT',
@ -1513,7 +1522,7 @@ class ConsoleSupervisor
), ),
'message' => sprintf( 'message' => sprintf(
__('Recommended value is: %s'), __('Recommended value is: %s'),
sprintf(__('%s or greater'), '800M') sprintf(__('%s or greater'), $recommended_memory)
).'<br><br>'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator'), ).'<br><br>'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator'),
'url' => $url, 'url' => $url,
] ]

View File

@ -837,8 +837,11 @@ class ModuleTemplates extends HTML
$penInfo = db_get_all_rows_filter('tnetwork_profile_pen', ['id_np' => $this->id_np]); $penInfo = db_get_all_rows_filter('tnetwork_profile_pen', ['id_np' => $this->id_np]);
$penList = []; $penList = [];
foreach ($penInfo as $pen) { // Handle if list of PEN does not exist or is empty.
$penList[] = $pen['pen']; if ($penInfo !== false) {
foreach ($penInfo as $pen) {
$penList[] = $pen['pen'];
}
} }
$this->pen = implode(',', $penList); $this->pen = implode(',', $penList);

View File

@ -30,7 +30,6 @@
global $config; global $config;
require_once $config['homedir'].'/include/functions_networkmap.php'; require_once $config['homedir'].'/include/functions_networkmap.php';
enterprise_include_once('include/functions_networkmap.php');
enterprise_include_once('include/functions_discovery.php'); enterprise_include_once('include/functions_discovery.php');
// Avoid node overlapping. // Avoid node overlapping.
@ -723,13 +722,7 @@ class NetworkMap
} }
if ($this->idMap !== false) { if ($this->idMap !== false) {
if (enterprise_installed()) { $this->nodes = get_nodes_from_db($this->idMap);
// Enterprise environment: LOAD.
$this->nodes = enterprise_hook(
'get_nodes_from_db',
[$this->idMap]
);
}
} }
return $this->nodes; return $this->nodes;
@ -762,12 +755,7 @@ class NetworkMap
} }
if ($this->idMap !== false) { if ($this->idMap !== false) {
if (enterprise_installed()) { $this->relations = get_relations_from_db($this->idMap);
$this->relations = enterprise_hook(
'get_relations_from_db',
[$this->idMap]
);
}
} }
return $this->relations; return $this->relations;
@ -786,12 +774,9 @@ class NetworkMap
// Calculate. // Calculate.
// Search. // Search.
if (enterprise_installed() && $this->idTask) { if ($this->idTask) {
// Network map, based on discovery task. // Network map, based on discovery task.
return enterprise_hook( return get_discovery_agents($this->idTask);
'get_discovery_agents',
[$this->idTask]
);
} }
if ($this->network) { if ($this->network) {
@ -1101,18 +1086,14 @@ class NetworkMap
$relations = $this->relations; $relations = $this->relations;
// Generate if there's no data in DB about nodes or relations. // Generate if there's no data in DB about nodes or relations.
if (empty($nodes) && empty($relations)) { if (empty($nodes) === true && empty($relations) === true) {
$this->generateNetworkMap(); $this->generateNetworkMap();
return; return;
} }
$graph = enterprise_hook( $graph = networkmap_load_map($this);
'networkmap_load_map',
[$this]
);
if ($graph === ENTERPRISE_NOT_HOOK) { if (empty($graph) === true) {
// Method not available, regenerate.
$this->generateNetworkMap(); $this->generateNetworkMap();
return; return;
} }
@ -2607,15 +2588,7 @@ class NetworkMap
// Save data. // Save data.
if ($this->idMap > 0 && (isset($this->map['__simulated']) === false)) { if ($this->idMap > 0 && (isset($this->map['__simulated']) === false)) {
if (enterprise_installed()) { $graph = save_generate_nodes($this->idMap, $graph);
$graph = enterprise_hook(
'save_generate_nodes',
[
$this->idMap,
$graph,
]
);
}
db_process_sql_update( db_process_sql_update(
'tmap', 'tmap',
@ -2733,7 +2706,6 @@ class NetworkMap
$output .= 'var networkmap_refresh_time = 1000 * '.$networkmap['source_period'].";\n"; $output .= 'var networkmap_refresh_time = 1000 * '.$networkmap['source_period'].";\n";
$output .= 'var networkmap_center = [ '.$networkmap['center_x'].', '.$networkmap['center_y']."];\n"; $output .= 'var networkmap_center = [ '.$networkmap['center_x'].', '.$networkmap['center_y']."];\n";
$output .= 'var networkmap_dimensions = [ '.$networkmap['width'].', '.$networkmap['height']."];\n"; $output .= 'var networkmap_dimensions = [ '.$networkmap['width'].', '.$networkmap['height']."];\n";
$output .= 'var enterprise_installed = '.((int) enterprise_installed()).";\n";
$output .= 'var networkmap_write = '.$networkmap_write.";\n"; $output .= 'var networkmap_write = '.$networkmap_write.";\n";
$output .= 'var node_radius = '.$networkmap['filter']['node_radius'].";\n"; $output .= 'var node_radius = '.$networkmap['filter']['node_radius'].";\n";
$output .= 'var networkmap_holding_area_dimensions = '.json_encode($networkmap['filter']['holding_area']).";\n"; $output .= 'var networkmap_holding_area_dimensions = '.json_encode($networkmap['filter']['holding_area']).";\n";
@ -2883,22 +2855,14 @@ class NetworkMap
public function loadAdvancedInterface() public function loadAdvancedInterface()
{ {
$list_networkmaps = get_networkmaps($this->idMap); $list_networkmaps = get_networkmaps($this->idMap);
if (empty($list_networkmaps)) {
if (empty($list_networkmaps) === true) {
$list_networkmaps = []; $list_networkmaps = [];
} }
$id = 'dialog_node_edit'; $id = 'dialog_node_edit';
if (!enterprise_installed()) {
$id = 'open_version_dialog';
$output = '<div id="open_version" style="display: none" title="'.__('Warning').'">';
$output .= '<div class="center mrgn_top_20px w90p font_13px">'.__(
'In the Open version of %s can not be edited nodes or map',
get_product_name()
);
$output .= '</div></div>';
}
$output .= '<div id="'.$id.'" class="invisible" title="'; $output = '<div id="'.$id.'" class="invisible" title="';
$output .= __('Edit node').'">'; $output .= __('Edit node').'">';
$output .= '<div class="left w100p">'; $output .= '<div class="left w100p">';
@ -3017,16 +2981,14 @@ class NetworkMap
true true
); );
if (enterprise_installed()) { $output .= ui_toggle(
$output .= ui_toggle( html_print_table($table, true),
html_print_table($table, true), __('Node options'),
__('Node options'), __('Node options'),
__('Node options'), '',
'', true,
true, true
true );
);
}
$table = new StdClass(); $table = new StdClass();
$table->id = 'relations_table'; $table->id = 'relations_table';
@ -3109,16 +3071,14 @@ class NetworkMap
true true
); );
if (enterprise_installed()) { $output .= ui_toggle(
$output .= ui_toggle( html_print_table($table, true),
html_print_table($table, true), __('Relations'),
__('Relations'), __('Relations'),
__('Relations'), '',
'', true,
true, true
true );
);
}
$output .= '</div></div>'; $output .= '</div></div>';
@ -3245,6 +3205,16 @@ class NetworkMap
-1, -1,
true true
); );
$table->data[0][2] = html_print_checkbox(
'group_recursion',
0,
false,
true,
false,
'choose_group_for_show_agents()'
).__('Recursion');
$table->data[1][0] = __('Agents'); $table->data[1][0] = __('Agents');
$table->data[1][1] = html_print_select( $table->data[1][1] = html_print_select(
[-1 => __('None')], [-1 => __('None')],
@ -3340,8 +3310,7 @@ class NetworkMap
{ {
$output = ''; $output = '';
if (enterprise_installed() if ($this->useTooltipster
&& $this->useTooltipster
) { ) {
$output .= '<script type="text/javascript"> $output .= '<script type="text/javascript">
$(function() { $(function() {
@ -3376,7 +3345,7 @@ class NetworkMap
graph: networkmap, graph: networkmap,
networkmap_center: networkmap_center, networkmap_center: networkmap_center,
networkmap_dimensions: networkmap_dimensions, networkmap_dimensions: networkmap_dimensions,
enterprise_installed: enterprise_installed, enterprise_installed: 1,
node_radius: node_radius, node_radius: node_radius,
holding_area_dimensions: networkmap_holding_area_dimensions, holding_area_dimensions: networkmap_holding_area_dimensions,
url_background_grid: url_background_grid, url_background_grid: url_background_grid,
@ -3419,18 +3388,17 @@ class NetworkMap
{ {
global $config; global $config;
if (enterprise_installed() if (isset($this->useTooltipster) === true
&& isset($this->useTooltipster) && (bool) $this->useTooltipster === true
&& $this->useTooltipster == true
) { ) {
$output = '<script type="text/javascript" src="'.ui_get_full_url( $output = '<script type="text/javascript" src="'.ui_get_full_url(
'include/javascript/d3.3.5.14.js' 'include/javascript/d3.3.5.14.js'
).'" charset="utf-8"></script>'; ).'" charset="utf-8"></script>';
$output .= '<script type="text/javascript" src="'.ui_get_full_url( $output .= '<script type="text/javascript" src="'.ui_get_full_url(
'enterprise/include/javascript/SimpleMapController.js' 'include/javascript/SimpleMapController.js'
).'"></script>'; ).'"></script>';
$output .= '<script type="text/javascript" src="'.ui_get_full_url( $output .= '<script type="text/javascript" src="'.ui_get_full_url(
'enterprise/include/javascript/tooltipster.bundle.min.js' 'include/javascript/tooltipster.bundle.min.js'
).'"></script>'; ).'"></script>';
$output .= '<script type="text/javascript" src="'.ui_get_full_url( $output .= '<script type="text/javascript" src="'.ui_get_full_url(
'include/javascript/jquery.svg.js' 'include/javascript/jquery.svg.js'
@ -3439,7 +3407,7 @@ class NetworkMap
'include/javascript/jquery.svgdom.js' 'include/javascript/jquery.svgdom.js'
).'"></script>'; ).'"></script>';
$output .= '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url( $output .= '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url(
'/enterprise/include/styles/tooltipster.bundle.min.css' 'include/styles/tooltipster.bundle.min.css'
).'" />'."\n"; ).'" />'."\n";
$output .= '<div id="simple_map" data-id="'.$this->idMap.'" '; $output .= '<div id="simple_map" data-id="'.$this->idMap.'" ';

View File

@ -222,20 +222,20 @@ class TreeService extends Tree
switch ($status) { switch ($status) {
case SERVICE_STATUS_NORMAL: case SERVICE_STATUS_NORMAL:
$processed_items[$row['id']]['statusImageHTML'] = '<img src="'.'images/status_sets/default/agent_ok_ball.png'.'" data-title="NORMAL status." data-use_title_for_force_title="1" class="forced_title" alt="NORMAL status." />'; $processed_items[$row['id']]['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_ok_ball.png').'" data-title="NORMAL status." data-use_title_for_force_title="1" class="forced_title" alt="NORMAL status." />';
break; break;
case SERVICE_STATUS_CRITICAL: case SERVICE_STATUS_CRITICAL:
$processed_items[$row['id']]['statusImageHTML'] = '<img src="'.'images/status_sets/default/agent_critical_ball.png'.'" data-title="CRITICAL status." data-use_title_for_force_title="1" class="forced_title" alt="CRITICAL status." />'; $processed_items[$row['id']]['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_critical_ball.png').'" data-title="CRITICAL status." data-use_title_for_force_title="1" class="forced_title" alt="CRITICAL status." />';
break; break;
case SERVICE_STATUS_WARNING: case SERVICE_STATUS_WARNING:
$processed_items[$row['id']]['statusImageHTML'] = '<img src="'.'images/status_sets/default/agent_warning_ball.png'.'" data-title="WARNING status." data-use_title_for_force_title="1" class="forced_title" alt="WARNING status." />'; $processed_items[$row['id']]['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_warning_ball.png').'" data-title="WARNING status." data-use_title_for_force_title="1" class="forced_title" alt="WARNING status." />';
break; break;
case SERVICE_STATUS_UNKNOWN: case SERVICE_STATUS_UNKNOWN:
default: default:
$processed_items[$row['id']]['statusImageHTML'] = '<img src="'.'images/status_sets/default/agent_no_data_ball.png'.'" data-title="UNKNOWN status." data-use_title_for_force_title="1" class="forced_title" alt="UNKNOWN status." />'; $processed_items[$row['id']]['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_no_data_ball.png').'" data-title="UNKNOWN status." data-use_title_for_force_title="1" class="forced_title" alt="UNKNOWN status." />';
break; break;
} }
} }
@ -406,21 +406,21 @@ class TreeService extends Tree
switch ($item->agent()->lastStatus()) { switch ($item->agent()->lastStatus()) {
case AGENT_STATUS_NORMAL: case AGENT_STATUS_NORMAL:
$tmp['statusImageHTML'] = '<img src="'.'images/status_sets/default/agent_ok_ball.png'.'" data-title="NORMAL status." data-use_title_for_force_title="1" class="forced_title" alt="NORMAL status." />'; $tmp['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_ok_ball.png').'" data-title="NORMAL status." data-use_title_for_force_title="1" class="forced_title" alt="NORMAL status." />';
break; break;
case AGENT_STATUS_CRITICAL: case AGENT_STATUS_CRITICAL:
case AGENT_STATUS_ALERT_FIRED: case AGENT_STATUS_ALERT_FIRED:
$tmp['statusImageHTML'] = '<img src="'.'images/status_sets/default/agent_critical_ball.png'.'" data-title="CRITICAL status." data-use_title_for_force_title="1" class="forced_title" alt="CRITICAL status." />'; $tmp['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_critical_ball.png').'" data-title="CRITICAL status." data-use_title_for_force_title="1" class="forced_title" alt="CRITICAL status." />';
break; break;
case AGENT_STATUS_WARNING: case AGENT_STATUS_WARNING:
$tmp['statusImageHTML'] = '<img src="'.'images/status_sets/default/agent_warning_ball.png'.'" data-title="WARNING status." data-use_title_for_force_title="1" class="forced_title" alt="WARNING status." />'; $tmp['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_warning_ball.png').'" data-title="WARNING status." data-use_title_for_force_title="1" class="forced_title" alt="WARNING status." />';
break; break;
case AGENT_STATUS_UNKNOWN: case AGENT_STATUS_UNKNOWN:
default: default:
$tmp['statusImageHTML'] = '<img src="'.'images/status_sets/default/agent_no_data_ball.png'.'" data-title="UNKNOWN status." data-use_title_for_force_title="1" class="forced_title" alt="UNKNOWN status." />'; $tmp['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_no_data_ball.png').'" data-title="UNKNOWN status." data-use_title_for_force_title="1" class="forced_title" alt="UNKNOWN status." />';
break; break;
} }

View File

@ -40,7 +40,8 @@ class TreeTag extends Tree
$this->L1orderByFinal = 'tt.name'; $this->L1orderByFinal = 'tt.name';
$this->L2condition = 'AND ttm.id_tag = '.$this->rootID; $this->L2condition = 'AND ttm.id_tag = '.$this->rootID;
$this->L2inner = $this->L1innerInside; $this->L2inner = 'INNER JOIN ttag_module ttm
ON ttm.id_agente_modulo = tam.id_agente_modulo';
$this->L3forceTagCondition = true; $this->L3forceTagCondition = true;
} }

View File

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

View File

@ -234,6 +234,7 @@ define('CLOCK', 19);
define('COLOR_CLOUD', 20); define('COLOR_CLOUD', 20);
define('NETWORK_LINK', 21); define('NETWORK_LINK', 21);
define('ODOMETER', 22); define('ODOMETER', 22);
define('BASIC_CHART', 23);
// Some styles. // Some styles.
define('MIN_WIDTH', 300); define('MIN_WIDTH', 300);
define('MIN_HEIGHT', 120); define('MIN_HEIGHT', 120);

View File

@ -1291,23 +1291,6 @@ function mysql_db_process_sql_rollback()
} }
/**
* Put quotes if magic_quotes protection
*
* @param string Text string to be protected with quotes if magic_quotes protection is disabled
*/
function mysql_safe_sql_string($string)
{
if (get_magic_quotes_gpc() == 0) {
return $string;
}
global $config;
return mysql_real_escape_string($config['dbconnection'], $string);
}
/** /**
* Get last error. * Get last error.
* *

View File

@ -1496,21 +1496,6 @@ function oracle_db_process_sql_rollback()
} }
/**
* Put quotes if magic_quotes protection
*
* @param string Text string to be protected with quotes if magic_quotes protection is disabled
*/
function oracle_safe_sql_string($string)
{
if (get_magic_quotes_gpc() == 0) {
return $string;
}
return oracle_escape_string_sql($string);
}
/** /**
* Get last error. * Get last error.
* *

View File

@ -1098,23 +1098,6 @@ function postgresql_db_process_sql_rollback()
} }
/**
* Put quotes if magic_quotes protection
*
* @param string Text string to be protected with quotes if magic_quotes protection is disabled
*/
function postgresql_safe_sql_string($string)
{
if (get_magic_quotes_gpc() == 0) {
return $string;
}
global $config;
return pg_escape_string($config['dbconnection'], $string);
}
/** /**
* Get last error. * Get last error.
* *

View File

@ -1689,32 +1689,6 @@ if (!function_exists('mb_strtoupper')) {
} }
/**
* Put quotes if magic_quotes protection
*
* @param string Text string to be protected with quotes if magic_quotes protection is disabled
*/
function safe_sql_string($string)
{
global $config;
switch ($config['dbtype']) {
case 'mysql':
return mysql_safe_sql_string($string);
break;
case 'postgresql':
return postgresql_safe_sql_string($string);
break;
case 'oracle':
return oracle_safe_sql_string($string);
break;
}
}
/** /**
* Verifies if current Pandora FMS installation is a Metaconsole. * Verifies if current Pandora FMS installation is a Metaconsole.
* *
@ -1753,7 +1727,12 @@ function has_metaconsole()
*/ */
function is_management_allowed($hkey='') function is_management_allowed($hkey='')
{ {
return ( (is_metaconsole() && is_centrallised()) $nodes = db_get_value('count(*) as n', 'tmetaconsole_setup');
if ($nodes !== false) {
$nodes = (int) $nodes;
}
return ( (is_metaconsole() && (is_centrallised() || $nodes === 0))
|| (!is_metaconsole() && !is_centrallised()) || (!is_metaconsole() && !is_centrallised())
|| (!is_metaconsole() && is_centrallised()) && $hkey == generate_hash_to_api()); || (!is_metaconsole() && is_centrallised()) && $hkey == generate_hash_to_api());
} }
@ -3299,8 +3278,10 @@ function extract_column($array, $column)
function get_percentile($percentile, $array) function get_percentile($percentile, $array)
{ {
global $config;
sort($array); sort($array);
$index = (($percentile / 100) * count($array)); $index = (($config['percentil'] / 100) * count($array));
if (floor($index) == $index) { if (floor($index) == $index) {
$result = (($array[($index - 1)] + $array[$index]) / 2); $result = (($array[($index - 1)] + $array[$index]) / 2);

View File

@ -3072,7 +3072,7 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
$ni_by_agents = []; $ni_by_agents = [];
foreach ($agents as $agent) { foreach ($agents as $agent) {
$agent_id = $agent['id_agente']; $agent_id = (isset($agent['id_agente'])) ? $agent['id_agente'] : $agent;
$agent_group_id = $agent['id_grupo']; $agent_group_id = $agent['id_grupo'];
$agent_name = $agent['alias']; $agent_name = $agent['alias'];
$agent_interfaces = []; $agent_interfaces = [];

View File

@ -1162,7 +1162,6 @@ function alerts_duplicate_alert_template($id_alert_template, $id_group)
unset($template['name']); unset($template['name']);
unset($template['id']); unset($template['id']);
unset($template['type']); unset($template['type']);
$template['value'] = safe_sql_string($template['value']);
return alerts_create_alert_template($name, $type, $template); return alerts_create_alert_template($name, $type, $template);
} }

View File

@ -5777,10 +5777,6 @@ function api_set_create_alert_template($name, $thrash1, $other, $thrash3)
{ {
global $config; global $config;
if (is_metaconsole() === true) {
return;
}
$headers = getallheaders(); $headers = getallheaders();
if (isset($headers['idk']) === false if (isset($headers['idk']) === false
&& is_management_allowed($headers['idk']) === false && is_management_allowed($headers['idk']) === false
@ -16733,9 +16729,15 @@ function api_get_group_id_by_name($thrash1, $thrash2, $other, $thrash3)
return; return;
} }
if (is_array($other['data']) === true) {
$group_id = $other['data'][0];
} else {
$group_id = $other['data'];
}
$sql = sprintf( $sql = sprintf(
'SELECT id_grupo 'SELECT id_grupo
FROM tgrupo WHERE nombre = "'.$other['data'].'"' FROM tgrupo WHERE nombre = "'.$group_id.'"'
); );
$group_id = db_get_all_rows_sql($sql); $group_id = db_get_all_rows_sql($sql);

View File

@ -620,7 +620,7 @@ function config_update_config()
$error_update[] = __('Admin LDAP login'); $error_update[] = __('Admin LDAP login');
} }
if (!config_update_value('ldap_admin_pass', io_input_password(get_parameter('ldap_admin_pass')))) { if (!config_update_value('ldap_admin_pass', get_parameter('ldap_admin_pass'))) {
$error_update[] = __('Admin LDAP password'); $error_update[] = __('Admin LDAP password');
} }

View File

@ -762,7 +762,7 @@ function events_get_all(
} }
if (isset($filter['time_from'])) { if (isset($filter['time_from'])) {
$time_from = $filter['time_from']; $time_from = (empty($filter['time_from']) === true) ? '00:00:00' : $filter['time_from'];
} }
if (isset($date_from)) { if (isset($date_from)) {
@ -785,7 +785,7 @@ function events_get_all(
} }
if (isset($filter['time_to'])) { if (isset($filter['time_to'])) {
$time_to = $filter['time_to']; $time_to = (empty($filter['time_to']) === true) ? '23:59:59' : $filter['time_to'];
} }
if (isset($date_to)) { if (isset($date_to)) {
@ -6193,7 +6193,9 @@ function events_get_events_grouped_by_agent(
* @param array $tag_without Tag_without. * @param array $tag_without Tag_without.
* @param boolean $filter_only_alert Filter_only_alert. * @param boolean $filter_only_alert Filter_only_alert.
* @param string $date_from Date_from. * @param string $date_from Date_from.
* @param string $time_from Time_from.
* @param string $date_to Date_to. * @param string $date_to Date_to.
* @param string $time_to Time_to.
* @param boolean $id_user Id_user. * @param boolean $id_user Id_user.
* @param boolean $server_id_search Server_id_search. * @param boolean $server_id_search Server_id_search.
* *
@ -6213,7 +6215,9 @@ function events_sql_events_grouped_agents(
$tag_without=[], $tag_without=[],
$filter_only_alert=false, $filter_only_alert=false,
$date_from='', $date_from='',
$time_from='',
$date_to='', $date_to='',
$time_to='',
$id_user=false, $id_user=false,
$server_id_search=false $server_id_search=false
) { ) {
@ -6320,27 +6324,35 @@ function events_sql_events_grouped_agents(
$sql_post .= " AND id_usuario = '".$id_user_ack."'"; $sql_post .= " AND id_usuario = '".$id_user_ack."'";
} }
if (!isset($date_from)) { if (isset($date_from) === false) {
$date_from = ''; $date_from = '';
} }
if (!isset($date_to)) { if (isset($time_from) === false) {
$time_from = '00:00:00';
}
if (isset($date_to) === false) {
$date_to = ''; $date_to = '';
} }
if (isset($time_to) === false || empty($time_to) === true) {
$time_to = '23:59:59';
}
if (($date_from == '') && ($date_to == '')) { if (($date_from == '') && ($date_to == '')) {
if ($event_view_hr > 0) { if ($event_view_hr > 0) {
$unixtime = (get_system_time() - ($event_view_hr * SECONDS_1HOUR)); $unixtime = (get_system_time() - ($event_view_hr * SECONDS_1HOUR));
$sql_post .= ' AND (utimestamp > '.$unixtime.')'; $sql_post .= ' AND (utimestamp > '.$unixtime.')';
} }
} else { } else {
if ($date_from != '') { if (empty($date_from) === false) {
$udate_from = strtotime($date_from.' 00:00:00'); $udate_from = strtotime($date_from.' '.$time_from);
$sql_post .= ' AND (utimestamp >= '.$udate_from.')'; $sql_post .= ' AND (utimestamp >= '.$udate_from.')';
} }
if ($date_to != '') { if (empty($date_to) === false) {
$udate_to = strtotime($date_to.' 23:59:59'); $udate_to = strtotime($date_to.' '.$time_to);
$sql_post .= ' AND (utimestamp <= '.$udate_to.')'; $sql_post .= ' AND (utimestamp <= '.$udate_to.')';
} }
} }

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