Merge remote-tracking branch 'origin/develop' into ent-3178-integrar-terminal-web-en-la-consola-de-pandora-y-explorar-otras-utilidades-anyterm-replace

This commit is contained in:
fbsanchez 2019-10-28 12:59:02 +01:00
commit e12bcb2ac4
66 changed files with 3860 additions and 1740 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.739, AIX version # Version 7.0NG.740, 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.739 # Version 7.0NG.740
# 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.739, HPUX Version # Version 7.0NG.740, 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.739 # Version 7.0NG.740
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas # (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.739-191022 Version: 7.0NG.740
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.739-191022" pandora_version="7.0NG.740"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,8 +41,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.739'; use constant AGENT_VERSION => '7.0NG.740';
use constant AGENT_BUILD => '191022'; use constant AGENT_BUILD => '191028';
# 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.739 %define version 7.0NG.740
%define release 191022 %define release 1
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.739 %define version 7.0NG.740
%define release 191022 %define release 1
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.739" PI_VERSION="7.0NG.740"
PI_BUILD="191022" PI_BUILD="191028"
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-2017 Artica Soluciones Tecnologicas # (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.739 # Version 7.0NG.740
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software

View File

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

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.739(Build 191022)") #define PANDORA_VERSION ("7.0NG.740(Build 191028)")
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.739(Build 191022))" VALUE "ProductVersion", "(7.0NG.740(Build 191028))"
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.739-191022 Version: 7.0NG.740
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.739-191022" pandora_version="7.0NG.740"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -240,7 +240,7 @@ switch ($action) {
$hide_notinit_agents = $style['hide_notinit_agents']; $hide_notinit_agents = $style['hide_notinit_agents'];
$dyn_height = $style['dyn_height']; $dyn_height = $style['dyn_height'];
$type = $item['type']; $type = $item['type'];
$name = $item['name']; $name = $style['name_label'];
switch ($type) { switch ($type) {
case 'event_report_log': case 'event_report_log':

View File

@ -1,18 +1,34 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Report item list.
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas *
// Please see http://pandorafms.org for full contribution list * @category Reporting
// This program is free software; you can redistribute it and/or * @package Pandora FMS
// modify it under the terms of the GNU General Public License * @subpackage Community
// as published by the Free Software Foundation for version 2. * @version 1.0.0
// This program is distributed in the hope that it will be useful, * @license See below
// 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. * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
global $config; global $config;
// Login check // Login check.
check_login(); check_login();
if (! check_acl($config['id_user'], 0, 'RW')) { if (! check_acl($config['id_user'], 0, 'RW')) {
@ -39,12 +55,16 @@ switch ($config['dbtype']) {
'type' 'type'
); );
break; break;
default:
// Default.
break;
} }
$report_w = check_acl($config['id_user'], 0, 'RW'); $report_w = check_acl($config['id_user'], 0, 'RW');
$report_m = check_acl($config['id_user'], 0, 'RM'); $report_m = check_acl($config['id_user'], 0, 'RM');
if ($config['metaconsole'] == 1 and defined('METACONSOLE')) { if (is_metaconsole()) {
$agents = []; $agents = [];
$agents = metaconsole_get_report_agents($idReport); $agents = metaconsole_get_report_agents($idReport);
$modules = []; $modules = [];
@ -52,7 +72,7 @@ if ($config['metaconsole'] == 1 and defined('METACONSOLE')) {
$types = []; $types = [];
$types = metaconsole_get_report_types($idReport); $types = metaconsole_get_report_types($idReport);
} else { } else {
// FORM FILTER // FORM FILTER.
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
case 'postgresql': case 'postgresql':
@ -87,7 +107,10 @@ if ($config['metaconsole'] == 1 and defined('METACONSOLE')) {
ON (t4.id_agent = t5.id_agente OR t4.id_agente = t5.id_agente) ON (t4.id_agent = t5.id_agente OR t4.id_agente = t5.id_agente)
WHERE t4.id_report = '.$idReport WHERE t4.id_report = '.$idReport
); );
break;
default:
// Default.
break; break;
} }
@ -124,6 +147,10 @@ if ($config['metaconsole'] == 1 and defined('METACONSOLE')) {
WHERE t1.id_report = '.$idReport WHERE t1.id_report = '.$idReport
); );
break; break;
default:
// Default.
break;
} }
if ($rows === false) { if ($rows === false) {
@ -135,8 +162,8 @@ if ($config['metaconsole'] == 1 and defined('METACONSOLE')) {
$modules[$row['id_agent_module']] = $row['nombre']; $modules[$row['id_agent_module']] = $row['nombre'];
} }
// Filter report items created from metaconsole in normal console list and the opposite // Filter report items created from metaconsole in normal console list and the opposite.
if (defined('METACONSOLE') and $config['metaconsole'] == 1) { if (is_metaconsole()) {
$where_types = ' AND ((server_name IS NOT NULL AND length(server_name) != 0) OR '.$type_escaped.' IN (\'general\',\'SLA\',\'exception\',\'top_n\'))'; $where_types = ' AND ((server_name IS NOT NULL AND length(server_name) != 0) OR '.$type_escaped.' IN (\'general\',\'SLA\',\'exception\',\'top_n\'))';
} else { } else {
$where_types = ' AND ((server_name IS NULL OR length(server_name) = 0) OR '.$type_escaped.' IN (\'general\',\'SLA\',\'exception\',\'top_n\'))'; $where_types = ' AND ((server_name IS NULL OR length(server_name) = 0) OR '.$type_escaped.' IN (\'general\',\'SLA\',\'exception\',\'top_n\'))';
@ -184,7 +211,6 @@ if (!defined('METACONSOLE')) {
$table->data[0][1] .= html_print_select($modules, 'module_filter', $moduleFilter, '', __('All'), 0, true); $table->data[0][1] .= html_print_select($modules, 'module_filter', $moduleFilter, '', __('All'), 0, true);
$table->data[0][2] = __('Type'); $table->data[0][2] = __('Type');
$table->data[0][2] .= html_print_select($types, 'type_filter', $typeFilter, '', __('All'), 0, true); $table->data[0][2] .= html_print_select($types, 'type_filter', $typeFilter, '', __('All'), 0, true);
// $table->data[1][2] = $table->data[1][3] = '';
$form = '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report='.$idReport.'">'; $form = '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report='.$idReport.'">';
$form .= html_print_table($table, true); $form .= html_print_table($table, true);
$form .= '<div class="action-buttons" style="width: '.$table->width.'">'; $form .= '<div class="action-buttons" style="width: '.$table->width.'">';
@ -265,13 +291,6 @@ if ($moduleFilter != 0) {
$where .= ' AND id_agent_module = '.$moduleFilter; $where .= ' AND id_agent_module = '.$moduleFilter;
} }
// Filter report items created from metaconsole in normal console list and the opposite
if (defined('METACONSOLE') and $config['metaconsole'] == 1) {
$where .= ' AND ((server_name IS NOT NULL AND length(server_name) != 0) '.'OR '.$type_escaped.' IN (\'general\', \'SLA\', \'exception\', \'availability\', \'availability_graph\', \'top_n\',\'SLA_monthly\',\'SLA_weekly\',\'SLA_hourly\',\'text\'))';
} else {
$where .= ' AND ((server_name IS NULL OR length(server_name) = 0) '.'OR '.$type_escaped.' IN (\'general\', \'SLA\', \'exception\', \'availability\', \'top_n\'))';
}
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
$items = db_get_all_rows_sql( $items = db_get_all_rows_sql(
@ -306,13 +325,17 @@ switch ($config['dbtype']) {
'AND', 'AND',
false false
); );
// Delete rnum row generated by oracle_recode_query() function // Delete rnum row generated by oracle_recode_query() function.
if ($items !== false) { if ($items !== false) {
for ($i = 0; $i < count($items); $i++) { for ($i = 0; $i < count($items); $i++) {
unset($items[$i]['rnum']); unset($items[$i]['rnum']);
} }
} }
break; break;
default:
// Default.
break;
} }
$countItems = db_get_sql( $countItems = db_get_sql(
@ -421,29 +444,30 @@ foreach ($items as $item) {
$row[1] = get_report_name($item['type']); $row[1] = get_report_name($item['type']);
if ($item['type'] == 'custom_graph') {
$custom_graph_name = db_get_row_sql('select name from tgraph where id_graph = '.$item['id_gs']);
$row[1] = get_report_name($item['type']).' ('.$custom_graph_name['name'].')';
}
$server_name = $item['server_name']; $server_name = $item['server_name'];
if (($config['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) { if (is_metaconsole()) {
$connection = metaconsole_get_connection($server_name); $connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name); // ui_print_error_message ("Error connecting to ".$server_name);
} }
} }
if ($item['type'] == 'custom_graph') {
$custom_graph_name = db_get_row_sql('SELECT name FROM tgraph WHERE id_graph = '.$item['id_gs']);
$row[1] = get_report_name($item['type']).' ('.$custom_graph_name['name'].')';
}
if ($item['id_agent'] == 0) { if ($item['id_agent'] == 0) {
$is_inventory_item = $item['type'] == 'inventory' || $item['type'] == 'inventory_changes'; $is_inventory_item = $item['type'] == 'inventory' || $item['type'] == 'inventory_changes';
// Due to SLA or top N or general report items // Due to SLA or top N or general report items.
if (!$is_inventory_item && ($item['id_agent_module'] == '' || $item['id_agent_module'] == 0)) { if (!$is_inventory_item && ($item['id_agent_module'] == '' || $item['id_agent_module'] == 0)) {
$row[2] = ''; $row[2] = '';
$row[3] = ''; $row[3] = '';
} else { } else {
// The inventory items have the agents and modules in json format in the field external_source // The inventory items have the agents and modules in json format in the field external_source.
if ($is_inventory_item) { if ($is_inventory_item) {
$external_source = json_decode($item['external_source'], true); $external_source = json_decode($item['external_source'], true);
$agents = $external_source['id_agents']; $agents = $external_source['id_agents'];
@ -522,7 +546,7 @@ foreach ($items as $item) {
$table->data[] = $row; $table->data[] = $row;
$count++; $count++;
// Restore db connection // Restore db connection.
if (($config['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) { if (($config['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) {
metaconsole_restore_db(); metaconsole_restore_db();
} }

View File

@ -1,15 +1,32 @@
<?php <?php
// Pandora FMS- http://pandorafms.com /**
// ================================================== * Pandora FMS integration API.
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas *
// Please see http://pandorafms.org for full contribution list * @category API
// This program is free software; you can redistribute it and/or * @package Pandora FMS
// modify it under the terms of the GNU Lesser General Public License * @subpackage Console
// as published by the Free Software Foundation; version 2 * @version 1.0.0
// This program is distributed in the hope that it will be useful, * @license See below
// 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. * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
require_once 'config.php'; require_once 'config.php';
require_once 'functions_api.php'; require_once 'functions_api.php';
@ -18,7 +35,7 @@ global $config;
define('DEBUG', 0); define('DEBUG', 0);
define('VERBOSE', 0); define('VERBOSE', 0);
// TESTING THE UPDATE MANAGER // TESTING THE UPDATE MANAGER.
enterprise_include_once('include/functions_enterprise_api.php'); enterprise_include_once('include/functions_enterprise_api.php');
$ipOrigin = $_SERVER['REMOTE_ADDR']; $ipOrigin = $_SERVER['REMOTE_ADDR'];
@ -41,7 +58,13 @@ $info = get_parameter('info', '');
$other = parseOtherParameter($otherSerialize, $otherMode); $other = parseOtherParameter($otherSerialize, $otherMode);
$other = parseOtherParameter($otherSerialize, $otherMode); $other = parseOtherParameter($otherSerialize, $otherMode);
$apiPassword = io_output_password(db_get_value_filter('value', 'tconfig', ['token' => 'api_password'])); $apiPassword = io_output_password(
db_get_value_filter(
'value',
'tconfig',
['token' => 'api_password']
)
);
$correctLogin = false; $correctLogin = false;
$no_login_msg = ''; $no_login_msg = '';
@ -52,7 +75,7 @@ ob_clean();
// READ THIS: // READ THIS:
// Special call without checks to retrieve version and build of the Pandora FMS // Special call without checks to retrieve version and build of the Pandora FMS
// This info is avalable from the web console without login // This info is avalable from the web console without login
// Don't change the format, it is parsed by applications // Don't change the format, it is parsed by applications.
if ($info == 'version') { if ($info == 'version') {
if (!$config['MR']) { if (!$config['MR']) {
$config['MR'] = 0; $config['MR'] = 0;
@ -73,6 +96,7 @@ if (isInACL($ipOrigin)) {
if (session_status() === PHP_SESSION_NONE) { if (session_status() === PHP_SESSION_NONE) {
session_start(); session_start();
$_SESSION = [];
} }
$_SESSION['id_usuario'] = $user; $_SESSION['id_usuario'] = $user;
@ -86,7 +110,7 @@ if (isInACL($ipOrigin)) {
$no_login_msg = 'Incorrect given API password'; $no_login_msg = 'Incorrect given API password';
} }
} else { } else {
$no_login_msg = "IP $ipOrigin is not in ACL list"; $no_login_msg = 'IP '.$ipOrigin.' is not in ACL list';
} }
if ($correctLogin) { if ($correctLogin) {
@ -95,11 +119,14 @@ if ($correctLogin) {
} else { } else {
$function_name = ''; $function_name = '';
// Check if is an extension function and get the function name // Check if is an extension function and get the function name.
if ($op2 == 'extension') { if ($op2 == 'extension') {
$extension_api_url = $config['homedir'].'/'.EXTENSIONS_DIR."/$ext_name/$ext_name.api.php"; $extension_api_url = $config['homedir'].'/'.EXTENSIONS_DIR.'/'.$ext_name.'/'.$ext_name.'.api.php';
// The extension API file must exist and the extension must be enabled // The extension API file must exist and the extension must be
if (file_exists($extension_api_url) && !in_array($ext_name, extensions_get_disabled_extensions())) { // enabled.
if (file_exists($extension_api_url)
&& !in_array($ext_name, extensions_get_disabled_extensions())
) {
include_once $extension_api_url; include_once $extension_api_url;
$function_name = 'apiextension_'.$op.'_'.$ext_function; $function_name = 'apiextension_'.$op.'_'.$ext_function;
} }
@ -109,16 +136,19 @@ if ($correctLogin) {
if ($op == 'set' && $id) { if ($op == 'set' && $id) {
switch ($op2) { switch ($op2) {
case 'update_agent': case 'update_agent':
case 'add_module_in_conf': case 'add_module_in_conf':
case 'update_module_in_conf': case 'update_module_in_conf':
case 'delete_module_in_conf': case 'delete_module_in_conf':
$agent = agents_locate_agent($id);
$id_os = db_get_value_sql('select id_os from tagente where id_agente = '.$id); if ($agent !== false) {
$id_os = $agent['id_os'];
if ($id_os == 100) { if ($id_os == 100) {
returnError('not_allowed_operation_cluster', $returnType); returnError(
return false; 'not_allowed_operation_cluster',
$returnType
);
return false;
}
} }
break; break;
@ -129,12 +159,16 @@ if ($correctLogin) {
case 'create_snmp_module': case 'create_snmp_module':
case 'delete_module': case 'delete_module':
case 'delete_agent': case 'delete_agent':
$agent = agents_locate_agent($id);
$id_os = db_get_value_sql('select id_os from tagente where nombre = "'.$id.'"'); if ($agent !== false) {
$id_os = $agent['id_os'];
if ($id_os == 100) { if ($id_os == 100) {
returnError('not_allowed_operation_cluster', $returnType); returnError(
return false; 'not_allowed_operation_cluster',
$returnType
);
return false;
}
} }
break; break;
@ -143,60 +177,98 @@ if ($correctLogin) {
case 'update_data_module': case 'update_data_module':
case 'update_snmp_module': case 'update_snmp_module':
$id_os = db_get_value_sql('select id_os from tagente where id_agente = (select id_agente from tagente_modulo where id_agente_modulo ='.$id.')'); $id_os = db_get_value_sql(
sprintf(
'SELECT id_os
FROM tagente
WHERE id_agente = (
SELECT id_agente
FROM tagente_modulo
WHERE id_agente_modulo = %d
)',
$id
)
);
if ($id_os == 100) { if ($id_os == 100) {
returnError('not_allowed_operation_cluster', $returnType); returnError(
'not_allowed_operation_cluster',
$returnType
);
return false; return false;
} }
break; break;
case 'delete_user_permission': case 'delete_user_permission':
if ($user_db === '') { if ($user_db === '') {
returnError(__('User or group not specified'), __('User, group not specified')); returnError(
__('User or group not specified'),
__('User, group not specified')
);
return; return;
} }
$id_os = api_set_delete_user_profiles($thrash1, $thrash2, $other, $returnType); $id_os = api_set_delete_user_profiles(
$thrash1,
$thrash2,
$other,
$returnType
);
if ($id_os != 100) { if ($id_os != 100) {
return; return;
} }
if ($id_os == false) { if ($id_os == false) {
returnError('not_allowed_operation_cluster', $returnType); returnError(
'not_allowed_operation_cluster',
$returnType
);
return false; return false;
} }
break; break;
case 'add_permission_user_to_group': case 'add_permission_user_to_group':
if ($user_db == null
if ($user_db == null || $group_db == null || $id_up == null) { || $group_db == null
returnError(__('User, group or profile not specified'), __('User, group or profile status not specified')); || $id_up == null
) {
returnError(
__('User, group or profile not specified'),
__('User, group or profile status not specified')
);
return; return;
} }
$id_os = api_set_add_permission_user_to_group($thrash1, $thrash2, $other, $returnType); $id_os = api_set_add_permission_user_to_group(
$thrash1,
$thrash2,
$other,
$returnType
);
if ($id_os != 100) { if ($id_os != 100) {
return; return;
} }
if ($id_os == false) { if ($id_os == false) {
returnError('not_allowed_operation_cluster', $returnType); returnError(
'not_allowed_operation_cluster',
$returnType
);
return false; return false;
} }
break; break;
default: default:
// Ignore.
// break; break;
} }
} }
} }
// Check if the function exists // Check if the function exists.
if (function_exists($function_name)) { if (function_exists($function_name)) {
if (!DEBUG) { if (!DEBUG) {
error_reporting(0); error_reporting(0);
@ -207,23 +279,37 @@ if ($correctLogin) {
ini_set('display_errors', 1); ini_set('display_errors', 1);
} }
call_user_func($function_name, $id, $id2, $other, $returnType, $user_in_db); call_user_func(
$function_name,
$id,
$id2,
$other,
$returnType,
$user_in_db
);
} else { } else {
returnError('no_exist_operation', $returnType); returnError('no_exist_operation', $returnType);
} }
} }
} else { } else {
// TODO: Implement a new switch in config to enable / disable /*
// ACL auth failure: if enabled and have lots of traffic can produce millions * //TODO: Implement a new switch in config to enable / disable
// of records and a considerable OVERHEAD in the system :( * ACL auth failure: if enabled and have lots of traffic can produce
// db_pandora_audit("API access Failed", $no_login_msg, $user, $ipOrigin); * millions of records and a considerable OVERHEAD in the system :(
* db_pandora_audit("API access Failed", $no_login_msg, $user, $ipOrigin);
*/
sleep(15); sleep(15);
// Protection on DoS attacks // Protection on DoS attacks.
echo 'auth error'; echo 'auth error';
} }
// Logout. // Logout.
session_destroy(); if (session_status() === PHP_SESSION_ACTIVE) {
header_remove('Set-Cookie'); $_SESSION = [];
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); // Could give a warning if no session file is created. Ignore.
@session_destroy();
header_remove('Set-Cookie');
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
}

View File

@ -1,16 +1,32 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Generate charts with given parameters.
// Copyright (c) 2005-2018 Artica Soluciones Tecnologicas *
// Please see http://pandorafms.org for full contribution list * @category ChartGenerator.
// This program is free software; you can redistribute it and/or * @package Pandora FMS
// modify it under the terms of the GNU General Public License * @subpackage Opensource.
// as published by the Free Software Foundation for version 2. * @version 1.0.0
// This program is distributed in the hope that it will be useful, * @license See below
// but WITHOUT ANY WARRANTY; without even the implied warranty of *
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * ______ ___ _______ _______ ________
// GNU General Public License for more details. * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
// Global & session manageme * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
require_once 'config.php'; require_once 'config.php';
require_once __DIR__.'/config.php'; require_once __DIR__.'/config.php';
@ -26,6 +42,29 @@ require_once $config['homedir'].'/include/functions_agents.php';
require_once $config['homedir'].'/include/functions_tags.php'; require_once $config['homedir'].'/include/functions_tags.php';
/**
* Echo to stdout a PhantomJS callback call.
*
* @return void
*/
function echoPhantomCallback()
{
?>
<script type="text/javascript">
$('document').ready(function () {
setTimeout(function () {
try {
var status = window.callPhantom({ status: "loaded" });
} catch (error) {
console.log("CALLBACK ERROR", error.message)
}
}, 100);
});
</script>
<?php
}
// Initialize session. // Initialize session.
global $config; global $config;
@ -48,17 +87,7 @@ if (check_login(false) === false) {
</head> </head>
<body> <body>
<h1>Access is not granted</h1> <h1>Access is not granted</h1>
<script type="text/javascript"> <?php echoPhantomCallback(); ?>
$('document').ready(function () {
setTimeout(function () {
try {
var status = window.callPhantom({ status: "loaded" });
} catch (error) {
console.log("CALLBACK ERROR", error.message)
}
}, 100);
});
</script>
</body> </body>
</html> </html>
@ -76,11 +105,18 @@ if ($config['metaconsole'] && !empty($server_id)) {
$server = metaconsole_get_connection_by_id($server_id); $server = metaconsole_get_connection_by_id($server_id);
// Error connecting. // Error connecting.
if (metaconsole_connect($server) !== NOERR) { if (metaconsole_connect($server) !== NOERR) {
echo '<html>'; ?>
echo '<body>'; <html>
ui_print_error_message(__('There was a problem connecting with the node')); <body>
echo '</body>'; <?php
echo '</html>'; ui_print_error_message(
__('There was a problem connecting with the node')
);
echoPhantomCallback();
?>
</body>
</html>
<?php
exit; exit;
} }
} }
@ -125,16 +161,18 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
<body bgcolor="#ffffff" style='background:#ffffff;'> <body bgcolor="#ffffff" style='background:#ffffff;'>
<?php <?php
$params['only_image'] = false; $params['only_image'] = false;
$params['width'] = (int) $_REQUEST['viewport_width']; $params['width'] = (int) $_REQUEST['viewport_width'];
$params['menu'] = false; $params['menu'] = false;
if ((!isset($params['width']) || ($params['width'] <= 0))) { if ((isset($params['width']) === false
|| ($params['width'] <= 0))
) {
$params['width'] = 650; $params['width'] = 650;
} }
$params_combined = json_decode($_REQUEST['data_combined'], true); $params_combined = json_decode($_REQUEST['data_combined'], true);
$module_list = json_decode($_REQUEST['data_module_list'], true); $module_list = json_decode($_REQUEST['data_module_list'], true);
$type_graph_pdf = $_REQUEST['type_graph_pdf']; $type_graph_pdf = $_REQUEST['type_graph_pdf'];
echo '<div>'; echo '<div>';
switch ($type_graph_pdf) { switch ($type_graph_pdf) {
@ -253,20 +291,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
} }
echo '</div>'; echo '</div>';
echoPhantomCallback();
?> ?>
<script type="text/javascript">
$('document').ready(function () {
setTimeout(function () {
try {
var status = window.callPhantom({ status: "loaded" });
} catch (error) {
console.log("CALLBACK ERROR", error.message)
}
}, 100);
});
</script>
</body> </body>
</html> </html>

View File

@ -20,8 +20,8 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC191022'; $build_version = 'PC191028';
$pandora_version = 'v7.0NG.739'; $pandora_version = 'v7.0NG.740';
// 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();

File diff suppressed because it is too large Load Diff

View File

@ -3595,7 +3595,32 @@ function graph_custom_sql_graph(
$SQL_GRAPH_MAX_LABEL_SIZE = 20; $SQL_GRAPH_MAX_LABEL_SIZE = 20;
if (is_metaconsole()) {
$server = metaconsole_get_connection_names();
$connection = metaconsole_get_connection($server);
metaconsole_connect($connection);
}
$report_content = db_get_row('treport_content', 'id_rc', $id); $report_content = db_get_row('treport_content', 'id_rc', $id);
if ($report_content == false || $report_content == '') {
$report_content = db_get_row('treport_content_template', 'id_rc', $id);
}
if ($report_content == false || $report_content == '') {
enterprise_hook('metaconsole_restore_db');
$report_content = db_get_row('treport_content', 'id_rc', $id);
if ($report_content == false || $report_content == '') {
$report_content = db_get_row('treport_content_template', 'id_rc', $id);
}
if (is_metaconsole()) {
$server = metaconsole_get_connection_names();
$connection = metaconsole_get_connection($server);
metaconsole_connect($connection);
}
}
if ($id != null) { if ($id != null) {
$historical_db = db_get_value_sql('SELECT historical_db from treport_content where id_rc ='.$id); $historical_db = db_get_value_sql('SELECT historical_db from treport_content where id_rc ='.$id);
} else { } else {
@ -3609,22 +3634,9 @@ function graph_custom_sql_graph(
$sql = io_safe_output($sql['sql']); $sql = io_safe_output($sql['sql']);
} }
if (($config['metaconsole'] == 1) && defined('METACONSOLE') && $report_content['server_name'] != '' && $report_content['server_name'] != '0') {
$metaconsole_connection = enterprise_hook('metaconsole_get_connection', [$report_content['server_name']]);
if ($metaconsole_connection === false) {
return false;
}
if (enterprise_hook('metaconsole_load_external_db', [$metaconsole_connection]) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
return false;
}
}
$data_result = db_get_all_rows_sql($sql, $historical_db); $data_result = db_get_all_rows_sql($sql, $historical_db);
if (($config['metaconsole'] == 1) && defined('METACONSOLE') && $report_content['server_name'] != '' && $report_content['server_name'] != '0') { if (is_metaconsole()) {
enterprise_hook('metaconsole_restore_db'); enterprise_hook('metaconsole_restore_db');
} }

View File

@ -282,6 +282,15 @@ function reporting_make_reporting_data(
$agents_to_macro = $content['id_agent']; $agents_to_macro = $content['id_agent'];
} }
// Metaconsole connection.
if (is_metaconsole()) {
$server = metaconsole_get_connection_names();
$connection = metaconsole_get_connection($server);
if (metaconsole_connect($connection) != NOERR) {
continue;
}
}
if (isset($content['style']['name_label'])) { if (isset($content['style']['name_label'])) {
// Add macros name. // Add macros name.
$items_label = []; $items_label = [];
@ -294,14 +303,6 @@ function reporting_make_reporting_data(
$metaconsole_on = is_metaconsole(); $metaconsole_on = is_metaconsole();
$server_name = $content['server_name']; $server_name = $content['server_name'];
// Metaconsole connection.
if ($metaconsole_on && $server_name != '') {
$connection = metaconsole_get_connection($server_name);
if (!metaconsole_load_external_db($connection)) {
continue;
}
}
$items_label['agent_description'] = agents_get_description( $items_label['agent_description'] = agents_get_description(
$content['id_agent'] $content['id_agent']
); );
@ -2824,13 +2825,12 @@ function reporting_group_report($report, $content)
$content['name'] = __('Group Report'); $content['name'] = __('Group Report');
} }
if ($config['metaconsole']) { if (is_metaconsole()) {
$id_meta = metaconsole_get_id_server($content['server_name']); $server = metaconsole_get_connection_names();
$connection = metaconsole_get_connection($server);
$server = metaconsole_get_connection_by_id($id_meta);
metaconsole_connect($server);
} }
$return['server_name'] = $server[0];
$return['title'] = $content['name']; $return['title'] = $content['name'];
$return['subtitle'] = groups_get_name($content['id_group'], true); $return['subtitle'] = groups_get_name($content['id_group'], true);
$return['description'] = $content['description']; $return['description'] = $content['description'];
@ -3488,7 +3488,7 @@ function reporting_network_interfaces_report($report, $content, $type='dinamic',
$return['failed'] = null; $return['failed'] = null;
$return['data'] = []; $return['data'] = [];
if ($config['metaconsole']) { if (is_metaconsole()) {
$server_names = metaconsole_get_connection_names(); $server_names = metaconsole_get_connection_names();
if (isset($server_names) && is_array($server_names)) { if (isset($server_names) && is_array($server_names)) {
foreach ($server_names as $key => $value) { foreach ($server_names as $key => $value) {
@ -3505,7 +3505,8 @@ function reporting_network_interfaces_report($report, $content, $type='dinamic',
$content, $content,
$report, $report,
$fullscale, $fullscale,
$pdf $pdf,
$id_meta
); );
metaconsole_restore_db(); metaconsole_restore_db();
} }

View File

@ -769,10 +769,20 @@ function reports_get_report_types($template=false, $not_editor=false)
'optgroup' => __('Grouped'), 'optgroup' => __('Grouped'),
'name' => __('General'), 'name' => __('General'),
]; ];
$types['group_report'] = [ if (is_metaconsole()) {
'optgroup' => __('Grouped'), if ($template === false) {
'name' => __('Group report'), $types['group_report'] = [
]; 'optgroup' => __('Grouped'),
'name' => __('Group report'),
];
}
} else {
$types['group_report'] = [
'optgroup' => __('Grouped'),
'name' => __('Group report'),
];
}
$types['exception'] = [ $types['exception'] = [
'optgroup' => __('Grouped'), 'optgroup' => __('Grouped'),
'name' => __('Exception'), 'name' => __('Exception'),
@ -880,7 +890,7 @@ function reports_get_report_types($template=false, $not_editor=false)
]; ];
} }
if ($config['enterprise_installed']) { if ($config['enterprise_installed'] && $template === false) {
$types['event_report_log'] = [ $types['event_report_log'] = [
'optgroup' => __('Log'), 'optgroup' => __('Log'),
'name' => __('Log report'), 'name' => __('Log report'),

View File

@ -170,17 +170,7 @@ function vbar_graph(
setup_watermark($water_mark, $water_mark_file, $water_mark_url); setup_watermark($water_mark, $water_mark_file, $water_mark_url);
if (empty($chart_data)) { if (empty($chart_data)) {
return html_print_image( return graph_nodata_image($width, $height, 'vbar');
$no_data_image,
true,
[
'width' => $width,
'height' => $height,
'title' => __('No data to show'),
],
false,
true
);
} }
if ($ttl == 2) { if ($ttl == 2) {
@ -357,17 +347,7 @@ function hbar_graph(
setup_watermark($water_mark, $water_mark_file, $water_mark_url); setup_watermark($water_mark, $water_mark_file, $water_mark_url);
if (empty($chart_data)) { if (empty($chart_data)) {
return html_print_image( return graph_nodata_image($width, $height, 'hbar');
$no_data_image,
true,
[
'width' => $width,
'height' => $height,
'title' => __('No data to show'),
],
false,
true
);
} }
if ($ttl == 2) { if ($ttl == 2) {

View File

@ -87,9 +87,9 @@ function js_refreshParentLines(layerName) {
{ {
strokeWidth: 2, strokeWidth: 2,
fillOpacity: 0.2, fillOpacity: 0.2,
fillColor: "red", fillColor: "black",
strokeDashstyle: "dash", strokeDashstyle: "dash",
strokeColor: "red" strokeColor: "black"
} }
); );

View File

@ -161,7 +161,7 @@ function pandora_session_gc($max_lifetime=300)
if (isset($config['session_timeout'])) { if (isset($config['session_timeout'])) {
$session_timeout = $config['session_timeout']; $session_timeout = $config['session_timeout'];
} else { } else {
// if $config doesn`t work ... // If $config doesn`t work ...
$session_timeout = db_get_value( $session_timeout = db_get_value(
'value', 'value',
'tconfig', 'tconfig',
@ -170,9 +170,9 @@ function pandora_session_gc($max_lifetime=300)
); );
} }
if (!empty($session_timeout)) { if (empty($session_timeout) === false) {
if ($session_timeout == -1) { if ($session_timeout == -1) {
// The session expires in 10 years // The session expires in 10 years.
$session_timeout = 315576000; $session_timeout = 315576000;
} else { } else {
$session_timeout *= 60; $session_timeout *= 60;
@ -191,15 +191,14 @@ function pandora_session_gc($max_lifetime=300)
); );
// Deleting cron and empty sessions. // Deleting cron and empty sessions.
$sql = "DELETE FROM tsessions_php WHERE $sql = 'DELETE FROM tsessions_php WHERE data IS NULL';
data IS NULL OR id_session REGEXP '^cron-'";
db_process_sql($sql); db_process_sql($sql);
return $retval; return $retval;
} }
// FIXME: SAML should work with pandora session handlers // TODO: SAML should work with pandora session handlers.
if (db_get_value('value', 'tconfig', 'token', 'auth') != 'saml') { if (db_get_value('value', 'tconfig', 'token', 'auth') != 'saml') {
$result_handler = session_set_save_handler( $result_handler = session_set_save_handler(
'pandora_session_open', 'pandora_session_open',

View File

@ -50,6 +50,29 @@ if (type_graph_pdf == "combined") {
var page = require("webpage").create(); var page = require("webpage").create();
page.onResourceError = function(resourceError) {
console.log(
"Unable to load resource (#" +
resourceError.id +
"URL:" +
resourceError.url +
")"
);
console.log(
"Error code: " +
resourceError.errorCode +
". Description: " +
resourceError.errorString
);
phantom.exit(1);
};
// Not supposed to be prompted messages.
page.onPrompt = function() {
console.log("Prompt message detected.");
phantom.exit(1);
};
page.viewportSize = { page.viewportSize = {
width: viewport_width, width: viewport_width,
height: viewport_height height: viewport_height
@ -84,3 +107,21 @@ page.open(url, "POST", post_data, function(status) {
phantom.exit(); phantom.exit();
} }
}); });
phantom.onError = function(msg, trace) {
var msgStack = ["PHANTOM ERROR: " + msg];
if (trace && trace.length) {
msgStack.push("TRACE:");
trace.forEach(function(t) {
msgStack.push(
" -> " +
(t.file || t.sourceURL) +
": " +
t.line +
(t.function ? " (in function " + t.function + ")" : "")
);
});
}
console.log(msgStack.join("\n"));
phantom.exit(1);
};

View File

@ -128,8 +128,8 @@
</div> </div>
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.739'; $version = '7.0NG.740';
$build = '191022'; $build = '191028';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.739 %define version 7.0NG.740
%define release 191022 %define release 1
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.739 %define version 7.0NG.740
%define release 191022 %define release 1
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.739 %define version 7.0NG.740
%define release 191022 %define release 1
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

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

View File

@ -112,7 +112,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('MR', 32), ('MR', 32),
('identification_reminder', 1), ('identification_reminder', 1),
('identification_reminder_timestamp', 0), ('identification_reminder_timestamp', 0),
('current_package_enterprise', '739'), ('current_package_enterprise', '740'),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'), ('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'),
('custom_docs_logo', 'default_docs.png'), ('custom_docs_logo', 'default_docs.png'),
('custom_support_logo', 'default_support.png'), ('custom_support_logo', 'default_support.png'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.739-191022 Version: 7.0NG.740
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.739-191022" pandora_version="7.0NG.740"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

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

View File

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

View File

@ -3258,7 +3258,7 @@ sub pandora_create_agent ($$$$$$$$$$;$$$$$$$$$$) {
'custom_id' => $custom_id, 'custom_id' => $custom_id,
'url_address' => $url_address, 'url_address' => $url_address,
'timezone_offset' => $timezone_offset, 'timezone_offset' => $timezone_offset,
'alias' => $alias, 'alias' => safe_input($alias),
'update_module_count' => 1, # Force to replicate in metaconsole 'update_module_count' => 1, # Force to replicate in metaconsole
}); });

View File

@ -57,6 +57,7 @@ our @EXPORT = qw(
get_addr_id get_addr_id
get_agent_addr_id get_agent_addr_id
get_agent_id get_agent_id
get_agent_ids_from_alias
get_agent_address get_agent_address
get_agent_alias get_agent_alias
get_agent_group get_agent_group
@ -232,6 +233,17 @@ sub get_agent_id ($$) {
return defined ($rc) ? $rc : -1; return defined ($rc) ? $rc : -1;
} }
########################################################################
## Return agent IDs given an agent alias.
########################################################################
sub get_agent_ids_from_alias ($$) {
my ($dbh, $agent_alias) = @_;
my @rc = get_db_rows ($dbh, "SELECT id_agente, nombre FROM tagente WHERE alias = ?", safe_input($agent_alias));
return @rc;
}
######################################################################## ########################################################################
## Return server ID given the name of server. ## Return server ID given the name of server.
######################################################################## ########################################################################

View File

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

View File

@ -141,6 +141,7 @@ our @EXPORT = qw(
long_to_ip long_to_ip
ip_to_long ip_to_long
get_enabled_servers get_enabled_servers
dateTimeToTimestamp
); );
# ID of the different servers # ID of the different servers

View File

@ -2,8 +2,8 @@
# Pandora FMS Server # Pandora FMS Server
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.739 %define version 7.0NG.740
%define release 191022 %define release 1
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
# Pandora FMS Server # Pandora FMS Server
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.739 %define version 7.0NG.740
%define release 191022 %define release 1
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -8,8 +8,8 @@
# This code is licensed under GPL 2.0 license. # This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.739" PI_VERSION="7.0NG.740"
PI_BUILD="191022" PI_BUILD="191028"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.739 PS191022"; my $version = "7.0NG.740 PS191028";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

File diff suppressed because it is too large Load Diff