diff --git a/extras/build_deb.sh b/extras/build_deb.sh index 787929c543..788eb72536 100755 --- a/extras/build_deb.sh +++ b/extras/build_deb.sh @@ -19,8 +19,5 @@ cd $CODEHOME/pandora_agents/unix/DEBIAN && bash ./make_deb_package.sh && mv ../* # Enterprise console 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 diff --git a/extras/build_rpm.sh b/extras/build_rpm.sh index bf94591c2e..f523eeaa7d 100755 --- a/extras/build_rpm.sh +++ b/extras/build_rpm.sh @@ -19,8 +19,5 @@ rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.spec || exit 1 # Enterprise console 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 diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 2819f4aa86..8a553b84eb 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150126 +Version: 6.0dev-150128 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 3151d0ec3e..e28a95cf7a 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 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." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index bfb60ad661..dae8083cae 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150126'; +use constant AGENT_BUILD => '150128'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 0e57532bb0..1b102ad8b0 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150126 +%define release 150128 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index eca0df7f5d..48f06cd8a3 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.0dev -%define release 150126 +%define release 150128 Summary: Pandora FMS Linux agent, PERL version Name: %{name} @@ -19,7 +19,6 @@ Prefix: /usr/share BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildArch: noarch PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd -BuildRequires: sysvinit cron rsyslog sysconfig Requires: coreutils unzip AutoReq: 0 Provides: %{name}-%{version} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2dd97dded1..ea94d5436a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150126} +{150128} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f6aacebf8b..ddf211d650 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #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_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d807afc4ba..a8e1b07354 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.0dev(Build 150126))" + VALUE "ProductVersion", "(6.0dev(Build 150128))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4bd5c9f315..bdf2dd8ed7 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150126 +Version: 6.0dev-150128 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 61a3677f8c..888390c960 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150126" +pandora_version="6.0dev-150128" package_pear=0 package_pandora=1 diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index ab5b40f2a4..f3ac17c7c2 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -82,7 +82,12 @@ foreach ($servers as $server) { } // Type - $data[2] = ''.$server["img"].' ('.ucfirst($server["type"]).")"; + if ($server['type'] == 'data'){ + $data[2] = ''.$server["img"].' (' . $server["version"]. ')'; + } + else{ + $data[2] = ''.$server["img"].' ('.ucfirst($server["type"]).")"; + } if ($server["master"] == 1) $data[2] .= ui_print_help_tip (__("This is a master server"), true); diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 5dca8c9095..6e5e937da3 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -156,12 +156,8 @@ if ($get_module_detail) { $columns = array( - "Timestamp" => array( - "utimestamp", - "modules_format_timestamp", - "align" => "left"), "Data" => array( - "datos", + "data", "modules_format_data", "align" => "left"), "Time" => array( @@ -266,7 +262,7 @@ if ($get_module_detail) { ui_print_error_message(__('No available data to show')); } 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); } diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 57d7068b7f..dea4424b4f 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150126'; +$build_version = 'PC150128'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 2cde30a46f..a0ab1bcf05 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2768,4 +2768,28 @@ function events_get_count_events_validated ($filter, $period, $date, 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; +} ?> diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 5c757042f1..1f772319e0 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -1547,7 +1547,7 @@ function modules_get_next_data ($id_agent_module, $utimestamp = 0, $string = 0) * * @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', $id_agent_module); @@ -1571,8 +1571,8 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0) { FROM tagente_datos_string WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d - ORDER BY utimestamp ASC", - $id_agent_module, $datelimit, $date); + ORDER BY utimestamp %s", + $id_agent_module, $datelimit, $date, $order); break; //log4x case 24: @@ -1580,20 +1580,20 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0) { FROM tagente_datos_log4x WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d - ORDER BY utimestamp ASC", - $id_agent_module, $datelimit, $date); + ORDER BY utimestamp %s", + $id_agent_module, $datelimit, $date, $order); break; default: $sql = sprintf ("SELECT datos AS data, utimestamp FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d - ORDER BY utimestamp ASC", - $id_agent_module, $datelimit, $date); + ORDER BY utimestamp %s", + $id_agent_module, $datelimit, $date, $order); 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) { return array (); @@ -2038,4 +2038,4 @@ function modules_change_relation_lock ($id_relation) { return ($result !== false ? $new_value : $old_value); } -?> \ No newline at end of file +?> diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index d8083344ee..98cb2224d8 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -991,7 +991,8 @@ 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 .= 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); 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; } } 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])."%'"; } } } diff --git a/pandora_console/install.php b/pandora_console/install.php index 424f1bcec7..c217d97e7e 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
array("utimestamp", "modules_format_timestamp", "align" => "center" ), "Sev" => array("severity", "modules_format_data", "align" => "center", "width" => "70px"), "Message"=> array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"), "StackTrace" => array("stacktrace", "modules_format_verbatim", "align" => "left", "width" => "50%") @@ -111,8 +110,8 @@ else if (preg_match ("/string/", $moduletype_name)) { } $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 { @@ -124,7 +123,6 @@ else { } $columns = array( - "Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"), "Data" => array("datos", "modules_format_data", "align" => "left"), "Time" => array("utimestamp", "modules_format_time", "align" => "center") ); diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index c22a12ecb4..94bda42221 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -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."')"; $data[7] = '' . html_print_image("images/chart_curve.png", true, array("border" => '0', "alt" => "")) . ''; - if (defined('METACONSOLE')) - $data[7] .= "". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . ""; - else - $data[7] .= " " . html_print_image('images/binary.png', true, array("style" => '0', "alt" => '')) . ""; + $data[7] .= "". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . ""; + } $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']); diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index ecebd01f8a..6b8828ddba 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -564,6 +564,18 @@ else { $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)) { $graph = '
' . diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index 2daade52aa..cb781137e8 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -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 */ 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 loadDiv = $('#tree_div' + id).attr('loadDiv'); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index af98dac4e0..8c68559522 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 6.0dev -%define release 150126 +%define release 150128 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 17caf94cb8..cf4ab18f0c 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 6.0dev -%define release 150126 +%define release 150128 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 4661751279..c543c964a6 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -38,7 +38,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('graph_res','5'), ('step_compact','1'), ('db_scheme_version','6.0dev'), -('db_scheme_build','PD150126'), +('db_scheme_build','PD150128'), ('show_unknown','0'), ('show_lastalerts','1'), ('style','pandora'), diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 781abb252d..a7493450a4 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 6.0dev-150126 +Version: 6.0dev-150128 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 2e82fa9310..089ced4e5f 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.0dev-150126" +pandora_version="6.0dev-150128" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 1461ddfc1f..e7c3945afe 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -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 = "150126"; +my $pandora_build = "150128"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 769846bd0c..0ba775fc79 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 6.0dev -%define release 150126 +%define release 150128 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e450ff93ca..faa8b1d30c 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 6.0dev -%define release 150126 +%define release 150128 Summary: Pandora FMS Server Name: %{name} @@ -19,7 +19,6 @@ Prefix: /usr/share BuildRoot: %{_tmppath}/%{name}-buildroot BuildArch: noarch PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd -BuildRequires: sysvinit cron rsyslog sysconfig AutoReq: 0 Provides: %{name}-%{version} Requires: perl-DBI perl-DBD-mysql perl-libwww-perl diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index ed2b3211c8..c8a12e9f08 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "6.0dev PS150126"; +my $version = "6.0dev PS150128"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 6abc25ad22..34a6a0c32a 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -34,7 +34,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "6.0dev PS150126"; +my $version = "6.0dev PS150128"; # save program name for logging my $progname = basename($0);