Merge remote-tracking branch 'origin/develop' into 1923-Migrar_agentes_desde_metaconsola

This commit is contained in:
daniel 2018-03-13 16:00:44 +01:00
commit a3dceac0a0
57 changed files with 160 additions and 106 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.719, AIX version
# Version 7.0NG.720, 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.719, FreeBSD Version
# Version 7.0NG.720, 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.719, HP-UX Version
# Version 7.0NG.720, 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.719, GNU/Linux
# Version 7.0NG.720, 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.719, GNU/Linux
# Version 7.0NG.720, 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.719, Solaris Version
# Version 7.0NG.720, 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.719
# Version 7.0NG.720
# 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.719, AIX version
# Version 7.0NG.720, 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.719
# Version 7.0NG.720
# 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.719, HPUX Version
# Version 7.0NG.720, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.719
# Version 7.0NG.720
# 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.719
# Version 7.0NG.720
# 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.719
# Version 7.0NG.720
# 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.719, Solaris version
# Version 7.0NG.720, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.719, AIX version
# Version 7.0NG.720, 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.719-180312
Version: 7.0NG.720
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.719-180312"
pandora_version="7.0NG.720"
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.719, GNU/Linux
# Version 7.0NG.720, 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.719, FreeBSD Version
# Version 7.0NG.720, 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.719, HP-UX Version
# Version 7.0NG.720, 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.719, GNU/Linux
# Version 7.0NG.720, 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.719, GNU/Linux
# Version 7.0NG.720, 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.719, NetBSD Version
# Version 7.0NG.720, 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.719, Solaris Version
# Version 7.0NG.720, 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.719';
use constant AGENT_BUILD => '180312';
use constant AGENT_VERSION => '7.0NG.720';
use constant AGENT_BUILD => '180313';
# 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.719
%define release 180312
%define version 7.0NG.720
%define release 1
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.719
%define release 180312
%define version 7.0NG.720
%define release 1
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.719"
PI_BUILD="180312"
PI_VERSION="7.0NG.720"
PI_BUILD="180313"
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.719
# Version 7.0NG.720
# 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.719}
{Pandora FMS Windows Agent v7.0NG.720}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{180312}
{180313}
ViewReadme
{Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No}
Windows,Executable
{<%AppName%>-<%Version%>-Setup<%Ext%>}
{<%AppName%>-Setup<%Ext%>}
Windows,FileDescription
{<%AppName%> <%Version%> Setup}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.719(Build 180312)")
#define PANDORA_VERSION ("7.0NG.720(Build 180313)")
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.719(Build 180312))"
VALUE "ProductVersion", "(7.0NG.720(Build 180313))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.719-180312
Version: 7.0NG.720
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.719-180312"
pandora_version="7.0NG.720"
package_pear=0
package_pandora=1

View File

@ -1599,6 +1599,15 @@ class Tree {
'url' => $moduleGraphURL,
'handle' => $winHandle
);
// Info to be able to open the snapshot image new page
$module['snapshot'] = ui_get_snapshot_link(array(
'id_module' => $module['id'],
'last_data' => $module['datos'],
'timestamp' => $module['timestamp'],
'interval' => $module['current_interval'],
'module_name' => $module['name']
), true);
}
// Alerts fired image

View File

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

View File

@ -268,21 +268,14 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
$last_data_str .= html_print_image('images/clock2.png', true, array('title' => $last_data["timestamp"], 'width' => '18px'));
$is_snapshot = is_snapshot_data ( $last_data["datos"] );
if (($config['command_snapshot']) && ($is_snapshot)) {
$handle = 'snapshot_' . $module['id_agente_modulo'];
$url = 'include/procesos.php?agente=' . $row['id_agente_modulo'];
$win_handle = dechex(crc32($handle));
if (! defined ('METACONSOLE')) {
$link = "winopeng_var('operation/agentes/snapshot_view.php?" .
"id=" . $module['id_agente_modulo'] .
"&refr=" . $module['current_interval'] .
"&label=" . rawurlencode(urlencode(io_safe_output($module['module_name']))) . "','" . $win_handle . "', 700,480)";
}
else{
$link = "winopeng_var('$last_data[datos]','',700,480)";
}
$link = ui_get_snapshot_link( array(
'id_module' => $module['id_agente_modulo'],
'last_data' => $last_data['datos'],
'timestamp' => $last_data['timestamp'],
'interval' => $module['current_interval'],
'module_name' => $module['module_name']
));
if(!is_image_data($last_data["datos"])){
$salida = '<a href="javascript:' . $link . '">' .

View File

@ -3919,4 +3919,48 @@ function ui_print_tags_view($title = '', $tags = array()) {
$tv .= '</div>';
echo $tv;
}
/**
* @brief Get the link to open a snapshot into a new page
*
* @param Array Params to build the link (see $default_params)
* @param bool Flag to choose de return value:
* true: Get the four params required in the function of pandora.js winopen_var (js use)
* false: Get an inline winopen_var function call (php user)
*/
function ui_get_snapshot_link($params, $only_params = false) {
global $config;
$default_params = array(
'id_module' => 0, //id_agente_modulo
'module_name' => '',
'interval' => 300,
'last_data' => '',
'timestamp' => '0'
);
// Merge default params with passed params
$params = array_merge ($default_params, $params);
// First parameter of js winopeng_var
$page = $config['homeurl_static'] . "/operation/agentes/snapshot_view.php";
$url = "$page?" .
"id=" . $params['id_module'] .
"&refr=" . $parms['interval'] .
"&timestamp=" . $params['timestamp'] .
"&last_data=" . rawurlencode(urlencode(io_safe_output($params['last_data']))) .
"&label=" . rawurlencode(urlencode(io_safe_output($params['module_name'])));
// Second parameter of js winopeng_var
$win_handle = dechex(crc32('snapshot_' . $params['id_module']));
$link_parts = array ($url, $win_handle, 700, 480);
// Return only the params to js execution
if ($only_params) return $link_parts;
// Return the function call to inline js execution
return "winopeng_var('" . implode("', '", $link_parts) . "')";
}
?>

View File

@ -402,16 +402,21 @@ var TreeController = {
else{
var $graphImage = $('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
+'images/chart_curve.png" /> ');
+'images/chart_curve.png" /> ');
}
$graphImage
.addClass('module-graph')
.click(function (e) {
e.preventDefault();
if(element.statusImageHTML.indexOf('data:image')!=-1){
try {
winopeng_var(element.datos,'',700,480);
winopeng_var(
decodeURI(element.snapshot[0]),
element.snapshot[1],
element.snapshot[2],
element.snapshot[3]
);
}
catch (error) {
// console.log(error);

View File

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

View File

@ -39,6 +39,16 @@ if (file_exists ('../../include/languages/'.$user_language.'.mo')) {
$id = get_parameter('id');
$label = get_parameter ("label");
$last_data = get_parameter("last_data", '');
$last_timestamp = get_parameter("timestamp", '');
// FIXME: Support to old call snapshow_view calls. Remove it when all are migrated
if (empty($last_data)) {
$row = db_get_row_sql("SELECT *
FROM tagente_estado
WHERE id_agente_modulo = $id");
$last_data = io_safe_output($row["datos"]);
$last_timestamp = $row["timestamp"];
}
// TODO - Put ACL here
?>
@ -61,15 +71,14 @@ $label = get_parameter ("label");
$row = db_get_row_sql("SELECT *
FROM tagente_estado
WHERE id_agente_modulo = $id");
echo "<h2 style='text-align:center;' id='title_snapshot_view'>";
echo __("Current data at");
echo " ";
echo $row["timestamp"];
echo $last_timestamp;
echo "</h2>";
$datos = io_safe_output($row["datos"]);
if (is_image_data($datos)) {
echo '<center><img src="' . $datos . '" alt="image" style="width:100%"/></center>';
if (is_image_data($last_data)) {
echo '<center><img src="' . $last_data . '" alt="image" style="width:100%"/></center>';
}
else {
$datos = preg_replace ('/</', '&lt;', $datos);
@ -77,7 +86,7 @@ $label = get_parameter ("label");
$datos = preg_replace ('/\n/i','<br>',$datos);
$datos = preg_replace ('/\s/i','&nbsp;',$datos);
echo "<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'>";
echo $datos;
echo $last_data;
echo "</div>";
?>
<script type="text/javascript">
@ -88,16 +97,16 @@ $label = get_parameter ("label");
div.css('overflow-y', 'auto');
var w2 = $('div', div).innerWidth();
$(div).remove();
return (w1 - w2);
}
$(document).ready(function() {
width = $("#result_div").css("width");
width = width.replace("px", "");
width = parseInt(width);
$("#result_div").css("width", (width - getScrollbarWidth()) + "px");
height = $("#result_div").css("height");
height = height.replace("px", "");
height = parseInt(height);

View File

@ -1361,19 +1361,13 @@ if (!empty($result)) {
$is_snapshot = is_snapshot_data ( $module_value );
if (($config['command_snapshot']) && ($is_snapshot)) {
$handle = 'snapshot_' . $row['id_agente_modulo'];
$url = 'include/procesos.php?agente=' . $row['id_agente_modulo'];
$win_handle = dechex(crc32($handle));
if (! defined ('METACONSOLE')) {
$link = "winopeng_var('operation/agentes/snapshot_view.php?" .
"id=" . $row['id_agente_modulo'] .
"&refr=" . $row['current_interval'] .
"&label=" . rawurlencode(urlencode(io_safe_output($row['module_name']))) . "','" . $win_handle . "', 700,480)";
}
else{
$link = "winopeng_var('$row[datos]','',700,480)";
}
$link = ui_get_snapshot_link( array(
'id_module' => $row['id_agente_modulo'],
'last_data' => $row['datos'],
'timestamp' => $row['timestamp'],
'interval' => $row['current_interval'],
'module_name' => $row['module_name']
));
if(!is_image_data($row['datos'])){
$salida = '<a href="javascript:' . $link . '">' .

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.719
%define release 180312
%define version 7.0NG.720
%define release 1
# 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.719
%define release 180312
%define version 7.0NG.720
%define release 1
%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.719"
PI_VERSION="7.0NG.720"
FORCE=0
DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -112,7 +112,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('MR', 13),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package_enterprise', '719'),
('current_package_enterprise', '720'),
('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"}');
UNLOCK TABLES;

View File

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

View File

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

View File

@ -42,8 +42,8 @@ our @EXPORT = qw(
);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.719";
my $pandora_build = "180312";
my $pandora_version = "7.0NG.720";
my $pandora_build = "180313";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -267,10 +267,10 @@ sub get_agent {
my $rs = get_agent_from_alias($dbh, $field);
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
my $rs = get_agent_from_addr($dbh, $field);
$rs = get_agent_from_addr($dbh, $field);
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
my $rs = get_agent_from_name($dbh, $field);
$rs = get_agent_from_name($dbh, $field);
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
return undef;

View File

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

View File

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

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.719
%define release 180312
%define version 7.0NG.720
%define release 1
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.719"
PI_BUILD="180312"
PI_VERSION="7.0NG.720"
PI_BUILD="180313"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.719 PS180312";
my $version = "7.0NG.720 PS180313";
# 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.719 PS180312";
my $version = "7.0NG.720 PS180313";
# save program name for logging
my $progname = basename($0);