Merge branch 'develop' into ent-2335-gis-group-items

This commit is contained in:
Alejandro Gallardo Escobar 2018-08-17 11:17:29 +02:00
commit 8a5495a283
68 changed files with 439 additions and 394 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.725
# Version 7.0NG.726
# 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.725-180813
Version: 7.0NG.726-180817
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.725
%define release 180813
%define version 7.0NG.726
%define release 180817
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.725
%define release 180813
%define version 7.0NG.726
%define release 180817
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.725
# Version 7.0NG.726
# 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

View File

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

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.725(Build 180813)")
#define PANDORA_VERSION ("7.0NG.726(Build 180817)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.725(Build 180813))"
VALUE "ProductVersion", "(7.0NG.726(Build 180817))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.725-180813
Version: 7.0NG.726-180817
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -57,9 +57,11 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` (
-- Rename column is_secondary to no_hierarchy in `tusuario _perfil`
-- ---------------------------------------------------------------------
ALTER TABLE `tusuario_perfil` ADD COLUMN `no_hierarchy` tinyint(1) NOT NULL DEFAULT 0;
UPDATE `tusuario_perfil` SET `is_secondary` = `no_hierarchy`;
UPDATE `tusuario_perfil` SET `no_hierarchy` = `is_secondary`;
ALTER TABLE `tusuario_perfil` DROP COLUMN `is_secondary`;
UPDATE `talert_commands` SET name='Monitoring Event' WHERE name='Pandora FMS Event';
-- -----------------------------------------------------
-- Table `tgis_map_layer_groups`
-- -----------------------------------------------------

View File

@ -138,6 +138,7 @@ function execution_time(){
return "<a class= 'content' style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The execution time is correct. For a more extensive information of this data consult the Execution Time graph</a>";
}
function get_logs_size($file){
$file_name = '/var'. $file .'';
$size_server_log = filesize($file_name);
@ -149,9 +150,9 @@ function get_status_logs($path){
$status_server_log = "";
$size_server_log = get_logs_size($path);
if ($size_server_log <= 10240){
$status_server_log = "<a class= 'content' style ='color: green;'>Normal Status</a><a>&nbsp&nbsp You have less than 10 MB of logs</a>";
$status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have less than 10 MB of logs</a>";
}else{
$status_server_log = "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp You have more than 10 MB of logs</a>";
$status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have more than 10 MB of logs</a>";
}
return $status_server_log;
}
@ -161,9 +162,9 @@ function percentage_modules_per_agent(){
$total_modules = db_get_value_sql ('SELECT count(*) FROM tagente_modulo');
$average_modules_per_agent = $total_modules / $total_agents;
if($average_modules_per_agent <= 40){
$status_average_modules = "<a class= 'content' style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The average of modules per agent is less than 40 percent</a>";
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The average of modules per agent is less than 40 percent</a>";
}else{
$status_average_modules = "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbspThe average of modules per agent is more than 40 percent. You can have performance problems</a>";
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbspThe average of modules per agent is more than 40 percent. You can have performance problems</a>";
}
return $status_average_modules;
}
@ -174,9 +175,9 @@ function license_capacity(){
$status_license_capacity = "";
$current_count = db_get_value_sql ('SELECT count(*) FROM tagente');
if ($current_count > $license_limit * 90 /100){
$status_license_capacity = "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The license capacity is more than 90 percent</a>";
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is more than 90 percent</a>";
}else{
$status_license_capacity = "<a class= 'content' style= 'color: green;'>Normal Status</a><a>&nbsp&nbsp The license capacity is less than 90 percent</a>";
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is less than 90 percent</a>";
}
return $status_license_capacity;
}
@ -195,12 +196,12 @@ function interval_average_of_network_modules(){
$average_time= (int) $total_module_interval_time / $total_network_modules;
if($average_time < 180 ){
$status_average_modules = "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The system has a lot of load and a very fine configuration is required</a>";
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has a lot of load and a very fine configuration is required</a>";
}else{
$status_average_modules = "<a class= 'content' style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The system has an acceptable charge</a>";
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has an acceptable charge</a>";
}
if ($average_time == 0)
$status_average_modules = "<a class= 'content' style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The system has no load</a>";
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has no load</a>";
return $status_average_modules;
}
@ -208,9 +209,9 @@ $attachment_total_files = count(glob($config['homedir']."/attachment/{*.*}",GLOB
function files_attachment_folder($total_files){
if($total_files <= 700){
$status_total_files = "<a class= 'content' style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The attachment folder has less than 700 files.</a>";
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has less than 700 files.</a>";
}else{
$status_total_files = "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The attachment folder has more than 700 files.</a>";
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has more than 700 files.</a>";
}
return $status_total_files;
}
@ -218,14 +219,21 @@ function files_attachment_folder($total_files){
$tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
function status_tagente_datos($tagente_datos_size){
if ($tagente_datos_size <=3000){
$tagente_datos_size = "<a class= 'content' style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The tagente_datos table has less than 3000 data.</a>";
if ($tagente_datos_size <=3000000){
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The tagente_datos table has an acceptable amount of data.</a>";
}else{
$tagente_datos_size = "<a class= 'content' style ='color: red;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table has more than 3000 data. A historical database is recommended.</a>";
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table has too much data. A historical database is recommended.</a>";
}
return $tagente_datos_size;
}
function status_values($val_rec, $val){
if ($val_rec <= $val)
return $val . "<a> (current value)</a><a style ='color: green;text-decoration: none;'> Normal Status</a>";
else
return $val . "<a> (current value)</a><a class= 'content' style ='color: red;text-decoration: none;'> Warning Status</a>";
}
$tables_fragmentation=db_get_sql ("SELECT (data_free/(index_length+data_length))
as frag_ratio from information_schema.tables where DATA_FREE > 0 and table_name='tagente_datos' and table_schema='pandora'");
$db_size=db_get_all_rows_sql("SELECT table_schema,
@ -245,28 +253,30 @@ $path_console_logs ="/www/html/pandora_console/pandora_console.log";
$innodb_log_file_size_min_rec_value = "64M";
$innodb_log_buffer_size_min_rec_value = "16M";
$innodb_flush_log_at_trx_commit_min_rec_value = 0;
$query_cache_limit_min_rec_value = "2M";
$max_allowed_packet_min_rec_value = "32M";
$sort_buffer_size_min_rec_value = "32K";
$join_buffer_size_min_rec_value = "265K";
$query_cache_limit_min_rec_value = 2;
$max_allowed_packet_min_rec_value = 32;
$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'");
$sort_buffer_size_min_rec_value = 32;
$join_buffer_size_min_rec_value = 265;
$query_cache_type_min_rec_value = "ON";
$query_cache_size_min_rec_value = "24M";
$innodb_lock_wait_timeout_max_rec_value = "120 seconds";
$query_cache_size_min_rec_value = 24;
$innodb_lock_wait_timeout_max_rec_value = 120;
$tables_fragmentation_max_rec_value = 10;
$thread_cache_size_max_rec_value = "8M";
$thread_stack_min_rec_value = "256K";
$max_connections_max_rec_value = "150";
$key_buffer_size_min_rec_value = "256K";
$read_buffer_size_min_rec_value = "32K";
$read_rnd_buffer_size_min_rec_value = "32K";
$query_cache_min_res_unit_min_rec_value = "2K";
$thread_cache_size_max_rec_value = 8;
$thread_stack_min_rec_value = 256;
$max_connections_max_rec_value = 150;
$key_buffer_size_min_rec_value = 256;
$read_buffer_size_min_rec_value = 32;
$read_rnd_buffer_size_min_rec_value = 32;
$query_cache_min_res_unit_min_rec_value = 2;
$innodb_file_per_table_min_rec_value = 0;
function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation){
$status_tables_frag = "";
if($tables_fragmentation > $tables_fragmentation_max_rec_value)
$status_tables_frag = "<a class= 'content' style ='color: red;'>Warning Status</a><a>&nbsp&nbsp The fragmentation tables is higher than recommended. You should defragment them.</a>";
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is higher than recommended. You should defragment them.</a>";
else
$status_tables_frag = "<a class= 'content' style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The fragmentation tables is correct.</a>";
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is correct.</a>";
return $status_tables_frag;
}
@ -536,29 +546,46 @@ switch ($config["dbtype"]) {
WHERE \"key\" = 'current_update'", "Current Update #");
break;
}
$innodb_log_file_size =db_get_value_sql ("SELECT @@innodb_log_file_size")/1048576;
$innodb_log_buffer_size =db_get_value_sql("SELECT @@innodb_log_buffer_size")/1048576;
$innodb_flush_log_at_trx_commit =db_get_value_sql("SELECT @@innodb_flush_log_at_trx_commit");
$max_allowed_packet =db_get_value_sql("SELECT @@max_allowed_packet")/1048576;
$innodb_buffer_pool_size = db_get_value_sql("SELECT @@innodb_buffer_pool_size")/1024;
$sort_buffer_size =number_format(db_get_value_sql("SELECT @@sort_buffer_size")/1024, 2);
$join_buffer_size =db_get_value_sql("SELECT @@join_buffer_size")/1024;
$query_cache_type =db_get_value_sql("SELECT @@query_cache_type");
$query_cache_size =db_get_value_sql("SELECT @@query_cache_size")/1048576;
$query_cache_limit =db_get_value_sql("SELECT @@query_cache_limit")/1048576;
$innodb_lock_wait_timeout =db_get_value_sql("SELECT @@innodb_lock_wait_timeout");
$thread_cache_size =db_get_value_sql("SELECT @@thread_cache_size");
$thread_stack =db_get_value_sql("SELECT @@thread_stack")/1024;
$max_connections =db_get_value_sql("SELECT @@max_connections");
$key_buffer_size =db_get_value_sql("SELECT @@key_buffer_size")/1024;
$read_buffer_size =db_get_value_sql("SELECT @@read_buffer_size")/1024;
$read_rnd_buffer_size =db_get_value_sql("SELECT @@read_rnd_buffer_size")/1024;
$query_cache_min_res_unit =db_get_value_sql("SELECT @@query_cache_min_res_unit")/1024;
$innodb_file_per_table = db_get_value_sql("SELECT @@innodb_file_per_table");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("MySQL Performance metrics")."</th></tr>";
render_row_2($innodb_log_file_size_min_rec_value,'InnoDB log file size (minimum recommended value)',db_get_value_sql ("SELECT @@innodb_log_file_size")/1048576 . 'M', 'InnoDB log file size (current value)');
render_row_2($innodb_log_buffer_size_min_rec_value,'InnoDB log buffer size (minimum recommended value)',db_get_value_sql("SELECT @@innodb_log_buffer_size")/1048576 . 'M', 'InnoDB log buffer size (current value)');
render_row_2($innodb_flush_log_at_trx_commit_min_rec_value,'InnoDB flush log at trx-commit (minimum recommended value)',db_get_value_sql("SELECT @@innodb_flush_log_at_trx_commit"), 'InnoDB flush log at trx-commit (current value)');
render_row_2($max_allowed_packet_min_rec_value,'Maximun allowed packet',db_get_value_sql("SELECT @@max_allowed_packet")/1048576 . 'M', 'Maximun allowed packet (current value)');
render_row_2($innodb_buffer_pool_size_min_rec_value . 'M','InnoDB buffer pool size (minimum recommended value)',db_get_value_sql("SELECT @@innodb_buffer_pool_size")/1024 . 'M', 'InnoDB buffer pool size (current value)');
render_row_2($sort_buffer_size_min_rec_value,'Sort buffer size (minimum recommended value)',number_format(db_get_value_sql("SELECT @@sort_buffer_size")/1024, 2) . 'K', 'Sort buffer size (current value)');
render_row_2($join_buffer_size_min_rec_value,'Join buffer size (minimum recommended value)',db_get_value_sql("SELECT @@join_buffer_size")/1024 . 'K', 'Join buffer size (current value)');
render_row_2($query_cache_type_min_rec_value,'Query cache type (recommended value)',db_get_value_sql("SELECT @@query_cache_type"), 'Query cache type (current value)');
render_row_2($query_cache_size_min_rec_value,'Query cache size (minimum recommended value)',db_get_value_sql("SELECT @@query_cache_size")/1048576 . 'M', 'Query cache size (current value)');
render_row_2($query_cache_limit_min_rec_value,'Query cache limit (minimum recommended value)',db_get_value_sql("SELECT @@query_cache_limit")/1048576 . 'M', 'Query cache limit (current value)');
render_row_2($innodb_lock_wait_timeout_max_rec_value ,'InnoDB lock wait timeout (maximum recommended value)',db_get_value_sql("SELECT @@innodb_lock_wait_timeout") . ' seconds', 'InnoDB lock wait timeout (current value)');
render_row_2($thread_cache_size_max_rec_value ,'Thread cache size (maximum recommended value)',db_get_value_sql("SELECT @@thread_cache_size") . 'M', 'Thread cache size (current value)');
render_row_2($thread_stack_min_rec_value ,'Thread stack (minimum recommended value)',db_get_value_sql("SELECT @@thread_stack")/1024 . 'K', 'Thread stack (current value)');
render_row_2($max_connections_max_rec_value ,'Maximun connections (maximum recommended value)',db_get_value_sql("SELECT @@max_connections"), 'Maximum connections (current value)');
render_row_2($key_buffer_size_min_rec_value ,'Key buffer size (minimum recommended value)',db_get_value_sql("SELECT @@key_buffer_size")/1024 . 'K', 'Key buffer size (current value)');
render_row_2($read_buffer_size_min_rec_value ,'Read buffer size (minimum recommended value)',db_get_value_sql("SELECT @@read_buffer_size")/1024 . 'K', 'Read buffer size (current value)');
render_row_2($read_rnd_buffer_size_min_rec_value ,'Read rnd-buffer size (minimum recommended value)',db_get_value_sql("SELECT @@read_rnd_buffer_size")/1024 . 'K', 'Read rnd-buffer size (current value)');
render_row_2($query_cache_min_res_unit_min_rec_value ,'Query cache min-res-unit (minimum recommended value)',db_get_value_sql("SELECT @@query_cache_min_res_unit")/1024 . 'K', 'Query cache min-res-unit (current value)');
render_row(db_get_value_sql("SELECT @@innodb_file_per_table"), 'InnoDB file per table');
render_row($innodb_log_file_size.status_values($innodb_log_file_size_min_rec_value,$innodb_log_file_size),'InnoDB log file size ', 'InnoDB log file size ');
render_row($innodb_log_buffer_size.status_values($innodb_log_buffer_size_min_rec_value,$innodb_log_buffer_size),'InnoDB log buffer size ', 'InnoDB log buffer size ');
render_row($innodb_flush_log_at_trx_commit.status_values($innodb_flush_log_at_trx_commit_min_rec_value,$innodb_flush_log_at_trx_commit), 'InnoDB flush log at trx-commit ','InnoDB flush log at trx-commit ');
render_row($max_allowed_packet.status_values($max_allowed_packet_min_rec_value,$max_allowed_packet), 'Maximun allowed packet ','Maximun allowed packet ');
render_row($innodb_buffer_pool_size .status_values($innodb_buffer_pool_size_min_rec_value,$innodb_buffer_pool_size), 'InnoDB buffer pool size ','InnoDB buffer pool size ');
render_row($sort_buffer_size.status_values($sort_buffer_size_min_rec_value,$sort_buffer_size), 'Sort buffer size ','Sort buffer size ');
render_row($join_buffer_size.status_values($join_buffer_size_min_rec_value,$join_buffer_size), 'Join buffer size ','Join buffer size ');
render_row($query_cache_type.status_values($query_cache_type_min_rec_value,$query_cache_type), 'Query cache type ', 'Query cache type ');
render_row($query_cache_size.status_values($query_cache_size_min_rec_value,$query_cache_size), 'Query cache size ','Query cache size ');
render_row($query_cache_limit.status_values($query_cache_limit_min_rec_value,$query_cache_limit), 'Query cache limit ','Query cache limit ');
render_row($innodb_lock_wait_timeout.status_values($innodb_lock_wait_timeout_max_rec_value,$innodb_lock_wait_timeout), 'InnoDB lock wait timeout ','InnoDB lock wait timeout ');
render_row($thread_cache_size.status_values($thread_cache_size_max_rec_value,$thread_cache_size), 'Thread cache size ','Thread cache size ');
render_row($thread_stack .status_values($thread_stack_min_rec_value,$thread_stack), 'Thread stack ','Thread stack ');
render_row($max_connections.status_values($max_connections_max_rec_value,$max_connections), 'Maximum connections ','Maximun connections ');
render_row($key_buffer_size .status_values($key_buffer_size_min_rec_value,$key_buffer_size), 'Key buffer size ','Key buffer size ');
render_row($read_buffer_size.status_values($read_buffer_size_min_rec_value,$read_buffer_size), 'Read buffer size ','Read buffer size ');
render_row($read_rnd_buffer_size.status_values($read_rnd_buffer_size_min_rec_value,$read_rnd_buffer_size), 'Read rnd-buffer size ','Read rnd-buffer size ');
render_row($query_cache_min_res_unit.status_values($query_cache_min_res_unit_min_rec_value,$query_cache_min_res_unit), 'Query cache min-res-unit ','Query cache min-res-unit ');
render_row($innodb_file_per_table.status_values($innodb_file_per_table_min_rec_value,$innodb_file_per_table), 'InnoDB file per table ','InnoDB file per table ');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Tables fragmentation in the PandoraFMS database")."</th></tr>";
@ -628,7 +655,7 @@ $agent_id= db_get_value_sql ("SELECT id_agente FROM tagente WHERE nombre = '$ser
'agent_module_id' => $id_module['id_agente_modulo'],
'period' => SECONDS_1MONTH,
'date' => time() ,
'height' => '200'
'height' => '150'
);
render_row(grafico_modulo_sparse ($params),"Graph of the " . $id_module['nombre']." module.");
}

View File

@ -279,6 +279,7 @@ if (isset($groups[$grupo]) || $new_agent) {
$table->data[4][1] = html_print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true);
} else {
$table->data[4][1] = groups_get_name($grupo);
$table->data[4][1] .= html_print_input_hidden('grupo', $grupo, true);
}
$table->data[4][1] .= ' <span id="group_preview">';
$table->data[4][1] .= ui_print_group_icon ($grupo, true);

View File

@ -800,10 +800,9 @@ if ($update_agent) { // if modified some agent paramenter
ui_print_error_message(__('No agent alias specified'));
//If there is an agent with the same name, but a different ID
}
/*elseif (agents_get_agent_id ($nombre_agente) > 0 &&
agents_get_agent_id ($nombre_agente) != $id_agente) {
ui_print_error_message(__('There is already an agent in the database with this name'));
}*/
if ($grupo <= 0) {
ui_print_error_message(__('The group id %d is incorrect.', $grupo));
}
else {
//If different IP is specified than previous, add the IP
if ($direccion_agente != '' &&
@ -987,16 +986,16 @@ $edit_module = (bool) get_parameter ('edit_module');
// GET DATA for MODULE UPDATE OR MODULE INSERT
if ($update_module || $create_module) {
$id_grupo = agents_get_agent_group ($id_agente);
$all_groups = agents_get_all_groups_agent ($id_agente, $id_grupo);
$id_agent_module = (int) get_parameter ('id_agent_module');
if (!check_acl ($config["id_user"], $id_grupo, "AW")) {
if (! check_acl_one_of_groups ($config["id_user"], $all_groups, "AW")) {
db_pandora_audit("ACL Violation",
"Trying to create a module without admin rights");
require ("general/noaccess.php");
exit;
}
$id_agent_module = (int) get_parameter ('id_agent_module');
$id_module_type = (int) get_parameter ('id_module_type');
$name = (string) get_parameter ('name');
$description = (string) get_parameter ('description');

View File

@ -656,7 +656,7 @@ foreach ($modules as $module) {
"alt" => "")) . "&nbsp;";
}
if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
if (check_acl_one_of_groups ($config["id_user"], $all_groups, "AW")) {
$data[0] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $id_agente . '&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].'">';
}
@ -668,7 +668,7 @@ foreach ($modules as $module) {
$data[0] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[&hellip;]', 'font-size: 7.2pt');
}
if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
if (check_acl_one_of_groups ($config["id_user"], $all_groups, "AW")) {
$data[0] .= '</a>';
}

View File

@ -586,7 +586,8 @@ if($cps_module > 0){
else{
$cps_inc = 0;
if($id_agent_module){
$cps_inc = service_modules_cps($id_agent_module);
$cps_inc = enterprise_hook('service_modules_cps', array($id_agent_module));
if ($cps_inc === ENTERPRISE_NOT_HOOK) $cps_inc = 0;
}
$cps_array[$cps_inc] = __('Enabled');
}

View File

@ -295,19 +295,8 @@ if ($get_module_detail) {
elseif (($config['command_snapshot'] == '0') && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
// Its a single-data, multiline data (data snapshot) ?
// Detect string data with \n and convert to <br>'s
$datos = $row[$attr[0]];
$datos = preg_replace ('/</', '&lt;', $datos);
$datos = preg_replace ('/>/', '&gt;', $datos);
$datos = preg_replace ('/\n/i','<br>',$datos);
$datos = preg_replace ('/\s/i','&nbsp;',$datos);
$datos_format = "<div id='result_div' style='width: 100%; height: 100%; overflow: scroll; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left'>";
$datos_format .= $datos;
$datos_format .= "</div>";
// I dont why, but using index (value) method, data is automatically converted to html entities ¿?
$data[] = $datos_format;
$data[] = html_print_result_div($row[$attr[0]]);
}
elseif ($is_web_content_string) {
//Fixed the goliat sends the strings from web
@ -315,11 +304,9 @@ if ($get_module_detail) {
$data[] = io_safe_input($row[$attr[0]]);
}
else {
// Just a string of alphanumerical data... just do print
//Fixed the data from Selenium Plugin
if ($row[$attr[0]] != strip_tags($row[$attr[0]])) {
$data[] = io_safe_input($row[$attr[0]]);
$data[] = html_print_result_div($row[$attr[0]]);
}
else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) {
switch($row['module_type']) {
@ -334,7 +321,6 @@ if ($get_module_detail) {
}else{
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
}
break;
default:
$data_macro = modules_get_unit_macro($row[$attr[0]],$unit);
@ -355,15 +341,7 @@ if ($get_module_detail) {
if($data_macro){
$data[] = $data_macro;
} else {
$datos = $row[$attr[0]];
$datos = preg_replace ('/</', '&lt;', $datos);
$datos = preg_replace ('/>/', '&gt;', $datos);
$datos = preg_replace ('/\n/i','<br>',$datos);
$datos = preg_replace ('/\s/i','&nbsp;',$datos);
$datos_format = "<div id='result_div' style='width: 100%; height: 100%; overflow: scroll; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left'>";
$datos_format .= $datos;
$datos_format .= "</div>";
$data[] = $datos_format;
$data[] = html_print_result_div($row[$attr[0]]);
}
}
}

View File

@ -1046,16 +1046,20 @@ class Tree {
// Modules SQL
if ($item_for_count === false) {
//FIXME This group ACL should be the same in all modules view
$group_acl = " AND (ta.id_grupo IN ($user_groups_str) OR tasg.id_group IN ($user_groups_str))";
$sql = "SELECT $columns
FROM tagente_modulo tam
INNER JOIN tagente ta
ON ta.disabled = 0
AND tam.id_agente = ta.id_agente
$group_acl
LEFT JOIN tagent_secondary_group tasg
ON tasg.id_agent = ta.id_agente
$agent_search_filter
$agent_status_filter
$module_status_join
WHERE tam.disabled = 0
$group_acl
$module_search_filter
GROUP BY tam.nombre
ORDER BY $order_fields";
@ -1634,20 +1638,15 @@ class Tree {
// Link to the Module graph
// ACL
$group_id = (int) modules_get_agent_group($module['id']);
$all_groups = modules_get_agent_groups($module['id']);
$acl_graphs = false;
$module["showGraphs"] = 0;
// Avoid the check on the metaconsole. Too slow to show/hide an icon depending on the permissions
if (!empty($group_id) && !is_metaconsole()) {
if ($this->strictACL) {
$acl_graphs = tags_check_acl_by_module($module['id'], $config['id_user'], 'RR') === true;
}
else {
$acl_graphs = check_acl($config['id_user'], $group_id, "RR");
}
$acl_graphs = check_acl_one_of_groups($config['id_user'], $all_groups, "RR");
}
else if (!empty($group_id)) {
else if (!empty($all_groups)) {
$acl_graphs = true;
}
@ -1685,7 +1684,8 @@ class Tree {
$module['snapshot'] = ui_get_snapshot_link(array(
'id_module' => $module['id'],
'interval' => $module['current_interval'],
'module_name' => $module['name']
'module_name' => $module['name'],
'id_node' => $module['serverID'] ? $module['serverID'] : 0,
), true);
}

View File

@ -22,8 +22,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC180813';
$pandora_version = 'v7.0NG.725';
$build_version = 'PC180817';
$pandora_version = 'v7.0NG.726';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();

View File

@ -145,9 +145,10 @@ function events_get_events_grouped($sql_post, $offset = 0,
switch ($config["dbtype"]) {
case "mysql":
db_process_sql ('SET group_concat_max_len = 9999999');
$event_lj = events_get_secondary_groups_left_join($table);
if ($total) {
$sql = "SELECT COUNT(*) FROM (SELECT *
FROM $table te LEFT JOIN tagent_secondary_group tasg ON te.id_agente = tasg.id_agent
FROM $table te $event_lj
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . ") AS t";
}
@ -163,139 +164,10 @@ function events_get_events_grouped($sql_post, $offset = 0,
(SELECT criticity FROM $table WHERE id_evento = MAX(te.id_evento)) AS criticity,
(SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp,
(SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = te.id_agentmodule) AS module_name
FROM $table te LEFT JOIN tagent_secondary_group tasg ON te.id_agente = tasg.id_agent
FROM $table te $event_lj
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . "
ORDER BY ";
if (!empty($sort_field)) {
switch ($sort_field) {
case 'event_id':
if ($order=='up')
$sql .= "id_evento" . " ASC";
if ($order=='down')
$sql .= "id_evento" . " DESC";
break;
case 'event_name':
if ($order=='up')
$sql .= "evento" . " ASC";
if ($order=='down')
$sql .= "evento" . " DESC";
break;
case 'event_id':
if ($order=='up')
$sql .= "id_evento" . " ASC";
if ($order=='down')
$sql .= "id_evento" . " DESC";
break;
case 'status':
if ($order=='up')
$sql .= "estado" . " ASC";
if ($order=='down')
$sql .= "estado" . " DESC";
break;
case 'agent_id':
if ($order=='up')
$sql .= "id_agente" . " ASC";
if ($order=='down')
$sql .= "id_agente" . " DESC";
break;
case 'timestamp':
if ($order=='up')
$sql .= "timestamp_rep" . " ASC";
if ($order=='down')
$sql .= "timestamp_rep" . " DESC";
break;
case 'user_id':
if ($order=='up')
$sql .= "id_usuario" . " ASC";
if ($order=='down')
$sql .= "id_usuario" . " DESC";
break;
case 'owner':
if ($order=='up')
$sql .= "owner_user" . " ASC";
if ($order=='down')
$sql .= "owner_user" . " DESC";
break;
case 'group_id':
if ($order=='up')
$sql .= "id_grupo" . " ASC";
if ($order=='down')
$sql .= "id_grupo" . " DESC";
break;
case 'module_name':
if ($order=='up')
$sql .= "module_name" . " ASC";
if ($order=='down')
$sql .= "module_name" . " DESC";
break;
case 'event_type':
if ($order=='up')
$sql .= "event_type" . " ASC";
if ($order=='down')
$sql .= "event_type" . " DESC";
break;
case 'alert_id':
if ($order=='up')
$sql .= "id_alert_am" . " ASC";
if ($order=='down')
$sql .= "id_alert_am" . " DESC";
break;
case 'criticity':
if ($order=='up')
$sql .= "criticity" . " ASC";
if ($order=='down')
$sql .= "criticity" . " DESC";
break;
case 'comment':
if ($order=='up')
$sql .= "user_comment" . " ASC";
if ($order=='down')
$sql .= "user_comment" . " DESC";
break;
case 'tags':
if ($order=='up')
$sql .= "tags" . " ASC";
if ($order=='down')
$sql .= "tags" . " DESC";
break;
case 'source':
if ($order=='up')
$sql .= "source" . " ASC";
if ($order=='down')
$sql .= "source" . " DESC";
break;
case 'extra_id':
if ($order=='up')
$sql .= "id_extra" . " ASC";
if ($order=='down')
$sql .= "id_extra" . " DESC";
break;
case 'ack_timestamp':
if ($order=='up')
$sql .= "ack_utimestamp" . " ASC";
if ($order=='down')
$sql .= "ack_utimestamp" . " DESC";
break;
case 'data':
if ($order=='up')
$sql .= "data" . " ASC";
if ($order=='down')
$sql .= "data" . " DESC";
break;
case 'module_status':
if ($order=='up')
$sql .= "module_status" . " ASC";
if ($order=='down')
$sql .= "module_status" . " DESC";
break;
default:
$sql .= "timestamp_rep" . " DESC";
}
}
GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra;
$sql .= " " . events_get_sql_order($sort_field, $order, 2);
$sql .= " LIMIT " . $offset . "," . $pagination;
}
@ -3452,13 +3324,13 @@ function events_get_events_grouped_by_agent($sql_post, $offset = 0,
$fields_extra = '';
}
$event_lj = events_get_secondary_groups_left_join($table);
if ($total) {
$sql = "SELECT COUNT(*) FROM (select id_agente from $table WHERE 1=1
$sql = "SELECT COUNT(*) FROM (select id_agente from $table $event_lj WHERE 1=1
$sql_post GROUP BY id_agente, event_type$groupby_extra ORDER BY id_agente ) AS t";
}
else {
$sql = "select id_agente, count(*) as total$fields_extra from $table te LEFT JOIN tagent_secondary_group tasg
ON te.id_agente = tasg.id_agent
$sql = "select id_agente, count(*) as total$fields_extra from $table te $event_lj
WHERE id_agente > 0 $sql_post GROUP BY id_agente$groupby_extra ORDER BY id_agente LIMIT $offset,$pagination";
}
@ -3472,7 +3344,7 @@ function events_get_events_grouped_by_agent($sql_post, $offset = 0,
foreach ($events as $event) {
if ($meta) {
$sql = "select event_type from $table
$sql = "select event_type from $table te $event_lj
WHERE agent_name = '".$event['agent_name']."' $sql_post ORDER BY utimestamp DESC ";
$resultado = db_get_row_sql($sql);
@ -3483,9 +3355,7 @@ function events_get_events_grouped_by_agent($sql_post, $offset = 0,
'event_type' => $resultado['event_type']);
}
else {
$sql = "SELECT event_type FROM $table te
LEFT JOIN tagent_secondary_group tasg
ON te.id_agente = tasg.id_agent
$sql = "SELECT event_type FROM $table te $event_lj
WHERE id_agente = ".$event['id_agente']." $sql_post ORDER BY utimestamp DESC ";
$resultado = db_get_row_sql($sql);
@ -4328,7 +4198,62 @@ function events_list_events_grouped_agents($sql) {
return html_print_table($table,true);
}
function events_get_sql_order($sort_field = "timestamp", $sort = "DESC", $group_rep = 0) {
$sort_field_translated = $sort_field;
switch ($sort_field) {
case 'event_id':
$sort_field_translated = "id_evento";
break;
case 'event_name':
$sort_field_translated = "evento";
break;
case 'status':
$sort_field_translated = "estado";
break;
case 'agent_id':
$sort_field_translated = "id_agente";
break;
case 'timestamp':
$sort_field_translated = ($group_rep == 0) ? "timestamp" : "timestamp_rep";
break;
case 'user_id':
$sort_field_translated = "id_usuario";
break;
case 'owner':
$sort_field_translated = "owner_user";
break;
case 'group_id':
$sort_field_translated = "id_grupo";
break;
case 'alert_id':
$sort_field_translated = "id_alert_am";
break;
case 'comment':
$sort_field_translated = "user_comment";
break;
case 'extra_id':
$sort_field_translated = "id_extra";
break;
}
$dir = ($sort == "up") ? "ASC" : "DESC";
return "ORDER BY $sort_field_translated $dir";
}
/**
* SQL left join of event queries to handle secondary groups
*
* @param string Table to see if is metaconsole or not
*
* @return string With the query.
*/
function events_get_secondary_groups_left_join($table) {
if ($table == 'tevento') {
return "LEFT JOIN tagent_secondary_group tasg ON te.id_agente = tasg.id_agent";
}
return "LEFT JOIN tmetaconsole_agent_secondary_group tasg
ON te.id_agente = tasg.id_tagente AND te.server_id = tasg.id_tmetaconsole_setup";
}
?>

View File

@ -2458,4 +2458,50 @@ function html_print_timezone_select ($name, $selected = "") {
return html_print_select($timezones, $name, $selected, "", __("None"), "", true, false, false);
}
/**
* Enclose a text into a result_div
*
* @param string Text to enclose
*
* @return string Text inside the result_div
*/
function html_print_result_div ($text) {
$text = preg_replace ('/</', '&lt;', $text);
$text = preg_replace ('/>/', '&gt;', $text);
$text = preg_replace ('/\n/i','<br>',$text);
$text = preg_replace ('/\s/i','&nbsp;',$text);
$enclose = "<div id='result_div' style='width: 100%; height: 100%; overflow: scroll; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left'>";
$enclose .= $text;
$enclose .= "</div>";
return $enclose;
}
/**
* Print order arrows links
*
* @param array Base tags to build url
* @param string Order key to add to URL
* @param string Value to sort ascendent
* @param string Value to sort descendent
*
* @return string HTML code to display both arrows.
*/
function html_print_sort_arrows ($params, $order_tag, $up = 'up', $down = 'down') {
// Build the queries
$params[$order_tag] = $up;
$url_up = "index.php?" . http_build_query($params, '', '&amp;');
$params[$order_tag] = $down;
$url_down = "index.php?" . http_build_query($params, '', '&amp;');
// Build the links
return '&nbsp;' .
'<a href="' . $url_up . '">' .
html_print_image("images/sort_up.png", true) .
'</a>' .
'<a href="' . $url_down . '">' .
html_print_image("images/sort_down.png", true) .
'</a>'
;
}
?>

View File

@ -780,14 +780,14 @@ function modules_get_raw_data($id_agent_module, $date_init, $date_end) {
return $data;
}
function modules_get_agent_group($id_agent_module) {
function modules_get_agent_groups($id_agent_module) {
$return = false;
$id_agent = modules_get_agentmodule_agent(
$id_agent_module);
if (!empty($id_agent)) {
$return = agents_get_agent_group($id_agent);
$return = agents_get_all_groups_agent($id_agent);
}
return $return;

View File

@ -1184,23 +1184,25 @@ function tags_get_tags_for_module_search($id_user = false, $access = 'AR') {
function tags_check_acl_by_module($id_module = 0, $id_user = false,
$access = 'AW') {
global $config;
$return = false;
if (!empty($id_module)) {
$tags = tags_get_module_tags($id_module);
$group = modules_get_agent_group($id_module);
$groups = modules_get_agent_groups($id_module);
if ($id_user === false) {
$id_user = $config["id_user"];
}
$return = tags_check_acl($id_user, $group, $access, $tags, true);
foreach ($groups as $group) {
if (tags_check_acl($id_user, $group, $access, $tags, true)) {
return true;
}
}
}
return $return;
}
@ -2480,17 +2482,10 @@ function tags_get_all_user_agents ($id_tag = false, $id_user = false,
}
$select_fields = implode(',',$fields);
$groups_clause = "";
if ($strict_user) {
if (!empty($groups_and_tags)) {
$groups_clause = " AND ".tags_get_acl_tags_module_condition($groups_and_tags, "tagente_modulo");
}
}
else {
$groups_clause = " AND tagente.id_grupo IN (".implode(',', array_keys($groups_and_tags)).")";
}
$groups_clause = " AND tagente.id_grupo IN (".implode(',', array_keys($groups_and_tags)).")";
if (!empty($filter['id_group'])) {
if (is_array($filter['id_group']))
$groups_str = implode(",", $filter['id_group']);

View File

@ -70,8 +70,8 @@
<body>
<div style='height: 10px'>
<?php
$version = '7.0NG.725';
$build = '180813';
$version = '7.0NG.726';
$build = '180817';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -52,10 +52,6 @@ if ($id_node > 0) {
$row_module = modules_get_agentmodule($id);
$row_state = db_get_row('tagente_estado', 'id_agente_modulo', $id);
if ($id_node > 0) {
metaconsole_restore_db();
}
// Build the info
$label = get_parameter ("label", io_safe_output($row_module['module_name']));
$last_timestamp = get_parameter("timestamp", $row_state['timestamp']);

View File

@ -1036,7 +1036,8 @@ if (!empty($result)) {
$data[2] = html_print_image('images/' . modules_show_icon_type ($row['module_type']), true);
if (check_acl ($config['id_user'], $row['id_group'], 'AW')) {
$agent_groups = agents_get_all_groups_agent($row['id_agent'], $row['id_group']);
if (check_acl_one_of_groups ($config['id_user'], $agent_groups, 'AW')) {
$show_edit_icon = true;
if (defined('METACONSOLE')) {
if (!can_user_access_node ()) {

View File

@ -81,6 +81,7 @@ switch ($status) {
$events_wi_cdata = db_get_all_rows_sql('SELECT id_evento,custom_data from tevento WHERE custom_data != ""');
$count_events = 0;
$events_wi_cdata_id = 'OR id_evento IN (';
if ($events_wi_cdata === false) $events_wi_cdata = array();
foreach ($events_wi_cdata as $key => $value) {
$needle = base64_decode($value['custom_data']);
if (($needle != "") && ($search != "")) {

View File

@ -20,7 +20,6 @@ require_once ($config["homedir"] . "/include/functions_ui.php");
$sort_field = get_parameter("sort_field", "timestamp");
$sort = get_parameter("sort", "down");
$table = new stdClass();
if(!isset($table->width)) {
$table->width = '100%';
@ -34,37 +33,54 @@ if(!isset($table->class)) {
$table->head = array ();
$table->data = array ();
$params = array (
// Pandora sections
"sec" => "eventos",
"sec2" => "operation/events/events",
// Events query params
"search" => io_safe_input($search),
"severity" => $severity,
"status" => $status,
"id_group" => $id_group,
"recursion" => $recursion,
"refr" => (int)get_parameter("refr", 0),
"id_agent_module" => $id_agent_module,
"pagination" => $pagination,
"group_rep" => $group_rep,
"event_view_hr" => $event_view_hr,
"id_user_ack" => $id_user_ack,
"tag_with" => $tag_with_base64,
"tag_without" => $tag_without_base64,
"filter_only_alert" => $filter_only_alert,
"offset" => $offset,
"toogle_filter" => "no",
"filter_id" => $filter_id,
"id_name" => $id_name,
"history" => (int)$history,
"section" => $section,
"open_filter" => $open_filter,
"date_from" => $date_from,
"date_to" => $date_to,
"pure" => $config["pure"],
// Display params
"offset" => $offset,
"disabled" => $disabled,
"sort" => $sort,
"sort_field" => $sort_field
);
if ($group_rep == 2) {
$table->class = "databox filters data";
$table->head[1] = __('Agent');
$table->head[5] = __('More detail');
$params = "search=" . io_safe_input($search) .
"&amp;severity=" . $severity .
"&amp;status=" . $status .
"&amp;id_group=" . $id_group .
"&amp;recursion=" . $recursion .
"&amp;refr=" . (int)get_parameter("refr", 0) .
"&amp;id_agent_module=" . $id_agent_module .
"&amp;pagination=" . $pagination .
"&amp;group_rep=2" .
"&amp;event_view_hr=" . $event_view_hr .
"&amp;id_user_ack=" . $id_user_ack .
"&amp;tag_with=". $tag_with_base64 .
"&amp;tag_without=" . $tag_without_base64 .
"&amp;filter_only_alert" . $filter_only_alert .
"&amp;offset=" . $offset .
"&amp;toogle_filter=no" .
"&amp;filter_id=" . $filter_id .
"&amp;id_name=" . $id_name .
"&amp;history=" . (int)$history .
"&amp;section=" . $section .
"&amp;open_filter=" . $open_filter .
"&amp;date_from=" . $date_from .
"&amp;date_to=" . $date_to .
"&amp;pure=" . $config["pure"];
$url = "index.php?sec=eventos&amp;sec2=operation/events/events&amp;" . $params;
$url = html_print_sort_arrows(
array_merge($params, array('sort_field' => 'status')),
'sort'
);
foreach ($result as $key => $res) {
if ($res['event_type'] == 'alert_fired') {
@ -122,7 +138,6 @@ if ($group_rep == 2) {
}
}
else {
//fields that the user has selected to show
if ($meta) {
$show_fields = events_meta_get_custom_fields_user();
@ -133,7 +148,10 @@ else {
//headers
$i = 0;
$table->head[$i] = __('ID') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=event_id&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=event_id&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('ID') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'event_id')),
'sort'
);
$table->align[$i] = 'left';
@ -144,104 +162,154 @@ else {
$i++;
}
if (in_array('estado', $show_fields)) {
$table->head[$i] = __('Status') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=status&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=status&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Status') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'status')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('id_evento', $show_fields)) {
$table->head[$i] = __('Event ID') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=event_id&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=event_id&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Event ID') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'event_id')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('evento', $show_fields)) {
$table->head[$i] = __('Event Name') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=event_name&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=event_name&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Event Name') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'event_name')),
'sort'
);
$table->align[$i] = 'left';
$table->style[$i] = 'min-width: 200px; max-width: 350px; word-break: break-all;';
$i++;
}
if (in_array('id_agente', $show_fields)) {
$table->head[$i] = __('Agent name') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=agent_id&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=agent_id&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Agent name') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'agent_id')),
'sort'
);
$table->align[$i] = 'left';
$table->style[$i] = 'max-width: 350px; word-break: break-all;';
$i++;
}
if (in_array('timestamp', $show_fields)) {
$table->head[$i] = __('Timestamp') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=timestamp&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=timestamp&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Timestamp') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'timestamp')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('id_usuario', $show_fields)) {
$table->head[$i] = __('User') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=user_id&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=user_id&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('User') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'user_id')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('owner_user', $show_fields)) {
$table->head[$i] = __('Owner') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=owner&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=owner&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Owner') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'owner')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('id_grupo', $show_fields)) {
$table->head[$i] = __('Group') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=group_id&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=group_id&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Group') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'group_id')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('event_type', $show_fields)) {
$table->head[$i] = __('Event Type') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=event_type&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=event_type&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Event Type') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'event_type')),
'sort'
);
$table->align[$i] = 'left';
$table->style[$i] = 'min-width: 85px;';
$i++;
}
if (in_array('id_agentmodule', $show_fields)) {
$table->head[$i] = __('Module Name') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=module_name&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=module_name&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Module Name') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'module_name')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('id_alert_am', $show_fields)) {
$table->head[$i] = __('Alert') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=alert_id&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=alert_id&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Alert') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'alert_id')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('criticity', $show_fields)) {
$table->head[$i] = __('Severity') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=criticity&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=criticity&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Severity') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'criticity')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('user_comment', $show_fields)) {
$table->head[$i] = __('Comment') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=comment&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=comment&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Comment') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'comment')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('tags', $show_fields)) {
$table->head[$i] = __('Tags') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=tags&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=tags&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Tags') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'tags')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('source', $show_fields)) {
$table->head[$i] = __('Source') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=source&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=source&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->align[$i] = 'left';
$table->head[$i] = __('Source') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'source')),
'sort'
);$table->align[$i] = 'left';
$i++;
}
if (in_array('id_extra', $show_fields)) {
$table->head[$i] = __('Extra ID') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=extra_id&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=extra_id&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Extra ID') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'extra_id')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('ack_utimestamp', $show_fields)) {
$table->head[$i] = __('ACK Timestamp') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=ack_timestamp&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=ack_utimestamp&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('ACK Timestamp') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'ack_utimestamp')),
'sort'
);
$table->align[$i] = 'left';
$i++;
@ -253,14 +321,19 @@ else {
$i++;
}
if (in_array('data', $show_fields)) {
$table->head[$i] = __('Data') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=data&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=data&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
$table->head[$i] = __('Data') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'data')),
'sort'
);
$table->align[$i] = 'left';
$i++;
}
if (in_array('module_status', $show_fields)) {
$table->head[$i] = __('Module Status') . ' ' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=module_status&sort=up&disabled='.$disabled.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' . '<a href="index.php?sec=eventos&sec2=operation/events/events&offset='.$offset.'&sort_field=module_status&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';;
$table->align[$i] = 'left';
$table->head[$i] = __('Module Status') . html_print_sort_arrows(
array_merge($params, array('sort_field' => 'module_status')),
'sort'
);$table->align[$i] = 'left';
$i++;
}
@ -772,7 +845,10 @@ else {
if (!empty ($table->data)) {
if ($allow_pagination) {
ui_pagination ($total_events, "index.php?sec=eventos&sec2=operation/events/events&sort_field=$sort_field&sort=$sort&disabled=$disabled", $offset, $pagination);
$params_to_paginate = $params;
unset($params_to_paginate['offset']);
$url_paginate = "index.php?" . http_build_query($params_to_paginate, '', '&amp;');
ui_pagination ($total_events, $url_paginate, $offset, $pagination);
}
if ($allow_action) {
@ -790,7 +866,6 @@ else {
if ($allow_action) {
echo '<div style="width:' . $table->width . ';" class="action-buttons">';
//~ if (!$readonly && tags_check_acl ($config["id_user"], 0, "EW", $event['clean_tags']) == 1) {
if (!$readonly && $show_validate_button) {
html_print_button(__('In progress selected'), 'validate_button', false, 'validate_selected(2);', 'class="sub ok"');
echo " ";
@ -808,7 +883,6 @@ else {
</script>
<?php
}
//~ if (!$readonly && tags_check_acl ($config["id_user"], 0,"EM", $event['clean_tags']) == 1) {
if (!$readonly && ($show_delete_button)) {
html_print_button(__('Delete selected'), 'delete_button', false, 'delete_selected();', 'class="sub delete"');
?>

View File

@ -29,7 +29,6 @@ enterprise_include_once('include/functions_events.php');
check_login ();
$sort_field = get_parameter("sort_field", "timestamp");
$sort_order = get_parameter("sort", "down");
$event_a = check_acl ($config['id_user'], 0, "ER");
@ -741,13 +740,15 @@ echo "</div>";
<?php
$event_table = events_get_events_table($meta, $history);
$event_lj = events_get_secondary_groups_left_join($event_table);
if ($group_rep == 0) {
$sql = "SELECT DISTINCT te.*, 1 event_rep
FROM $event_table te LEFT JOIN tagent_secondary_group tasg
ON te.id_agente = tasg.id_agent
$order_sql = events_get_sql_order($sort_field, $sort_order, $group_rep);
$sql = "SELECT DISTINCT te.*, 1 event_rep,
(SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = te.id_agentmodule) AS module_name
FROM $event_table te $event_lj
WHERE 1=1 " . $sql_post . "
ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination;
$order_sql LIMIT ".$offset.",".$pagination;
//Extract the events by filter (or not) from db
$result = db_get_all_rows_sql ($sql);
@ -815,8 +816,7 @@ if (($config['dbtype'] == 'oracle') && ($result !== false)) {
if ($group_rep == 0) {
$sql = "SELECT COUNT(DISTINCT id_evento)
FROM $event_table te
LEFT JOIN tagent_secondary_group tasg
ON te.id_agente = tasg.id_agent
$event_lj
WHERE 1=1 $sql_post";
$total_events = (int) db_get_sql ($sql);
}
@ -826,8 +826,7 @@ elseif ($group_rep == 1) {
}
elseif ($group_rep == 2) {
$sql = "SELECT COUNT(*) FROM (select id_agente as total from $event_table te
LEFT JOIN tagent_secondary_group tasg
ON te.id_grupo = tasg.id_group
$event_lj
WHERE id_agente > 0
$sql_post GROUP BY id_agente ORDER BY id_agente ) AS t";
$total_events = (int) db_get_sql ($sql);

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.725
%define release 180813
%define version 7.0NG.726
%define release 180817
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.725
%define release 180813
%define version 7.0NG.726
%define release 180817
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.725"
PI_VERSION="7.0NG.726"
FORCE=0
DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.725-180813
Version: 7.0NG.726-180817
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.725-180813"
pandora_version="7.0NG.726-180817"
package_cpan=0
package_pandora=1

View File

@ -111,10 +111,10 @@ sub pandora_startup () {
start_server_thread(\&pandora_process_policy_queue, [\%Config]) if ($Config{'__enterprise_enabled'} == 1 && $Config{'policy_manager'} == 1);
# Start the event replication thread. Do not start with start_server_thread, this thread may exit on its own.
threads->create(\&pandora_process_event_replication, [\%Config]) if($Config{'__enterprise_enabled'} == 1 && $Config{'event_replication'} == 1);
threads->create(\&pandora_process_event_replication, \%Config) if($Config{'__enterprise_enabled'} == 1 && $Config{'event_replication'} == 1);
# Update the agent cache. Do not start with start_server_thread, this thread updates the agent cache and exits.
threads->create(\&enterprise_hook, ['update_agent_cache', [\%Config]])->detach() if ($Config{'node_metaconsole'} == 1);
threads->create(\&enterprise_hook, 'update_agent_cache', [\%Config])->detach() if ($Config{'node_metaconsole'} == 1);
pandora_audit (\%Config, $Config{'rb_product_name'} . ' Server Daemon starting', 'SYSTEM', 'System', $DBH);

View File

@ -1,7 +1,7 @@
#############################################################################
# Pandora FMS Server Parameters
# Pandora FMS, the Flexible Monitoring System.
# Version 7.0NG.725
# Version 7.0NG.726
# Licensed under GPL license v2,
# (c) 2003-2017 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -44,8 +44,8 @@ our @EXPORT = qw(
);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.725";
my $pandora_build = "180813";
my $pandora_version = "7.0NG.726";
my $pandora_build = "180817";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -31,8 +31,8 @@ use base 'Exporter';
our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.725";
my $pandora_build = "180813";
my $pandora_version = "7.0NG.726";
my $pandora_build = "180817";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -1278,16 +1278,16 @@ sub month_have_days($$) {
if ( $year <= 1752 ) {
# Note: Although September 1752 only had 19 days,
# they were numbered 1,2,14..30!
if (1752 == $year && 9 == $month) {
if (1752 == $year && 8 == $month) {
return 19;
}
if (2 == $month && 0 == $year % 4) {
if (1 == $month && 0 == $year % 4) {
return 29;
}
}
else {
#Check if Leap year
if (2 == $month && 0 == $year % 4 && 0 == $year%100
if (1 == $month && 0 == $year % 4 && 0 == $year%100
|| 0 == $year%400) {
return 29;
}

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.725
%define release 180813
%define version 7.0NG.726
%define release 180817
Summary: Pandora FMS Server
Name: %{name}

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.725
%define release 180813
%define version 7.0NG.726
%define release 180817
Summary: Pandora FMS Server
Name: %{name}

View File

@ -8,8 +8,8 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.725"
PI_BUILD="180813"
PI_VERSION="7.0NG.726"
PI_BUILD="180817"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.725 PS180813";
my $version = "7.0NG.726 PS180817";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.725 PS180813";
my $version = "7.0NG.726 PS180817";
# save program name for logging
my $progname = basename($0);