Merge branch 'develop' of https://github.com/pandorafms/pandorafms into develop

This commit is contained in:
m-lopez-f 2015-08-04 09:32:28 +02:00
commit 44835298fa
24 changed files with 72 additions and 47 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 6.0RC1-150803 Version: 6.0RC1-150804
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.0RC1-150803" pandora_version="6.0RC1-150804"
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.0RC1'; use constant AGENT_VERSION => '6.0RC1';
use constant AGENT_BUILD => '150803'; use constant AGENT_BUILD => '150804';
# 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.0RC1 %define version 6.0RC1
%define release 150803 %define release 150804
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.0RC1 %define version 6.0RC1
%define release 150803 %define release 150804
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{150803} {150804}
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.0RC1(Build 150803)") #define PANDORA_VERSION ("6.0RC1(Build 150804)")
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.0RC1(Build 150803))" VALUE "ProductVersion", "(6.0RC1(Build 150804))"
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.0RC1-150803 Version: 6.0RC1-150804
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.0RC1-150803" pandora_version="6.0RC1-150804"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

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

View File

@ -157,6 +157,9 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
} }
} }
// Module name
var module_name = $("#text-module_filter").val();
var idAgents = Array(); var idAgents = Array();
jQuery.each ($("#id_agents option:selected"), function (i, val) { jQuery.each ($("#id_agents option:selected"), function (i, val) {
@ -214,6 +217,7 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
"id_agent[]": idAgents, "id_agent[]": idAgents,
"all": find_modules, "all": find_modules,
"module_types_excluded[]": module_types_excluded, "module_types_excluded[]": module_types_excluded,
"name": module_name,
"selection_mode": selection_mode, "selection_mode": selection_mode,
"serialized": serialized, "serialized": serialized,
"id_server": id_server "id_server": id_server

View File

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

View File

@ -46,7 +46,8 @@ if (is_ajax ()) {
if ($get_agents_group_json) { if ($get_agents_group_json) {
$id_group = (int) get_parameter('id_group'); $id_group = (int) get_parameter('id_group');
$recursion = (int) get_parameter ('recursion', 0); $recursion = (int) get_parameter ('recursion', 0);
$custom_condition = get_parameter('custom_condition', ''); $id_os = get_parameter('id_os', '');
$agent_name = get_parameter('name', '');
$privilege = (string) get_parameter ('privilege', "AR"); $privilege = (string) get_parameter ('privilege', "AR");
// Is is possible add keys prefix to avoid auto sorting in js object conversion // Is is possible add keys prefix to avoid auto sorting in js object conversion
@ -65,41 +66,46 @@ if (is_ajax ()) {
$groups = array_keys($groups_orig); $groups = array_keys($groups_orig);
} }
// Build filter
$filter = array();
$filter['id_grupo'] = $groups;
$filter = " WHERE id_grupo IN (" . implode(',', $groups) . ") "; if (!empty($id_os))
$filter .= io_safe_output($custom_condition); $filter['id_os'] = $id_os;
if (!empty($agent_name))
$filter['nombre'] = '%' . $agent_name . '%';
switch ($status_agents) { switch ($status_agents) {
case AGENT_STATUS_NORMAL: case AGENT_STATUS_NORMAL:
$filter .= $filter[] = "(normal_count = total_count)";
" AND normal_count = total_count";
break; break;
case AGENT_STATUS_WARNING: case AGENT_STATUS_WARNING:
$filter .= $filter[] = "(critical_count = 0 AND warning_count > 0)";
" AND critical_count = 0 AND warning_count > 0";
break; break;
case AGENT_STATUS_CRITICAL: case AGENT_STATUS_CRITICAL:
$filter .= $filter[] = "(critical_count > 0)";
" AND critical_count > 0";
break; break;
case AGENT_STATUS_UNKNOWN: case AGENT_STATUS_UNKNOWN:
$filter .= $filter[] = "(critical_count = 0 AND warning_count = 0 AND unknown_count > 0)";
" AND critical_count = 0 AND warning_count = 0
AND unknown_count > 0";
break; break;
case AGENT_STATUS_NOT_NORMAL: case AGENT_STATUS_NOT_NORMAL:
$filter .= " AND normal_count <> total_count"; $filter[] = "(normal_count <> total_count)";
break; break;
case AGENT_STATUS_NOT_INIT: case AGENT_STATUS_NOT_INIT:
$filter .= " AND notinit_count = total_count"; $filter[] = "(notinit_count = total_count)";
break; break;
} }
$filter .= " ORDER BY nombre ASC"; $filter['order'] = "nombre ASC";
$agents = db_get_all_rows_sql("SELECT id_agente, nombre
FROM tagente" . $filter); // Build fields
$fields = array('id_agente', 'nombre');
// Perform search
$agents = db_get_all_rows_filter('tagente', $filter, $fields);
if (empty($agents)) $agents = array();
// Add keys prefix // Add keys prefix
if ($keys_prefix !== "") { if ($keys_prefix !== '') {
foreach ($agents as $k => $v) { foreach ($agents as $k => $v) {
$agents[$keys_prefix . $k] = $v; $agents[$keys_prefix . $k] = $v;
unset($agents[$k]); unset($agents[$k]);
@ -215,6 +221,7 @@ if (is_ajax ()) {
if ($get_agent_modules_json_for_multiple_agents) { if ($get_agent_modules_json_for_multiple_agents) {
$idAgents = get_parameter('id_agent'); $idAgents = get_parameter('id_agent');
$module_types_excluded = get_parameter('module_types_excluded', array()); $module_types_excluded = get_parameter('module_types_excluded', array());
$module_name = (string) get_parameter('name');
$selection_mode = get_parameter('selection_mode', 'common'); $selection_mode = get_parameter('selection_mode', 'common');
$serialized = get_parameter('serialized', ''); $serialized = get_parameter('serialized', '');
$id_server = (int) get_parameter('id_server', 0); $id_server = (int) get_parameter('id_server', 0);
@ -233,12 +240,26 @@ if (is_ajax ()) {
$filter .= ' AND 1 = 1'; $filter .= ' AND 1 = 1';
break; break;
case 'enabled': case 'enabled':
$filter .= ' AND disabled = 0'; $filter .= ' AND t1.disabled = 0';
break; break;
} }
if (!empty($module_types_excluded) && is_array($module_types_excluded)) if (!empty($module_types_excluded) && is_array($module_types_excluded))
$filter .= ' AND id_tipo_modulo NOT IN (' . implode($module_types_excluded) . ')'; $filter .= ' AND t1.id_tipo_modulo NOT IN (' . implode($module_types_excluded) . ')';
if (!empty($module_name)) {
switch ($config['dbtype']) {
case "mysql":
$filter .= " AND t1.nombre COLLATE utf8_general_ci LIKE '%$module_name%'";
break;
case "postgresql":
$filter .= " AND t1.nombre LIKE '%$module_name%'";
break;
case "oracle":
$filter .= " AND UPPER(t1.nombre) LIKE UPPER('%$module_name%')";
break;
}
}
if (is_metaconsole()) { if (is_metaconsole()) {
$result = array(); $result = array();
@ -356,17 +377,17 @@ if (is_ajax ()) {
else { else {
$sql = 'SELECT DISTINCT(nombre) $sql = 'SELECT DISTINCT(nombre)
FROM tagente_modulo t1 FROM tagente_modulo t1
WHERE ' . $filter . WHERE ' . $filter . '
'AND delete_pending = 0 AND t1.delete_pending = 0
AND id_agente IN (' . implode(',', $idAgents) . ')'; AND t1.id_agente IN (' . implode(',', $idAgents) . ')';
if ($selection_mode == 'common') { if ($selection_mode == 'common') {
$sql .= ' AND ( $sql .= ' AND (
SELECT count(nombre) SELECT count(nombre)
FROM tagente_modulo t2 FROM tagente_modulo t2
WHERE delete_pending = 0 WHERE t2.delete_pending = 0
AND t1.nombre = t2.nombre AND t1.nombre = t2.nombre
AND id_agente IN (' . implode(',', $idAgents) . ')) = (' . count($idAgents) . ')'; AND t2.id_agente IN (' . implode(',', $idAgents) . ')) = (' . count($idAgents) . ')';
} }
$sql .= ' ORDER BY nombre'; $sql .= ' ORDER BY nombre';

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0RC1 %define version 6.0RC1
%define release 150803 %define release 150804
# 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.0RC1 %define version 6.0RC1
%define release 150803 %define release 150804
%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

@ -39,7 +39,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('step_compact','1'), ('step_compact','1'),
('db_scheme_first_version', '6.0dev'), ('db_scheme_first_version', '6.0dev'),
('db_scheme_version','6.0RC1'), ('db_scheme_version','6.0RC1'),
('db_scheme_build','PD150803'), ('db_scheme_build','PD150804'),
('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.0RC1-150803 Version: 6.0RC1-150804
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.0RC1-150803" pandora_version="6.0RC1-150804"
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.0RC1"; my $pandora_version = "6.0RC1";
my $pandora_build = "150803"; my $pandora_build = "150804";
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.0RC1 %define version 6.0RC1
%define release 150803 %define release 150804
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.0RC1 %define version 6.0RC1
%define release 150803 %define release 150804
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

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.0RC1 PS150803"; my $version = "6.0RC1 PS150804";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "6.0RC1 PS150803"; my $version = "6.0RC1 PS150804";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);