XMerge branch 'develop' into feature/alias_friendly_name

This commit is contained in:
Alejandro Gallardo Escobar 2017-02-20 12:04:43 +01:00
commit 545dad643c
37 changed files with 82 additions and 60 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0dev-170216
Version: 7.0dev-170217
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.0dev-170216"
pandora_version="7.0dev-170217"
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

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0dev';
use constant AGENT_BUILD => '170216';
use constant AGENT_BUILD => '170217';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0dev
%define release 170216
%define release 170217
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0dev
%define release 170216
%define release 170217
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0dev"
PI_BUILD="170216"
PI_BUILD="170217"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{170216}
{170217}
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.0dev(Build 170216)")
#define PANDORA_VERSION ("7.0dev(Build 170217)")
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.0dev(Build 170216))"
VALUE "ProductVersion", "(7.0dev(Build 170217))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0dev-170216
Version: 7.0dev-170217
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.0dev-170216"
pandora_version="7.0dev-170217"
package_pear=0
package_pandora=1

View File

@ -183,8 +183,9 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL;
-- ---------------------------------------------------------------------
-- Table `tusuario`
-- ---------------------------------------------------------------------
ALTER TABLE tusuario ADD (`id_filter` int(10) unsigned NULL default NULL);
ALTER TABLE tusuario ADD CONSTRAINT fk_id_filter FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
ALTER TABLE tusuario ADD COLUMN `id_filter` int(10) unsigned NULL default NULL;
ALTER TABLE tusuario ADD COLUMN CONSTRAINT `fk_id_filter` FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
ALTER TABLE tusuario ADD COLUMN `session_time` int(10) signed NOT NULL default '0';
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`

View File

@ -105,8 +105,9 @@ ALTER TABLE tevent_filter ADD COLUMN date_to date DEFAULT NULL;
-- ---------------------------------------------------------------------
-- Table `tusuario`
-- ---------------------------------------------------------------------
ALTER TABLE tusuario ADD (id_filter int(10) unsigned NULL default NULL);
ALTER TABLE tusuario ADD CONSTRAINT fk_id_filter FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
ALTER TABLE tusuario ADD COLUMN id_filter int(10) unsigned default NULL;
ALTER TABLE tusuario ADD COLUMN CONSTRAINT fk_id_filter FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
ALTER TABLE tusuario ADD COLUMN session_time INTEGER NOT NULL default '0';
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`

View File

@ -5,6 +5,14 @@
ALTER TABLE tagente_estado RENAME COLUMN last_known_status TO known_status;
ALTER TABLE tagente_estado ADD COLUMN last_known_status NUMBER(10, 0) DEFAULT 0;
-- ---------------------------------------------------------------------
-- Table `tusuario`
-- ---------------------------------------------------------------------
ALTER TABLE tusuario ADD COLUMN id_filter int(10) unsigned default NULL;
ALTER TABLE tusuario ADD COLUMN CONSTRAINT fk_id_filter FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
ALTER TABLE tusuario ADD COLUMN session_time int(10) NOT NULL default 0;
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
-- ---------------------------------------------------------------------

View File

@ -395,7 +395,7 @@ $table->style[2] = 'font-weight: bold';
$table->data['selection_mode'][0] = __('Selection mode');
$table->data['selection_mode'][1] = __('Select modules first') . ' ' .
html_print_radio_button_extended ("selection_mode", 'modules', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true);
html_print_radio_button_extended ("selection_mode", 'modules', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true).'<br>';
$table->data['selection_mode'][1] .= __('Select agents first') . ' ' .
html_print_radio_button_extended ("selection_mode", 'agents', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true);

View File

@ -238,7 +238,7 @@ $table->data = array ();
$table->data['selection_mode'][0] = __('Selection mode');
$table->data['selection_mode'][1] = __('Select modules first') . ' ' .
html_print_radio_button_extended ("selection_mode", 'modules', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true);
html_print_radio_button_extended ("selection_mode", 'modules', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true).'<br>';
$table->data['selection_mode'][1] .= __('Select agents first') . ' ' .
html_print_radio_button_extended ("selection_mode", 'agents', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true);

View File

@ -108,7 +108,7 @@ echo '</div>';
echo '' . __('To get your <b>Pandora FMS Enterprise License</b>:') . '<br />';
echo '<ul>';
echo '<li>';
echo '' . sprintf(__('Go to %s'), "<a target=\"_blank\" href=\"https://licensing.artica.es/pandoraupdate6/index.php?section=generate_key_client\">https://licensing.artica.es/pandoraupdate6/index.php?section=generate_key_client</a>");
echo '' . sprintf(__('Go to %s'), "<a target=\"_blank\" href=\"https://licensing.artica.es/pandoraupdate7/index.php?section=generate_key_client\">https://licensing.artica.es/pandoraupdate7/index.php?section=generate_key_client</a>");
echo '</li>';
echo '<li>';
echo '' .__('Enter the <b>auth key</b> and the following <b>request key</b>:');

View File

@ -176,7 +176,7 @@ if ($create_user) {
}
$values["not_login"] = (bool)get_parameter ('not_login', false);
$values["strict_acl"] = (bool)get_parameter ('strict_acl', false);
$values["session_time"] = get_parameter('session_time', 0);
$values["session_time"] = (int)get_parameter('session_time', 0);
if ($id == '') {
ui_print_error_message (__('User ID cannot be empty'));
@ -280,7 +280,7 @@ if ($update_user) {
}
$values["not_login"] = (bool)get_parameter ('not_login', false);
$values["strict_acl"] = (bool)get_parameter ('strict_acl', false);
$values["session_time"] = get_parameter('session_time', 0);
$values["session_time"] = (int)get_parameter('session_time', 0);
$res1 = update_user ($id, $values);

View File

@ -22,7 +22,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC170216';
$build_version = 'PC170217';
$pandora_version = 'v7.0dev';
// Do not overwrite default timezone set if defined.

View File

@ -1406,6 +1406,29 @@ function agents_get_interval ($id_agent) {
return (int) db_get_value ('intervalo', 'tagente', 'id_agente', $id_agent);
}
/**
* Get all data of agent.
*
* @param Agent object.
*
* @return The interval value and status of last contact
*/
function agents_get_interval_status ($agent) {
$return = '';
$last_time = strtotime ($agent["ultimo_contacto"]);
$now = time ();
$diferencia = $now - $last_time;
$time = ui_print_timestamp ($last_time, true, array('style' => 'font-size:6.5pt'));
$min_interval = modules_get_agentmodule_mininterval($agent['id_agente']);
$return = $time;
if ($diferencia > ($min_interval["min_interval"] * 2))
$return = '<b><span style="color: #ff0000;">'.$time.'</span></b>';
return $return;
}
/**
* Get the operating system of an agent.
*

View File

@ -2490,6 +2490,11 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal
}
}
function modules_get_agentmodule_mininterval($id_agent) {
$sql = sprintf('SELECT min(current_interval) min_interval from tagente_estado where id_agente = %d', $id_agent);
return db_get_row_sql($sql);
}
function get_same_modules ($agents, $modules) {
$modules_to_report = array();
if ($modules != "") {

View File

@ -2462,22 +2462,13 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
if(get_parameter('pure')==1){
echo 'width:100%;height:100%;position:absolute;';
}
echo 'background-color:'.$layout["background_color"].';"><div id="background_'.$id_layout.'"
style="margin:0px auto;';
if(get_parameter('pure')==1){
echo 'top: 50%;
transform: translate(-0%, -50%);
-webkit-transform: translate(-0%, -50%);';
}
echo 'text-align:;
z-index: 0;
position:relative;
width:' . $mapWidth . 'px;
height:' . $mapHeight . 'px;">';
echo 'background-color:'.$layout["background_color"].';"><div id="background_'.$id_layout.'"
style="margin:0px auto;text-align:
z-index: 0;
position:relative;
width:' . $mapWidth . 'px;
height:' . $mapHeight . 'px;">';
echo "<img src='" .
ui_get_full_url($backgroundImage) . "' width='100%' height='100%' />";

View File

@ -71,7 +71,7 @@
<div style='height: 10px'>
<?php
$version = '7.0dev';
$build = '170216';
$build = '170217';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -608,16 +608,7 @@ foreach ($agents as $agent) {
$data[7] = $alert_img;
$last_time = strtotime ($agent["ultimo_contacto"]);
$now = time ();
$diferencia = $now - $last_time;
$time = ui_print_timestamp ($last_time, true, array('style' => 'font-size:6.5pt'));
$style = '';
if ($diferencia > ($agent["intervalo"] * 2))
$data[8] = '<b><span style="color: #ff0000;">'.$time.'</span></b>';
else
$data[8] = $time;
$data[8] = agents_get_interval_status ($agent);
// This old code was returning "never" on agents without modules, BAD !!
// And does not print outdated agents in red. WRONG !!!!

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0dev
%define release 170216
%define release 170217
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0dev
%define release 170216
%define release 170217
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -66,7 +66,7 @@ INSERT INTO tconfig (token, value) VALUES ('graph_res','5');
INSERT INTO tconfig (token, value) VALUES ('step_compact','1');
INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc');
INSERT INTO tconfig (token, value) VALUES('db_scheme_version','7.0dev');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170216');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170217');
INSERT INTO tconfig (token, value) VALUES ('show_unknown','0');
INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1');
INSERT INTO tconfig (token, value) VALUES ('style','pandora');

View File

@ -91,6 +91,7 @@ CREATE TABLE tagente (
custom_id VARCHAR2(255) DEFAULT '',
server_name VARCHAR2(100) DEFAULT '',
cascade_protection NUMBER(5, 0) DEFAULT 0,
cascade_protection_module NUMBER(5, 0) DEFAULT 0,
--number of hours of diference with the server timezone
timezone_offset NUMBER(5, 0) DEFAULT 0,
--path in the server to the image of the icon representing the agent
@ -1154,7 +1155,7 @@ CREATE TABLE tusuario (
metaconsole_assigned_server NUMBER(10, 0) DEFAULT 0,
metaconsole_access_node NUMBER(10, 0) DEFAULT 0,
strict_acl NUMBER(5,0) DEFAULT 0,
session_time NUMBER(10,0) DEFAULT 0,
session_time INTEGER DEFAULT 0,
CONSTRAINT t_usuario_metaconsole_acc_cons CHECK (metaconsole_access IN ('basic','advanced'))
);

View File

@ -67,6 +67,7 @@ CREATE TABLE IF NOT EXISTS `tagente` (
`custom_id` varchar(255) default '',
`server_name` varchar(100) default '',
`cascade_protection` tinyint(2) NOT NULL default '0',
`cascade_protection_module` tinyint(2) NOT NULL default '0',
`timezone_offset` TINYINT(2) NULL DEFAULT '0' COMMENT 'nuber of hours of diference with the server timezone' ,
`icon_path` VARCHAR(127) NULL DEFAULT NULL COMMENT 'path in the server to the image of the icon representing the agent' ,
`update_gis_data` TINYINT(1) NOT NULL DEFAULT '1' COMMENT 'set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and do not update it' ,
@ -1068,7 +1069,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
`metaconsole_access_node` tinyint(1) unsigned NOT NULL default 0,
`strict_acl` tinyint(1) unsigned NOT NULL DEFAULT 0,
`id_filter` int(10) unsigned NULL default NULL,
`session_time` int(10) unsigned NOT NULL default 0,
`session_time` int(10) signed NOT NULL default 0,
CONSTRAINT `fk_filter_id` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter (`id_filter`) ON DELETE SET NULL,
UNIQUE KEY `id_user` (`id_user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0dev-170216
Version: 7.0dev-170217
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.0dev-170216"
pandora_version="7.0dev-170217"
package_cpan=0
package_pandora=1

View File

@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0dev";
my $pandora_build = "170216";
my $pandora_build = "170217";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0dev
%define release 170216
%define release 170217
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0dev
%define release 170216
%define release 170217
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0dev"
PI_BUILD="170216"
PI_BUILD="170217"
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.0dev PS170216";
my $version = "7.0dev PS170217";
# Pandora server configuration
my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0dev PS170216";
my $version = "7.0dev PS170217";
# save program name for logging
my $progname = basename($0);