Merge branch 'develop' into feature/NewTreeView

This commit is contained in:
Alejandro Gallardo Escobar 2015-01-28 18:58:26 +01:00
commit 2a36e4b864
33 changed files with 84 additions and 57 deletions

View File

@ -19,8 +19,5 @@ cd $CODEHOME/pandora_agents/unix/DEBIAN && bash ./make_deb_package.sh && mv ../*
# Enterprise console # Enterprise console
cd $PANDHOME_ENT/pandora_console/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1 cd $PANDHOME_ENT/pandora_console/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1
# Enterprise server
cd $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1
exit 0 exit 0

View File

@ -19,8 +19,5 @@ rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.spec || exit 1
# Enterprise console # Enterprise console
rpmbuild -ba $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec || exit 1 rpmbuild -ba $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec || exit 1
# Enterprise server
rpmbuild -ba $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec || exit 1
exit 0 exit 0

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 6.0dev-150126 Version: 6.0dev-150128
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="6.0dev-150126" pandora_version="6.0dev-150128"
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

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '6.0dev'; use constant AGENT_VERSION => '6.0dev';
use constant AGENT_BUILD => '150126'; use constant AGENT_BUILD => '150128';
# Commands to retrieve total memory information in kB # Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => { use constant TOTALMEMORY_CMDS => {

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 6.0dev %define version 6.0dev
%define release 150126 %define release 150128
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}
@ -19,7 +19,6 @@ Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
BuildArch: noarch BuildArch: noarch
PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
BuildRequires: sysvinit cron rsyslog sysconfig
Requires: coreutils unzip Requires: coreutils unzip
AutoReq: 0 AutoReq: 0
Provides: %{name}-%{version} Provides: %{name}-%{version}

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{150126} {150128}
ViewReadme ViewReadme
{Yes} {Yes}

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 ("6.0dev(Build 150126)") #define PANDORA_VERSION ("6.0dev(Build 150128)")
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", "(6.0dev(Build 150126))" VALUE "ProductVersion", "(6.0dev(Build 150128))"
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: 6.0dev-150126 Version: 6.0dev-150128
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="6.0dev-150126" pandora_version="6.0dev-150128"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -82,7 +82,12 @@ foreach ($servers as $server) {
} }
// Type // Type
$data[2] = '<span style="white-space:nowrap;">'.$server["img"].'</span> ('.ucfirst($server["type"]).")"; if ($server['type'] == 'data'){
$data[2] = '<span style="white-space:nowrap;">'.$server["img"].'</span> (<span style="font-size:8px;">' . $server["version"]. '</span>)';
}
else{
$data[2] = '<span style="white-space:nowrap;">'.$server["img"].'</span> ('.ucfirst($server["type"]).")";
}
if ($server["master"] == 1) if ($server["master"] == 1)
$data[2] .= ui_print_help_tip (__("This is a master server"), true); $data[2] .= ui_print_help_tip (__("This is a master server"), true);

View File

@ -156,12 +156,8 @@ if ($get_module_detail) {
$columns = array( $columns = array(
"Timestamp" => array(
"utimestamp",
"modules_format_timestamp",
"align" => "left"),
"Data" => array( "Data" => array(
"datos", "data",
"modules_format_data", "modules_format_data",
"align" => "left"), "align" => "left"),
"Time" => array( "Time" => array(
@ -266,7 +262,7 @@ if ($get_module_detail) {
ui_print_error_message(__('No available data to show')); ui_print_error_message(__('No available data to show'));
} }
else { else {
ui_pagination ($count, false, $offset, 0, false, 'offset', true, 'binary_dialog'); ui_pagination (count($count), false, $offset, 0, false, 'offset', true, 'binary_dialog');
html_print_table($table); html_print_table($table);
} }

View File

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

View File

@ -2768,4 +2768,28 @@ function events_get_count_events_validated ($filter, $period, $date,
return $return; return $return;
} }
function events_checks_event_tags($event_data, $acltags) {
global $config;
if (empty($acltags[$event_data['id_grupo']])) {
return true;
} else {
$tags_arr_acl = explode(',',$acltags[$event_data['id_grupo']]);
$tags_arr_event = explode(',',$event_data['tags']);
foreach ($tags_arr_acl as $tag) {
$tag_name = tags_get_name($tag);
if (in_array($tag_name, $tags_arr_event)) {
return true;
} else {
$has_tag = false;
}
}
if (!$has_tag) {
return false;
}
}
return false;
}
?> ?>

View File

@ -1547,7 +1547,7 @@ function modules_get_next_data ($id_agent_module, $utimestamp = 0, $string = 0)
* *
* @return array The module value and the timestamp * @return array The module value and the timestamp
*/ */
function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0) { function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0, $trash, $conexion = false, $order = 'ASC') {
$module = db_get_row('tagente_modulo', 'id_agente_modulo', $module = db_get_row('tagente_modulo', 'id_agente_modulo',
$id_agent_module); $id_agent_module);
@ -1571,8 +1571,8 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0) {
FROM tagente_datos_string FROM tagente_datos_string
WHERE id_agente_modulo = %d WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d AND utimestamp > %d AND utimestamp <= %d
ORDER BY utimestamp ASC", ORDER BY utimestamp %s",
$id_agent_module, $datelimit, $date); $id_agent_module, $datelimit, $date, $order);
break; break;
//log4x //log4x
case 24: case 24:
@ -1580,20 +1580,20 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0) {
FROM tagente_datos_log4x FROM tagente_datos_log4x
WHERE id_agente_modulo = %d WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d AND utimestamp > %d AND utimestamp <= %d
ORDER BY utimestamp ASC", ORDER BY utimestamp %s",
$id_agent_module, $datelimit, $date); $id_agent_module, $datelimit, $date, $order);
break; break;
default: default:
$sql = sprintf ("SELECT datos AS data, utimestamp $sql = sprintf ("SELECT datos AS data, utimestamp
FROM tagente_datos FROM tagente_datos
WHERE id_agente_modulo = %d WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d AND utimestamp > %d AND utimestamp <= %d
ORDER BY utimestamp ASC", ORDER BY utimestamp %s",
$id_agent_module, $datelimit, $date); $id_agent_module, $datelimit, $date, $order);
break; break;
} }
$values = db_get_all_rows_sql ($sql, $search_in_history_db, false); $values = db_get_all_rows_sql ($sql, $search_in_history_db, false, $conexion);
if ($values === false) { if ($values === false) {
return array (); return array ();
@ -2038,4 +2038,4 @@ function modules_change_relation_lock ($id_relation) {
return ($result !== false ? $new_value : $old_value); return ($result !== false ? $new_value : $old_value);
} }
?> ?>

View File

@ -991,7 +991,8 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group
if ($force_group_and_tag) { if ($force_group_and_tag) {
if (!empty($all_tags[$tag])) { if (!empty($all_tags[$tag])) {
$tags_condition .= sprintf('(tags = "%s"',io_safe_input($all_tags[$tag])); //~ $tags_condition .= sprintf('(tags = "%s"',io_safe_input($all_tags[$tag]));
$tags_condition .= "(tags LIKE '%".io_safe_input($all_tags[$tag])."%'";
$childrens = groups_get_childrens($group_id, null, true); $childrens = groups_get_childrens($group_id, null, true);
if (empty($childrens)) { if (empty($childrens)) {
@ -1009,7 +1010,8 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group
$tags_condition .= "id_grupo = ".$group_id; $tags_condition .= "id_grupo = ".$group_id;
} }
} else { } else {
$tags_condition .= sprintf('tags = "%s"',io_safe_input($all_tags[$tag])); //~ $tags_condition .= sprintf('tags = "%s"',io_safe_input($all_tags[$tag]));
$tags_condition .= "tags LIKE '%".io_safe_input($all_tags[$tag])."%'";
} }
} }
} }

View File

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

View File

@ -95,7 +95,6 @@ if ($moduletype_name == "log4x") {
} }
$columns = array( $columns = array(
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center" ),
"Sev" => array("severity", "modules_format_data", "align" => "center", "width" => "70px"), "Sev" => array("severity", "modules_format_data", "align" => "center", "width" => "70px"),
"Message"=> array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"), "Message"=> array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"),
"StackTrace" => array("stacktrace", "modules_format_verbatim", "align" => "left", "width" => "50%") "StackTrace" => array("stacktrace", "modules_format_verbatim", "align" => "left", "width" => "50%")
@ -111,8 +110,8 @@ else if (preg_match ("/string/", $moduletype_name)) {
} }
$columns = array( $columns = array(
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"), "Data" => array("datos", "modules_format_data", "align" => "left"),
"Data" => array("datos", "modules_format_data", "align" => "left") "Time" => array("utimestamp", "modules_format_time", "align" => "center"),
); );
} }
else { else {
@ -124,7 +123,6 @@ else {
} }
$columns = array( $columns = array(
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"),
"Data" => array("datos", "modules_format_data", "align" => "left"), "Data" => array("datos", "modules_format_data", "align" => "left"),
"Time" => array("utimestamp", "modules_format_time", "align" => "center") "Time" => array("utimestamp", "modules_format_time", "align" => "center")
); );

View File

@ -1153,11 +1153,9 @@ foreach ($result as $row) {
$link ="winopeng('operation/agentes/stat_win.php?type=$graph_type&period=86400&id=".$row["id_agente_modulo"]."&label=".rawurlencode(urlencode(base64_encode($row["module_name"])))."&refresh=600','day_".$win_handle."')"; $link ="winopeng('operation/agentes/stat_win.php?type=$graph_type&period=86400&id=".$row["id_agente_modulo"]."&label=".rawurlencode(urlencode(base64_encode($row["module_name"])))."&refresh=600','day_".$win_handle."')";
$data[7] = '<a href="javascript:'.$link.'">' . html_print_image("images/chart_curve.png", true, array("border" => '0', "alt" => "")) . '</a>'; $data[7] = '<a href="javascript:'.$link.'">' . html_print_image("images/chart_curve.png", true, array("border" => '0', "alt" => "")) . '</a>';
if (defined('METACONSOLE'))
$data[7] .= "<a href='javascript: show_module_detail_dialog(" . $row["id_agente_modulo"] . ", ". $row['id_agent'].", \"" . $row['server_name'] . "\", 0, 86400)'>". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . "</a>";
else
$data[7] .= "&nbsp;<a href='index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=".$row["id_agent"]."&amp;tab=data_view&period=86400&amp;id=".$row["id_agente_modulo"]."'>" . html_print_image('images/binary.png', true, array("style" => '0', "alt" => '')) . "</a>";
$data[7] .= "<a href='javascript: show_module_detail_dialog(" . $row["id_agente_modulo"] . ", ". $row['id_agent'].", \"" . $row['server_name'] . "\", 0, 86400)'>". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . "</a>";
} }
$data[8] = ui_print_module_warn_value($row['max_warning'], $row['min_warning'], $row['str_warning'], $row['max_critical'], $row['min_critical'], $row['str_critical']); $data[8] = ui_print_module_warn_value($row['max_warning'], $row['min_warning'], $row['str_warning'], $row['max_critical'], $row['min_critical'], $row['str_critical']);

View File

@ -564,6 +564,18 @@ else {
$history); $history);
} }
if (!empty($result)) {
//~ Checking the event tags exactly. The event query filters approximated tags to keep events
//~ with several tags
$acltags = tags_get_user_module_and_tags ($config['id_user'],'ER', true);
foreach ($result as $key=>$event_data) {
$has_tags = events_checks_event_tags($event_data, $acltags);
if (!$has_tags) {
unset($result[$key]);
}
}
}
if (!empty($result)) { if (!empty($result)) {
$graph = '<div style="width: 350px; margin: 0 auto;">' . $graph = '<div style="width: 350px; margin: 0 auto;">' .

View File

@ -709,7 +709,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
* id_father int use in js and ajax php, its useful when you have a two subtrees with same agent for diferent each one * id_father int use in js and ajax php, its useful when you have a two subtrees with same agent for diferent each one
*/ */
function loadSubTree(type, div_id, less_branchs, id_father, server_name) { function loadSubTree(type, div_id, less_branchs, id_father, server_name) {
var id = id_father + '_' + type + '_' + server_name + '_' + div_id; var id = id_father + '_' + type + '_' + server_name.replace('.','\\.') + '_' + div_id;
var hiddenDiv = $('#tree_div' + id).attr('hiddenDiv'); var hiddenDiv = $('#tree_div' + id).attr('hiddenDiv');
var loadDiv = $('#tree_div' + id).attr('loadDiv'); var loadDiv = $('#tree_div' + id).attr('loadDiv');

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0dev %define version 6.0dev
%define release 150126 %define release 150128
# 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

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0dev %define version 6.0dev
%define release 150126 %define release 150128
%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

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

View File

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

View File

@ -43,7 +43,7 @@ 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 = "6.0dev"; my $pandora_version = "6.0dev";
my $pandora_build = "150126"; my $pandora_build = "150128";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 6.0dev %define version 6.0dev
%define release 150126 %define release 150128
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}
@ -19,7 +19,6 @@ Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-buildroot BuildRoot: %{_tmppath}/%{name}-buildroot
BuildArch: noarch BuildArch: noarch
PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
BuildRequires: sysvinit cron rsyslog sysconfig
AutoReq: 0 AutoReq: 0
Provides: %{name}-%{version} Provides: %{name}-%{version}
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl Requires: perl-DBI perl-DBD-mysql perl-libwww-perl

View File

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

View File

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