Merge branch 'develop' into feature/#1978-REESCRITURA_DEL_MOTOR_DE_INFORMES

This commit is contained in:
mdtrooper 2015-03-20 15:59:34 +01:00
commit 21e0d423dc
35 changed files with 128 additions and 58 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 6.0dev-150318
Version: 6.0dev-150320
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="6.0dev-150318"
pandora_version="6.0dev-150320"
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 => '6.0dev';
use constant AGENT_BUILD => '150318';
use constant AGENT_BUILD => '150320';
# Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => {

View File

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

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{150318}
{150320}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("6.0dev(Build 150318)")
#define PANDORA_VERSION ("6.0dev(Build 150320)")
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", "(6.0dev(Build 150318))"
VALUE "ProductVersion", "(6.0dev(Build 150320))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 6.0dev-150318
Version: 6.0dev-150320
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="6.0dev-150318"
pandora_version="6.0dev-150320"
package_pear=0
package_pandora=1

View File

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

View File

@ -2759,7 +2759,7 @@ function groups_get_group_deep ($id_group) {
$deep = "";
}
else {
$deep = str_repeat("    ", count($parents));
$deep = str_repeat("  ", count($parents));
}
return $deep;

View File

@ -755,7 +755,7 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table = '') {
* @return string SQL condition for tagente_module
*/
function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group_and_tag = false) {
function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group_and_tag = false, $force_equal = false) {
global $config;
$condition = '';
@ -800,8 +800,11 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group
if ($force_group_and_tag) {
if (!empty($all_tags[$tag])) {
//~ $tags_condition .= sprintf('(tags = "%s"',io_safe_input($all_tags[$tag]));
$tags_condition .= "(tags LIKE '%".io_safe_input($all_tags[$tag])."%'";
if ($force_equal) {
$tags_condition .= sprintf('(tags = "%s"',io_safe_input($all_tags[$tag]));
} else {
$tags_condition .= "(tags LIKE '%".io_safe_input($all_tags[$tag])."%'";
}
$childrens = groups_get_childrens($group_id, null, true);
if (empty($childrens)) {
@ -819,8 +822,11 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group
$tags_condition .= "id_grupo = ".$group_id;
}
} else {
//~ $tags_condition .= sprintf('tags = "%s"',io_safe_input($all_tags[$tag]));
$tags_condition .= "tags LIKE '%".io_safe_input($all_tags[$tag])."%'";
if ($force_equal) {
$tags_condition .= sprintf('tags = "%s"',io_safe_input($all_tags[$tag]));
} else {
$tags_condition .= "tags LIKE '%".io_safe_input($all_tags[$tag])."%'";
}
}
}
}

View File

@ -526,7 +526,7 @@ function ui_print_group_icon ($id_group, $return = false, $path = "groups_small"
}
else {
if (empty ($icon))
$output .= '<span title="'. groups_get_name($id_group, true).'">&nbsp;-&nbsp</span>';
$output .= '<span title="'. groups_get_name($id_group, true).'">&nbsp;&nbsp;</span>';
else {
$output .= html_print_image("images/" . $path . "/" . $icon . ".png",
true, array("style" => $style, "class" => "bot", "alt" => groups_get_name($id_group, true), "title" => groups_get_name ($id_group, true)));

View File

@ -63,7 +63,7 @@
<div style='height: 10px'>
<?php
$version = '6.0dev';
$build = '150318';
$build = '150320';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -82,7 +82,10 @@ else {
$agent_name = $agent_name;
}
$data[0] = ui_print_group_icon ($agent["id_grupo"], true);
if (!$config["show_group_name"])
$data[0] = ui_print_group_icon ($agent["id_grupo"], true);
else
$data[0] = "";
$table_agent->cellstyle[count($table_agent->data)][0] =
'width: 16px; text-align:center; padding: 0px;';

View File

@ -156,8 +156,11 @@ if (!empty($result_groups)) {
if (isset($data['_iconImg_']) && !empty($data['_iconImg_']))
$item_icon = $data['_iconImg_'];
echo $link . $deep . $item_icon ."&nbsp;" . $group_name . "</a>";
if ($data['_name_'] != "All")
echo $deep . $link . $group_name . "</a>";
else
echo $link . $group_name . "</a>";
echo "</td>";
// Total agents

View File

@ -25,8 +25,6 @@ require_once ($config['homedir'].'/include/functions_ui.php');
check_login ();
enterprise_hook('open_meta_frame');
if (! check_acl ($config["id_user"], 0, "ER")) {
db_pandora_audit("ACL Violation",
"Trying to access event viewer");
@ -44,15 +42,11 @@ if (enterprise_installed() && defined("METACONSOLE")) {
$history = (bool) get_parameter('history', 0);
$readonly = false;
if (!$meta) {
if (isset($config['event_replication']) &&
$config['event_replication'] == 1) {
if ($config['show_events_in_local'] == 0) {
db_pandora_audit("ACL Violation",
"Trying to access event viewer. View disabled due event replication.");
ui_print_info_message(array('message' => __('Event viewer is disabled due event replication. For more information, please contact with the administrator'), 'no_close' => true));
return;
}
else {
@ -61,6 +55,7 @@ if (!$meta) {
}
}
if (is_ajax ()) {
$get_event_tooltip = (bool) get_parameter ('get_event_tooltip');
$validate_event = (bool) get_parameter ('validate_event');
@ -127,6 +122,7 @@ if (is_ajax ()) {
$similars = (bool) get_parameter ('similars');
$return = events_delete_event ($id, $similars, $meta, $history);
if ($return)
echo 'ok';
else
@ -180,6 +176,23 @@ if (is_ajax ()) {
return;
}
enterprise_hook('open_meta_frame');
if (!$meta) {
if (isset($config['event_replication']) &&
$config['event_replication'] == 1) {
if ($config['show_events_in_local'] == 0) {
db_pandora_audit("ACL Violation",
"Trying to access event viewer. View disabled due event replication.");
ui_print_info_message(array('message' => __('Event viewer is disabled due event replication. For more information, please contact with the administrator'), 'no_close' => true));
return;
}
else {
$readonly = true;
}
}
}
$offset = (int) get_parameter ("offset", 0);
$id_group = (int) get_parameter('id_group', 0);//0 all

View File

@ -36,6 +36,8 @@ if (! check_acl ($config["id_user"], 0, "ER")) {
return;
}
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
if(defined('METACONSOLE')){
$jump = '&nbsp;&nbsp;';
}
@ -225,7 +227,7 @@ if (check_acl ($config["id_user"], 0, "EW") || check_acl ($config["id_user"], 0,
$data[0] .= html_print_input_text ('id_name', '', '', 15, 255, true);
$data[1] = __('Filter group') . $jump;
# Fix : Only admin users can see group ALL
$data[1] .= html_print_select_groups($config["id_user"], "ER", users_can_manage_group_all(), 'id_group', $id_group, '', '', 0, true, false, false, 'w130');
$data[1] .= html_print_select_groups($config['id_user'], "ER", users_can_manage_group_all(), "id_group", $id_group, '', '', 0, true, false, false, 'w130', false, '', false, false, 'id_grupo', $strict_user);
$table->data[] = $data;
$table->rowclass[] = '';
@ -327,13 +329,21 @@ if(defined('METACONSOLE')){
$data = array();
$data[0] = html_print_select ($tags_select_with, 'select_with', '', '', '', 0,
true, true, true, '', false, 'width: 120px; height: 70px;') . '<br>';
if(!defined("METACONSOLE"))
$data[0] = html_print_select ($tags_select_with, 'select_with', '', '', '', 0,
true, true, true, '', false, 'width: 120px; height: 70px;') . '<br>';
else
$data[0] = html_print_select ($tags_select_with, 'select_with', '', '', '', 0,
true, true, true, '', false, 'width: 250px; height: 70px;') . '<br>';
$data[1] = html_print_image('images/darrowright.png', true, array('id' => 'button-add_with', 'style' => 'cursor: pointer;', 'title' => __('Add')));
$data[1] .= html_print_input_hidden('tag_with', $tag_with_base64, true);
$data[1] .= '<br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'button-remove_with', 'style' => 'cursor: pointer;', 'title' => __('Remove')));
$data[2] = html_print_select ($tag_with_temp, 'tag_with_temp', array(), '', '',
0, true, true, true, '', false, "width: 120px; height: 70px;");
if(!defined("METACONSOLE"))
$data[2] = html_print_select ($tag_with_temp, 'tag_with_temp', array(), '', '',
0, true, true, true, '', false, "width: 120px; height: 70px;");
else
$data[2] = html_print_select ($tag_with_temp, 'tag_with_temp', array(), '', '',
0, true, true, true, '', false, "width: 250px; height: 70px;");
$tabletags_with->data[] = $data;
$tabletags_with->rowclass[] = '';
@ -353,13 +363,23 @@ if(defined('METACONSOLE')){
$tabletags_without->styleTable = 'border: 0px;';
$data = array();
$data[0] = html_print_select ($tags_select_without, 'select_without', '', '', '', 0,
true, true, true, '', false, 'width: 120px; height: 70px;') . '<br>';
if(!defined("METACONSOLE"))
$data[0] = html_print_select ($tags_select_without, 'select_without', '', '', '', 0,
true, true, true, '', false, 'width: 120px; height: 70px;') . '<br>';
else
$data[0] = html_print_select ($tags_select_without, 'select_without', '', '', '', 0,
true, true, true, '', false, 'width: 250px; height: 70px;') . '<br>';
$data[1] = html_print_image('images/darrowright.png', true, array('id' => 'button-add_without', 'style' => 'cursor: pointer;', 'title' => __('Add')));
$data[1] .= html_print_input_hidden('tag_without', $tag_without_base64, true);
$data[1] .= '<br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'button-remove_without', 'style' => 'cursor: pointer;', 'title' => __('Remove')));
$data[2] = html_print_select ($tag_without_temp, 'tag_without_temp', array(), '', '',
0, true, true, true, '', false, "width: 120px; height: 70px;");
if(!defined("METACONSOLE"))
$data[2] = html_print_select ($tag_without_temp, 'tag_without_temp', array(), '', '',
0, true, true, true, '', false, "width: 120px; height: 70px;");
else
$data[2] = html_print_select ($tag_without_temp, 'tag_without_temp', array(), '', '',
0, true, true, true, '', false, "width: 250px; height: 70px;");
$tabletags_without->data[] = $data;
$tabletags_without->rowclass[] = '';
@ -844,6 +864,8 @@ $(document).ready( function() {
$("#filter_only_alert").val(val);
if (i == 'id_group_filter')
$("#id_group").val(val);
if (i == 'id_group1')
$("#id_group1").val(val);
});
reorder_tags_inputs();
// Update the info with the loaded filter

View File

@ -429,10 +429,15 @@ if ($result === false) {
foreach ($result as $profile) {
$data[0] = '<b>'.profile_get_name ($profile["id_perfil"]).'</b>';
$data[1] = ui_print_group_icon ($profile["id_grupo"], true) .
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=' . $profile['id_grupo'] . '">' .
'&nbsp;' . ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT) .
'</a>';
if ($config["show_group_name"])
$data[1] = ui_print_group_icon ($profile["id_grupo"], true) .
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=' . $profile['id_grupo'] . '">' .
'&nbsp;' . '</a>';
else
$data[1] = ui_print_group_icon ($profile["id_grupo"], true) .
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=' . $profile['id_grupo'] . '">' .
'&nbsp;' . ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT) .
'</a>';
$tags_ids = explode(',',$profile["tags"]);
$tags = tags_get_tags($tags_ids);

View File

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

View File

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

View File

@ -38,7 +38,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('graph_res','5'),
('step_compact','1'),
('db_scheme_version','6.0dev'),
('db_scheme_build','PD150318'),
('db_scheme_build','PD150320'),
('show_unknown','0'),
('show_lastalerts','1'),
('style','pandora'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 6.0dev-150318
Version: 6.0dev-150320
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="6.0dev-150318"
pandora_version="6.0dev-150320"
package_cpan=0
package_pandora=1

View File

@ -159,7 +159,11 @@ network_threads 4
# icmp_checks x : defines number of pings for each icmp_proc module type. at least one of
# that ping should be 1 to report 1. Setting this to 1 will make all icmp montioring faster but
# with more probability of failure.
icmp_checks 3
icmp_checks 3
# Number of ICMP packets to send per request.
icmp_packets 1
# tcp specific options :
# tcp_checks: number of tcp retries if first attempt fails.

View File

@ -162,6 +162,9 @@ network_threads 4
icmp_checks 3
# Number of ICMP packets to send per request.
icmp_packets 1
# tcp specific options :
# tcp_checks: number of tcp retries if first attempt fails.
# tcp_timeout: specific timeout for tcp connections

View File

@ -163,6 +163,9 @@ network_threads 4
icmp_checks 3
# Number of ICMP packets to send per request.
icmp_packets 1
# tcp specific options :
# tcp_checks: number of tcp retries if first attempt fails.
# tcp_timeout: specific timeout for tcp connections

View File

@ -131,7 +131,10 @@ network_threads 5
# that ping should be 1 to report 1. Lower value have better performance, but more probability
# of false positives
icmp_checks 3.
icmp_checks 3
# Number of ICMP packets to send per request.
icmp_packets 1
# tcp specific options :
# tcp_checks: number of tcp retries if first attempt fails.

View File

@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "6.0dev";
my $pandora_build = "150318";
my $pandora_build = "150320";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
@ -208,6 +208,7 @@ sub pandora_load_config {
$pa_config->{"keepalive"} = 60; # 60 Seconds initially for server keepalive
$pa_config->{"keepalive_orig"} = $pa_config->{"keepalive"};
$pa_config->{"icmp_checks"} = 1; # Introduced on 1.3.1
$pa_config->{"icmp_packets"} = 1; # > 5.1SP2
$pa_config->{"alert_recovery"} = 0; # Introduced on 1.3.1
$pa_config->{"snmp_checks"} = 1; # Introduced on 1.3.1
$pa_config->{"snmp_timeout"} = 8; # Introduced on 1.3.1
@ -574,6 +575,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^icmp_checks\s([0-9]*)/i) {
$pa_config->{"icmp_checks"} = clean_blank($1);
}
elsif ($parametro =~ m/^icmp_packets\s([0-9]*)/i) {
$pa_config->{"icmp_packets"} = clean_blank($1);
}
elsif ($parametro =~ m/^snmpconsole\s([0-9]*)/i) {
$pa_config->{"snmpconsole"} = clean_blank($1);
}

View File

@ -865,6 +865,7 @@ sub pandora_ping ($$$$) {
if ($retries == 0) {
$retries = $pa_config->{'icmp_checks'};
}
my $packets = defined($pa_config->{'icmp_packets'}) ? $pa_config->{'icmp_packets'} : 1;
my $output = 0;
my $i;
@ -876,7 +877,7 @@ sub pandora_ping ($$$$) {
if (($OSNAME eq "MSWin32") || ($OSNAME eq "MSWin32-x64") || ($OSNAME eq "cygwin")){
my $ms_timeout = $timeout * 1000;
for ($i=0; $i < $retries; $i++) {
$output = `ping -n 1 -w $ms_timeout $host`;
$output = `ping -n $packets -w $ms_timeout $host`;
if ($output =~ /TTL/){
return 1;
}
@ -897,7 +898,7 @@ sub pandora_ping ($$$$) {
# Ping the host
for ($i=0; $i < $retries; $i++) {
`$ping_command -s -n $host 56 1 >$DEVNULL 2>&1`;
`$ping_command -s -n $host 56 $packets >$DEVNULL 2>&1`;
if ($? == 0) {
return 1;
}
@ -918,7 +919,7 @@ sub pandora_ping ($$$$) {
# Ping the host
for ($i=0; $i < $retries; $i++) {
`$ping_command -q -n -c 1 $host >$DEVNULL 2>&1`;
`$ping_command -q -n -c $packets $host >$DEVNULL 2>&1`;
if ($? == 0) {
return 1;
}
@ -939,7 +940,7 @@ sub pandora_ping ($$$$) {
# Ping the host
for ($i=0; $i < $retries; $i++) {
`$ping_command -q -n -c 1 $host >$DEVNULL 2>&1`;
`$ping_command -q -n -c $packets $host >$DEVNULL 2>&1`;
if ($? == 0) {
return 1;
}
@ -959,7 +960,7 @@ sub pandora_ping ($$$$) {
# Ping the host
for ($i=0; $i < $retries; $i++) {
`$ping_command -q -W $timeout -n -c 1 $host >$DEVNULL 2>&1`;
`$ping_command -q -W $timeout -n -c $packets $host >$DEVNULL 2>&1`;
if ($? == 0) {
return 1;
}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 6.0dev
%define release 150318
%define release 150320
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 6.0dev
%define release 150318
%define release 150320
Summary: Pandora FMS Server
Name: %{name}

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB;
# version: define current version
my $version = "6.0dev PS150318";
my $version = "6.0dev PS150320";
# Pandora server configuration
my %conf;

View File

@ -34,7 +34,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "6.0dev PS150318";
my $version = "6.0dev PS150320";
# save program name for logging
my $progname = basename($0);