Merge branch 'develop' into ent-3997-anadir-posicionamiento-a-los-elementos-de-la-consola-visual

This commit is contained in:
Alejandro Gallardo Escobar 2019-06-12 12:13:48 +02:00
commit ee7fb4db5f
76 changed files with 470 additions and 291 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.735-190604 Version: 7.0NG.735-190612
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="7.0NG.735-190604" pandora_version="7.0NG.735-190612"
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

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.735'; use constant AGENT_VERSION => '7.0NG.735';
use constant AGENT_BUILD => '190604'; use constant AGENT_BUILD => '190612';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -3038,10 +3038,10 @@ while (1) {
my @address_list; my @address_list;
if( -x "/bin/ip" || -x "/sbin/ip" || -x "/usr/sbin/ip" ) { if( -x "/bin/ip" || -x "/sbin/ip" || -x "/usr/sbin/ip" ) {
@address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`; @address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`;
} }
else { else {
@address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`; @address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`;
} }
for (my $i = 0; $i <= $#address_list; $i++) { for (my $i = 0; $i <= $#address_list; $i++) {

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190604 %define release 190612
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 7.0NG.735 %define version 7.0NG.735
%define release 190604 %define release 190612
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.735" PI_VERSION="7.0NG.735"
PI_BUILD="190604" PI_BUILD="190612"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -6,17 +6,17 @@
# #
# grep_log Perl script to search log files for a matching pattern. The last # grep_log Perl script to search log files for a matching pattern. The last
# searched position is saved in an index file so that consecutive # searched position is saved in an index file so that consecutive
# runs do not return the same results. The log file inode number is # runs do not return the same results. The log file inode number is
# also saved to detect log rotation. # also saved to detect log rotation.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. # the Free Software Foundation; version 2 of the License.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# 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.
# #
############################################################################### ###############################################################################
use strict; use strict;
@ -30,7 +30,7 @@ my $Output = 'module';
my $Verbose = 0; my $Verbose = 0;
# Index file storage directory, with a trailing '/' # Index file storage directory, with a trailing '/'
my $Idx_dir=($^O =~ /win/i)?'.\\':'/tmp/'; my $Idx_dir=($^O =~ /win/i)?"$ENV{'TMP'}\\":"/tmp/";
# Log file # Log file
my $Log_file = ''; my $Log_file = '';
@ -64,7 +64,7 @@ if ( (defined ($ENV{GREP_LOG_TMP})) && (-d $ENV{GREP_LOG_TMP}) ) {
} }
######################################################################################## ########################################################################################
# Erase blank spaces before and after the string # Erase blank spaces before and after the string
######################################################################################## ########################################################################################
sub trim($){ sub trim($){
my $string = shift; my $string = shift;
@ -226,7 +226,7 @@ sub parse_log (;$$) {
open(LOGFILE, $Log_file) || error_msg("Error opening file $Log_file: " . open(LOGFILE, $Log_file) || error_msg("Error opening file $Log_file: " .
$!); $!);
# Go to starting position. # Go to starting position.
seek(LOGFILE, $Idx_pos, 0); seek(LOGFILE, $Idx_pos, 0);
# Parse log file # Parse log file
@ -318,7 +318,7 @@ sub print_log ($) {
print_summary() if ($summary_flag == 1); print_summary() if ($summary_flag == 1);
return; return;
} }
# Log module # Log module
if ($Output eq 'log_module') { if ($Output eq 'log_module') {
my $output = "<log_module>\n"; my $output = "<log_module>\n";

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{190604} {190612}
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 ("7.0NG.735(Build 190604)") #define PANDORA_VERSION ("7.0NG.735(Build 190612)")
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", "(7.0NG.735(Build 190604))" VALUE "ProductVersion", "(7.0NG.735(Build 190612))"
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: 7.0NG.735-190604 Version: 7.0NG.735-190612
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="7.0NG.735-190604" pandora_version="7.0NG.735-190612"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -215,7 +215,7 @@ function extension_db_check_tables_differences(
$diff_tables = array_diff($tables_test, $tables_system); $diff_tables = array_diff($tables_test, $tables_system);
ui_print_result_message( ui_print_result_message(
!empty($diff_tables), empty($diff_tables),
__('Success! %s DB contains all tables', get_product_name()), __('Success! %s DB contains all tables', get_product_name()),
__( __(
'%s DB could not retrieve all tables. The missing tables are (%s)', '%s DB could not retrieve all tables. The missing tables are (%s)',

View File

@ -0,0 +1,6 @@
START TRANSACTION;
DELETE FROM `ttipo_modulo` WHERE `nombre` LIKE 'log4x';
COMMIT;

View File

@ -139,8 +139,9 @@ function get_logs_size($file)
function get_status_logs($path) function get_status_logs($path)
{ {
$status_server_log = ''; $status_server_log = '';
$size_server_log = get_logs_size($path); $size_server_log = number_format(get_logs_size($path));
if ($size_server_log <= 1048576) { $size_server_log = (0 + str_replace(',', '', $size_server_log));
if ($size_server_log <= 10485760) {
$status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have less than 10 MB of logs</a>"; $status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have less than 10 MB of logs</a>";
} else { } else {
$status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have more than 10 MB of logs</a>"; $status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have more than 10 MB of logs</a>";

View File

@ -1989,6 +1989,33 @@ CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
UNIQUE (`source`, `destination`, `utimestamp`) UNIQUE (`source`, `destination`, `utimestamp`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ; ) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
-- ---------------------------------------------------------------------
-- Table `user_task`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tuser_task` (
`id` int(20) unsigned NOT NULL auto_increment,
`function_name` varchar(80) NOT NULL default '',
`parameters` text NOT NULL default '',
`name` varchar(60) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `user_task_scheduled`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tuser_task_scheduled` (
`id` int(20) unsigned NOT NULL auto_increment,
`id_usuario` varchar(60) NOT NULL default '0',
`id_user_task` int(20) unsigned NOT NULL default '0',
`args` TEXT NOT NULL,
`scheduled` enum('no','hourly','daily','weekly','monthly','yearly','custom') default 'no',
`last_run` int(20) unsigned default '0',
`custom_data` int(10) NULL default '0',
`flag_delete` tinyint(1) UNSIGNED NOT NULL default 0,
`id_grupo` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tnotification_source` -- Table `tnotification_source`
-- ----------------------------------------------------- -- -----------------------------------------------------

View File

@ -357,8 +357,8 @@ function addConnectionMap() {
for (var index in connectionMaps) { for (var index in connectionMaps) {
if (isInt(index)) { if (isInt(index)) {
if (connectionMaps[index] == idConnectionMap) { if (connectionMaps[index] == idConnectionMap) {
alert("<?php echo __('The connection'); ?> "' + connectionMapName + '" <?php echo __('just added previously.'); ?>"); alert("<?php echo __('The connection'); ?> " + connectionMapName + " <?php echo __('just added previously.'); ?>");
return; return;
} }
} }

View File

@ -45,6 +45,9 @@
.parent() .parent()
.addClass('checkselected'); .addClass('checkselected');
$(".check_delete").prop("checked", true); $(".check_delete").prop("checked", true);
$('.check_delete').each(function(){
$('#hidden-id_report_'+$(this).val()).prop("disabled", false);
});
} }
else{ else{
$('[id^=checkbox-massive_report_check]') $('[id^=checkbox-massive_report_check]')

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

View File

@ -299,6 +299,7 @@ if (check_login()) {
'status' => "<div id='reload_status_agent_".$values['id_tmetaconsole_setup'].'_'.$values['id_tagente']."'>".$image_status.'</div>', 'status' => "<div id='reload_status_agent_".$values['id_tmetaconsole_setup'].'_'.$values['id_tagente']."'>".$image_status.'</div>',
'id_agent' => $values['id_tagente'], 'id_agent' => $values['id_tagente'],
'id_server' => $values['id_tmetaconsole_setup'], 'id_server' => $values['id_tmetaconsole_setup'],
'status_value' => $values['status'],
]; ];
} }

View File

@ -1472,7 +1472,10 @@ function local_ldap_search($ldap_host, $ldap_port=389, $ldap_version=3, $dn, $ac
$tls = ' -ZZ '; $tls = ' -ZZ ';
} }
if (stripos($ldap_host, 'ldap') !== false) { if (stripos($ldap_host, 'ldap://') !== false
|| stripos($ldap_host, 'ldaps://') !== false
|| stripos($ldap_host, 'ldapi://') !== false
) {
$ldap_host = ' -H '.$ldap_host.':'.$ldap_port; $ldap_host = ' -H '.$ldap_host.':'.$ldap_port;
} else { } else {
$ldap_host = ' -h '.$ldap_host.' -p '.$ldap_port; $ldap_host = ' -h '.$ldap_host.' -p '.$ldap_port;

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC190604'; $build_version = 'PC190612';
$pandora_version = 'v7.0NG.735'; $pandora_version = 'v7.0NG.735';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -2167,9 +2167,9 @@ function config_process_config()
if (!isset($config['ad_adv_perms'])) { if (!isset($config['ad_adv_perms'])) {
config_update_value('ad_adv_perms', ''); config_update_value('ad_adv_perms', '');
} else { } else {
$temp_ad_adv_perms = [];
if (!json_decode(io_safe_output($config['ad_adv_perms']))) { if (!json_decode(io_safe_output($config['ad_adv_perms']))) {
$temp_ad_adv_perms = []; if ($config['ad_adv_perms'] != '') {
if (!isset($config['ad_adv_perms']) && $config['ad_adv_perms'] != '') {
$perms = explode(';', io_safe_output($config['ad_adv_perms'])); $perms = explode(';', io_safe_output($config['ad_adv_perms']));
foreach ($perms as $ad_adv_perm) { foreach ($perms as $ad_adv_perm) {
if (preg_match('/[\[\]]/', $ad_adv_perm)) { if (preg_match('/[\[\]]/', $ad_adv_perm)) {
@ -2232,22 +2232,26 @@ function config_process_config()
if (!empty($new_ad_adv_perms)) { if (!empty($new_ad_adv_perms)) {
$temp_ad_adv_perms = json_encode($new_ad_adv_perms); $temp_ad_adv_perms = json_encode($new_ad_adv_perms);
} }
} else {
$temp_ad_adv_perms = '';
} }
} else {
config_update_value('ad_adv_perms', $temp_ad_adv_perms); $temp_ad_adv_perms = $config['ad_adv_perms'];
} }
config_update_value('ad_adv_perms', $temp_ad_adv_perms);
} }
if (!isset($config['ldap_adv_perms'])) { if (!isset($config['ldap_adv_perms'])) {
config_update_value('ldap_adv_perms', ''); config_update_value('ldap_adv_perms', '');
} else { } else {
$temp_ldap_adv_perms = [];
if (!json_decode(io_safe_output($config['ldap_adv_perms']))) { if (!json_decode(io_safe_output($config['ldap_adv_perms']))) {
$temp_ldap_adv_perms = []; if ($config['ldap_adv_perms'] != '') {
if (!isset($config['ad_adv_perms']) && $config['ldap_adv_perms'] != '') {
$perms = explode(';', io_safe_output($config['ldap_adv_perms'])); $perms = explode(';', io_safe_output($config['ldap_adv_perms']));
foreach ($perms as $ad_adv_perm) { foreach ($perms as $ldap_adv_perm) {
if (preg_match('/[\[\]]/', $ad_adv_perm)) { if (preg_match('/[\[\]]/', $ldap_adv_perm)) {
$all_data = explode(',', io_safe_output($ad_adv_perm)); $all_data = explode(',', io_safe_output($ldap_adv_perm));
$profile = $all_data[0]; $profile = $all_data[0];
$group_pnd = $all_data[1]; $group_pnd = $all_data[1];
$groups_ad = str_replace(['[', ']'], '', $all_data[2]); $groups_ad = str_replace(['[', ']'], '', $all_data[2]);
@ -2277,7 +2281,7 @@ function config_process_config()
'groups_ldap' => $groups_ldap, 'groups_ldap' => $groups_ldap,
]; ];
} else { } else {
$all_data = explode(',', io_safe_output($ad_adv_perm)); $all_data = explode(',', io_safe_output($ldap_adv_perm));
$profile = $all_data[0]; $profile = $all_data[0];
$group_pnd = $all_data[1]; $group_pnd = $all_data[1];
$groups_ad = $all_data[2]; $groups_ad = $all_data[2];
@ -2306,10 +2310,14 @@ function config_process_config()
if (!empty($new_ldap_adv_perms)) { if (!empty($new_ldap_adv_perms)) {
$temp_ldap_adv_perms = json_encode($new_ldap_adv_perms); $temp_ldap_adv_perms = json_encode($new_ldap_adv_perms);
} }
} else {
$temp_ldap_adv_perms = '';
} }
} else {
config_update_value('ldap_adv_perms', $temp_ldap_adv_perms); $temp_ldap_adv_perms = $config['ldap_adv_perms'];
} }
config_update_value('ldap_adv_perms', $temp_ldap_adv_perms);
} }
if (!isset($config['rpandora_server'])) { if (!isset($config['rpandora_server'])) {

View File

@ -188,10 +188,16 @@ function get_custom_fields_data($custom_field_name)
} }
$array_result = []; $array_result = [];
if (isset($result_meta) && is_array($result_meta)) { if (isset($result_meta) === true
&& is_array($result_meta) === true
) {
foreach ($result_meta as $result) { foreach ($result_meta as $result) {
foreach ($result as $k => $v) { if (isset($result) === true
$array_result[$v['description']] = $v['description']; && is_array($result) === true
) {
foreach ($result as $k => $v) {
$array_result[$v['description']] = $v['description'];
}
} }
} }
} }
@ -385,9 +391,13 @@ function agent_counters_custom_fields($filters)
// Filter custom data. // Filter custom data.
$custom_data_and = ''; $custom_data_and = '';
if (!in_array(-1, $filters['id_custom_fields_data'])) { if (isset($filters['id_custom_fields_data']) === true
$custom_data_array = implode("', '", $filters['id_custom_fields_data']); && is_array($filters['id_custom_fields_data']) === true
$custom_data_and = "AND tcd.description IN ('".$custom_data_array."')"; ) {
if (!in_array(-1, $filters['id_custom_fields_data'])) {
$custom_data_array = implode("', '", $filters['id_custom_fields_data']);
$custom_data_and = "AND tcd.description IN ('".$custom_data_array."')";
}
} }
// Filter custom name. // Filter custom name.
@ -693,3 +703,123 @@ function print_counters_cfv(
$html_result .= '</form>'; $html_result .= '</form>';
return $html_result; return $html_result;
} }
/**
* Function for export a csv file from Custom Fields View
*
* @param array $filters Status counters for agents and modules.
* @param array $id_status Agent status.
* @param array $module_status Module status.
*
* @return array Returns the data that will be saved in the csv file
*/
function export_custom_fields_csv($filters, $id_status, $module_status)
{
$data = agent_counters_custom_fields($filters);
$indexed_descriptions = $data['indexed_descriptions'];
// Table temporary for save array in table
// by order and search custom_field data.
$table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields (
id_server int(10),
id_agent int(10),
name_custom_fields varchar(2048),
critical_count int,
warning_count int,
unknown_count int,
notinit_count int,
normal_count int,
total_count int,
`status` int(2),
KEY `data_index_temp_1` (`id_server`, `id_agent`)
)';
db_process_sql($table_temporary);
// Insert values array in table temporary.
$values_insert = [];
foreach ($indexed_descriptions as $key => $value) {
$values_insert[] = '('.$value['id_server'].', '.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')';
}
$values_insert_implode = implode(',', $values_insert);
$query_insert = 'INSERT INTO temp_custom_fields VALUES '.$values_insert_implode;
db_process_sql($query_insert);
// Search for status module.
$status_agent_search = '';
if (isset($id_status) === true && is_array($id_status) === true) {
if (in_array(-1, $id_status) === false) {
if (in_array(AGENT_MODULE_STATUS_NOT_NORMAL, $id_status) === false) {
$status_agent_search = ' AND temp.status IN ('.implode(',', $id_status).')';
} else {
// Not normal statuses.
$status_agent_search = ' AND temp.status IN (1,2,3,4,5)';
}
}
}
// Search for status module.
$status_module_search = '';
if (isset($module_status) === true && is_array($module_status) === true) {
if (in_array(-1, $module_status) === false) {
if (in_array(AGENT_MODULE_STATUS_NOT_NORMAL, $module_status) === false) {
if (count($module_status) > 0) {
$status_module_search = ' AND ( ';
foreach ($module_status as $key => $value) {
$status_module_search .= ($key != 0) ? ' OR (' : ' (';
switch ($value) {
default:
case AGENT_STATUS_NORMAL:
$status_module_search .= ' temp.normal_count > 0) ';
break;
case AGENT_STATUS_CRITICAL:
$status_module_search .= ' temp.critical_count > 0) ';
break;
case AGENT_STATUS_WARNING:
$status_module_search .= ' temp.warning_count > 0) ';
break;
case AGENT_STATUS_UNKNOWN:
$status_module_search .= ' temp.unknown_count > 0) ';
break;
case AGENT_STATUS_NOT_INIT:
$status_module_search .= ' temp.notinit_count > 0) ';
break;
}
}
$status_module_search .= ' ) ';
}
} else {
// Not normal.
$status_module_search = ' AND ( temp.critical_count > 0 OR temp.warning_count > 0 OR temp.unknown_count > 0 AND temp.notinit_count > 0 )';
}
}
}
// Query all fields result.
$query = sprintf(
'SELECT
temp.name_custom_fields,
tma.alias,
tma.direccion,
tma.server_name,
temp.status
FROM tmetaconsole_agent tma
INNER JOIN temp_custom_fields temp
ON temp.id_agent = tma.id_tagente
AND temp.id_server = tma.id_tmetaconsole_setup
WHERE tma.disabled = 0
%s
%s
',
$status_agent_search,
$status_module_search
);
$result = db_get_all_rows_sql($query);
return $result;
}

View File

@ -289,7 +289,7 @@ function grafico_modulo_sparse_data(
} }
} }
if ($array_data === false || (!$params['graph_combined'] if ($array_data === false && (!$params['graph_combined']
&& !isset($array_data['sum1']['data'][0][1]) && !$params['baseline']) && !isset($array_data['sum1']['data'][0][1]) && !$params['baseline'])
) { ) {
return false; return false;

View File

@ -261,138 +261,47 @@ function snmp_browser_get_tree(
) { ) {
global $config; global $config;
if ($target_ip == '') { $output = get_snmpwalk(
return __('Target IP cannot be blank.'); $target_ip,
} $version,
$community,
$snmp3_auth_user,
$snmp3_security_level,
$snmp3_auth_method,
$snmp3_auth_pass,
$snmp3_privacy_method,
$snmp3_privacy_pass,
0,
$starting_oid,
'',
$server_to_exec,
'',
''
);
// Call snmpwalk // Build the tree.
if (empty($config['snmpwalk'])) { $oid_tree = ['__LEAVES__' => []];
switch (PHP_OS) { foreach ($output as $oid => $value) {
case 'FreeBSD': // Parse the OID.
$snmpwalk_bin = '/usr/local/bin/snmpwalk'; $oid_len = strlen($oid);
break;
case 'NetBSD':
$snmpwalk_bin = '/usr/pkg/bin/snmpwalk';
break;
default:
$snmpwalk_bin = 'snmpwalk';
break;
}
} else {
$snmpwalk_bin = $config['snmpwalk'];
}
switch (PHP_OS) {
case 'WIN32':
case 'WINNT':
case 'Windows':
$error_redir_dir = 'NUL';
break;
default:
$error_redir_dir = '/dev/null';
break;
}
if ($server_to_exec != 0) {
$sql = sprintf('SELECT ip_address FROM tserver WHERE id_server = %d', $server_to_exec);
$server_data = db_get_row_sql($sql);
if (enterprise_installed()) {
enterprise_include_once('include/functions_satellite.php');
$oid_tree = ['__LEAVES__' => []];
if ($version == '3') {
switch ($snmp3_security_level) {
case 'authPriv':
$command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir;
break;
case 'authNoPriv':
$command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir;
break;
case 'noAuthNoPriv':
$command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir;
break;
}
} else {
$command = $snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir;
}
exec('ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"', $output, $rc);
} else {
$oid_tree = ['__LEAVES__' => []];
if ($version == '3') {
switch ($snmp3_security_level) {
case 'authPriv':
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
break;
case 'authNoPriv':
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
break;
case 'noAuthNoPriv':
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
break;
}
} else {
exec($snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
}
}
} else {
$oid_tree = ['__LEAVES__' => []];
if ($version == '3') {
switch ($snmp3_security_level) {
case 'authPriv':
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
break;
case 'authNoPriv':
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
break;
case 'noAuthNoPriv':
exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
break;
}
} else {
exec($snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc);
}
}
foreach ($output as $line) {
// Separate the OID from the value
$full_oid = explode('=', $line);
if (! isset($full_oid[1])) {
continue;
}
$oid = trim($full_oid[0]);
$value = trim($full_oid[1]);
// Parse the OID
$group = 0; $group = 0;
$sub_oid = ''; $sub_oid = '';
$ptr = &$oid_tree['__LEAVES__']; $ptr = &$oid_tree['__LEAVES__'];
for ($i = 0; $i < strlen($oid); $i++) { for ($i = 0; $i < $oid_len; $i++) {
// "X.Y.Z" // "X.Y.Z"
if ($oid[$i] == '"') { if ($oid[$i] == '"') {
$group = ($group ^ 1); $group = ($group ^ 1);
} }
// Move to the next element of the OID // Move to the next element of the OID.
if ($group == 0 && ($oid[$i] == '.' || ($oid[$i] == ':' && $oid[($i + 1)] == ':'))) { if ($group == 0 && ($oid[$i] == '.' || ($oid[$i] == ':' && $oid[($i + 1)] == ':'))) {
// Skip the next : // Skip the next ":".
if ($oid[$i] == ':') { if ($oid[$i] == ':') {
$i++; $i++;
} }
// Starting dot // Starting dot.
if ($sub_oid == '') { if ($sub_oid == '') {
continue; continue;
} }
@ -410,7 +319,7 @@ function snmp_browser_get_tree(
} }
} }
// The last element will contain the full OID // The last element will contain the full OID.
$ptr[$sub_oid] = [ $ptr[$sub_oid] = [
'__OID__' => $oid, '__OID__' => $oid,
'__VALUE__' => $value, '__VALUE__' => $value,
@ -459,83 +368,27 @@ function snmp_browser_get_oid(
return; return;
} }
$output = get_snmpwalk(
$target_ip,
$version,
$community,
$snmp3_auth_user,
$snmp3_security_level,
$snmp3_auth_method,
$snmp3_auth_pass,
$snmp3_privacy_method,
$snmp3_privacy_pass,
0,
$target_oid,
'',
$server_to_exec,
'',
'-On'
);
$oid_data['oid'] = $target_oid; $oid_data['oid'] = $target_oid;
if (empty($config['snmpget'])) { foreach ($output as $oid => $value) {
switch (PHP_OS) { $oid = trim($oid);
case 'FreeBSD':
$snmpget_bin = '/usr/local/bin/snmpget';
break;
case 'NetBSD':
$snmpget_bin = '/usr/pkg/bin/snmpget';
break;
default:
$snmpget_bin = 'snmpget';
break;
}
} else {
$snmpget_bin = $config['snmpget'];
}
switch (PHP_OS) {
case 'WIN32':
case 'WINNT':
case 'Windows':
$error_redir_dir = 'NUL';
break;
default:
$error_redir_dir = '/dev/null';
break;
}
if ($server_to_exec != 0) {
$sql = sprintf(
'SELECT ip_address FROM tserver WHERE id_server = %d',
$server_to_exec
);
$server_data = db_get_row_sql($sql);
if ($version == '3') {
$command = $snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir;
} else {
$command = $snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir;
}
exec(
'ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"',
$output,
$rc
);
} else {
if ($version == '3') {
exec(
$snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir,
$output,
$rc
);
} else {
exec(
$snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir,
$output,
$rc
);
}
}
if ($rc != 0) {
return $oid_data;
}
foreach ($output as $line) {
// Separate the OID from the value.
$full_oid = explode('=', $line);
if (! isset($full_oid[1])) {
break;
}
$oid = trim($full_oid[0]);
$oid_data['numeric_oid'] = $oid; $oid_data['numeric_oid'] = $oid;
// Translate the OID. // Translate the OID.
@ -594,16 +447,19 @@ function snmp_browser_get_oid(
$oid_data['description'] = $custom_data['description']; $oid_data['description'] = $custom_data['description'];
} }
$full_value = explode(':', trim($full_oid[1])); $full_value = explode(':', trim($value));
if (! isset($full_value[1])) { if (! isset($full_value[1])) {
$oid_data['value'] = trim($full_oid[1]); $oid_data['value'] = trim($value);
} else { } else {
$oid_data['type'] = trim($full_value[0]); $oid_data['type'] = trim($full_value[0]);
$oid_data['value'] = trim($full_value[1]); $oid_data['value'] = trim($full_value[1]);
} }
return $oid_data; // There should only be one OID.
break;
} }
return $oid_data;
} }

View File

@ -4364,7 +4364,7 @@ function ui_print_agent_autocomplete_input($parameters)
function '.$javascript_on_blur_function_name.'() { function '.$javascript_on_blur_function_name.'() {
input_value = $("#'.$input_id.'").val(); input_value = $("#'.$input_id.'").val();
if (input_value.length == 0) { if (input_value.length < 2) {
if (('.((int) $print_hidden_input_idagent).') if (('.((int) $print_hidden_input_idagent).')
|| ('.((int) $use_hidden_input_idagent).')) { || ('.((int) $use_hidden_input_idagent).')) {
$("#'.$hidden_input_idagent_id.'").val(0); $("#'.$hidden_input_idagent_id.'").val(0);
@ -4415,7 +4415,7 @@ function ui_print_agent_autocomplete_input($parameters)
url: action="'.$javascript_ajax_page.'", url: action="'.$javascript_ajax_page.'",
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.length == 0) { if (data.length < 2) {
//Set icon //Set icon
$("#'.$input_id.'") $("#'.$input_id.'")
.css("background", .css("background",

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,45 @@
/*!
Buttons for DataTables 1.5.6
©2016-2019 SpryMedia Ltd - datatables.net/license
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(d,q,n){d instanceof String&&(d=String(d));for(var l=d.length,u=0;u<l;u++){var p=d[u];if(q.call(n,p,u,d))return{i:u,v:p}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,q,n){d!=Array.prototype&&d!=Object.prototype&&(d[q]=n.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(d,q,n,l){if(q){n=$jscomp.global;d=d.split(".");for(l=0;l<d.length-1;l++){var u=d[l];u in n||(n[u]={});n=n[u]}d=d[d.length-1];l=n[d];q=q(l);q!=l&&null!=q&&$jscomp.defineProperty(n,d,{configurable:!0,writable:!0,value:q})}};$jscomp.polyfill("Array.prototype.find",function(d){return d?d:function(d,n){return $jscomp.findInternal(this,d,n).v}},"es6","es3");
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(q){return d(q,window,document)}):"object"===typeof exports?module.exports=function(q,n){q||(q=window);n&&n.fn.dataTable||(n=require("datatables.net")(q,n).$);return d(n,q,q.document)}:d(jQuery,window,document)})(function(d,q,n,l){function u(a){a=new p.Api(a);var b=a.init().buttons||p.defaults.buttons;return(new t(a,b)).container()}var p=d.fn.dataTable,B=0,C=0,r=p.ext.buttons,t=function(a,b){if(!(this instanceof
t))return function(b){return(new t(b,a)).container()};"undefined"===typeof b&&(b={});!0===b&&(b={});d.isArray(b)&&(b={buttons:b});this.c=d.extend(!0,{},t.defaults,b);b.buttons&&(this.c.buttons=b.buttons);this.s={dt:new p.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+B++};this.dom={container:d("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)};this._constructor()};d.extend(t.prototype,{action:function(a,b){a=this._nodeToButton(a);if(b===l)return a.conf.action;a.conf.action=
b;return this},active:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.button.active;c=d(c.node);if(b===l)return c.hasClass(a);c.toggleClass(a,b===l?!0:b);return this},add:function(a,b){var c=this.s.buttons;if("string"===typeof b){b=b.split("-");c=this.s;for(var d=0,f=b.length-1;d<f;d++)c=c.buttons[1*b[d]];c=c.buttons;b=1*b[b.length-1]}this._expandButton(c,a,!1,b);this._draw();return this},container:function(){return this.dom.container},disable:function(a){a=this._nodeToButton(a);d(a.node).addClass(this.c.dom.button.disabled);
return this},destroy:function(){d("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b;var c=0;for(b=a.length;c<b;c++)this.remove(a[c].node);this.dom.container.remove();a=this.s.dt.settings()[0];c=0;for(b=a.length;c<b;c++)if(a.inst===this){a.splice(c,1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);a=this._nodeToButton(a);d(a.node).removeClass(this.c.dom.button.disabled);return this},name:function(){return this.c.name},node:function(a){if(!a)return this.dom.container;
a=this._nodeToButton(a);return d(a.node)},processing:function(a,b){a=this._nodeToButton(a);if(b===l)return d(a.node).hasClass("processing");d(a.node).toggleClass("processing",b);return this},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),e=this.s.dt;if(b.buttons.length)for(var f=b.buttons.length-1;0<=f;f--)this.remove(b.buttons[f].node);b.conf.destroy&&b.conf.destroy.call(e.button(a),e,d(a),b.conf);this._removeKey(b.conf);d(b.node).remove();a=d.inArray(b,c);c.splice(a,1);return this},
text:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.collection.buttonLiner;a=c.inCollection&&a&&a.tag?a.tag:this.c.dom.buttonLiner.tag;var e=this.s.dt,f=d(c.node),g=function(a){return"function"===typeof a?a(e,f,c.conf):a};if(b===l)return g(c.conf.text);c.conf.text=b;a?f.children(a).html(g(b)):f.html(g(b));return this},_constructor:function(){var a=this,b=this.s.dt,c=b.settings()[0],e=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var f=0,g=e.length;f<
g;f++)this.add(e[f]);b.on("destroy",function(b,d){d===c&&a.destroy()});d("body").on("keyup."+this.s.namespace,function(b){if(!n.activeElement||n.activeElement===n.body){var c=String.fromCharCode(b.keyCode).toLowerCase();-1!==a.s.listenKeys.toLowerCase().indexOf(c)&&a._keypress(c,b)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=d.isPlainObject(a.key)?a.key.key:a.key)},_draw:function(a,b){a||(a=this.dom.container,b=this.s.buttons);a.children().detach();for(var c=0,d=b.length;c<d;c++)a.append(b[c].inserter),
a.append(" "),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,e){var f=this.s.dt,g=0;b=d.isArray(b)?b:[b];for(var h=0,k=b.length;h<k;h++){var v=this._resolveExtends(b[h]);if(v)if(d.isArray(v))this._expandButton(a,v,c,e);else{var m=this._buildButton(v,c);if(m){e!==l?(a.splice(e,0,m),e++):a.push(m);if(m.conf.buttons){var y=this.c.dom.collection;m.collection=d("<"+y.tag+"/>").addClass(y.className).attr("role","menu");m.conf._collection=m.collection;
this._expandButton(m.buttons,m.conf.buttons,!0,e)}v.init&&v.init.call(f.button(m.node),f,d(m.node),v);g++}}}},_buildButton:function(a,b){var c=this.c.dom.button,e=this.c.dom.buttonLiner,f=this.c.dom.collection,g=this.s.dt,h=function(b){return"function"===typeof b?b(g,m,a):b};b&&f.button&&(c=f.button);b&&f.buttonLiner&&(e=f.buttonLiner);if(a.available&&!a.available(g,a))return!1;var k=function(a,b,c,e){e.action.call(b.button(c),a,b,c,e);d(b.table().node()).triggerHandler("buttons-action.dt",[b.button(c),
b,c,e])};f=a.tag||c.tag;var v=a.clickBlurs===l?!0:a.clickBlurs,m=d("<"+f+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(b){b.preventDefault();!m.hasClass(c.disabled)&&a.action&&k(b,g,m,a);v&&m.blur()}).on("keyup.dtb",function(b){13===b.keyCode&&!m.hasClass(c.disabled)&&a.action&&k(b,g,m,a)});"a"===f.toLowerCase()&&m.attr("href","#");"button"===f.toLowerCase()&&m.attr("type","button");e.tag?(f=
d("<"+e.tag+"/>").html(h(a.text)).addClass(e.className),"a"===e.tag.toLowerCase()&&f.attr("href","#"),m.append(f)):m.html(h(a.text));!1===a.enabled&&m.addClass(c.disabled);a.className&&m.addClass(a.className);a.titleAttr&&m.attr("title",h(a.titleAttr));a.attr&&m.attr(a.attr);a.namespace||(a.namespace=".dt-button-"+C++);e=(e=this.c.dom.buttonContainer)&&e.tag?d("<"+e.tag+"/>").addClass(e.className).append(m):m;this._addKey(a);this.c.buttonCreated&&(e=this.c.buttonCreated(a,e));return{conf:a,node:m.get(0),
inserter:e,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b[c];if(b[c].buttons.length){var f=this._nodeToButton(a,b[c].buttons);if(f)return f}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var f=this._nodeToHost(a,b[c].buttons);if(f)return f}}},_keypress:function(a,b){if(!b._buttonsHandled){var c=function(e){for(var f=
0,g=e.length;f<g;f++){var h=e[f].conf,k=e[f].node;h.key&&(h.key===a?(b._buttonsHandled=!0,d(k).click()):!d.isPlainObject(h.key)||h.key.key!==a||h.key.shiftKey&&!b.shiftKey||h.key.altKey&&!b.altKey||h.key.ctrlKey&&!b.ctrlKey||h.key.metaKey&&!b.metaKey||(b._buttonsHandled=!0,d(k).click()));e[f].buttons.length&&c(e[f].buttons)}};c(this.s.buttons)}},_removeKey:function(a){if(a.key){var b=d.isPlainObject(a.key)?a.key.key:a.key;a=this.s.listenKeys.split("");b=d.inArray(b,a);a.splice(b,1);this.s.listenKeys=
a.join("")}},_resolveExtends:function(a){var b=this.s.dt,c,e=function(c){for(var e=0;!d.isPlainObject(c)&&!d.isArray(c);){if(c===l)return;if("function"===typeof c){if(c=c(b,a),!c)return!1}else if("string"===typeof c){if(!r[c])throw"Unknown button type: "+c;c=r[c]}e++;if(30<e)throw"Buttons: Too many iterations";}return d.isArray(c)?c:d.extend({},c)};for(a=e(a);a&&a.extend;){if(!r[a.extend])throw"Cannot extend unknown button type: "+a.extend;var f=e(r[a.extend]);if(d.isArray(f))return f;if(!f)return!1;
var g=f.className;a=d.extend({},f,a);g&&a.className!==g&&(a.className=g+" "+a.className);var h=a.postfixButtons;if(h){a.buttons||(a.buttons=[]);g=0;for(c=h.length;g<c;g++)a.buttons.push(h[g]);a.postfixButtons=null}if(h=a.prefixButtons){a.buttons||(a.buttons=[]);g=0;for(c=h.length;g<c;g++)a.buttons.splice(g,0,h[g]);a.prefixButtons=null}a.extend=f.extend}return a}});t.background=function(a,b,c,e){c===l&&(c=400);e||(e=n.body);a?d("<div/>").addClass(b).css("display","none").insertAfter(e).stop().fadeIn(c):
d("div."+b).stop().fadeOut(c,function(){d(this).removeClass(b).remove()})};t.instanceSelector=function(a,b){if(!a)return d.map(b,function(a){return a.inst});var c=[],e=d.map(b,function(a){return a.name}),f=function(a){if(d.isArray(a))for(var g=0,k=a.length;g<k;g++)f(a[g]);else"string"===typeof a?-1!==a.indexOf(",")?f(a.split(",")):(a=d.inArray(d.trim(a),e),-1!==a&&c.push(b[a].inst)):"number"===typeof a&&c.push(b[a].inst)};f(a);return c};t.buttonSelector=function(a,b){for(var c=[],e=function(a,b,c){for(var d,
f,g=0,k=b.length;g<k;g++)if(d=b[g])f=c!==l?c+g:g+"",a.push({node:d.node,name:d.conf.name,idx:f}),d.buttons&&e(a,d.buttons,f+"-")},f=function(a,b){var g,h=[];e(h,b.s.buttons);var k=d.map(h,function(a){return a.node});if(d.isArray(a)||a instanceof d)for(k=0,g=a.length;k<g;k++)f(a[k],b);else if(null===a||a===l||"*"===a)for(k=0,g=h.length;k<g;k++)c.push({inst:b,node:h[k].node});else if("number"===typeof a)c.push({inst:b,node:b.s.buttons[a].node});else if("string"===typeof a)if(-1!==a.indexOf(","))for(h=
a.split(","),k=0,g=h.length;k<g;k++)f(d.trim(h[k]),b);else if(a.match(/^\d+(\-\d+)*$/))k=d.map(h,function(a){return a.idx}),c.push({inst:b,node:h[d.inArray(a,k)].node});else if(-1!==a.indexOf(":name"))for(a=a.replace(":name",""),k=0,g=h.length;k<g;k++)h[k].name===a&&c.push({inst:b,node:h[k].node});else d(k).filter(a).each(function(){c.push({inst:b,node:this})});else"object"===typeof a&&a.nodeName&&(h=d.inArray(a,k),-1!==h&&c.push({inst:b,node:k[h]}))},g=0,h=a.length;g<h;g++)f(b,a[g]);return c};t.defaults=
{buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:"dt-button-collection"},button:{tag:"ActiveXObject"in q?"a":"button",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}};t.version="1.5.6";d.extend(r,{collection:{text:function(a){return a.i18n("buttons.collection","Collection")},className:"buttons-collection",init:function(a,b,c){b.attr("aria-expanded",
!1)},action:function(a,b,c,e){var f=function(){b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes().each(function(){var a=d(this).siblings(".dt-button-collection");a.length&&a.stop().fadeOut(e.fade,function(){a.detach()});d(this).attr("aria-expanded","false")});d("div.dt-button-background").off("click.dtb-collection");t.background(!1,e.backgroundClassName,e.fade,l);d("body").off(".dtb-collection");b.off("buttons-action.b-internal")};a="true"===c.attr("aria-expanded");f();if(!a){var g=
d(c).parents("div.dt-button-collection");a=c.position();var h=d(b.table().container()),k=!1,l=c;c.attr("aria-expanded","true");g.length&&(k=d(".dt-button-collection").position(),l=g,d("body").trigger("click.dtb-collection"));l.parents("body")[0]!==n.body&&(l=n.body.lastChild);e._collection.find(".dt-button-collection-title").remove();e._collection.prepend('<div class="dt-button-collection-title">'+e.collectionTitle+"</div>");e._collection.addClass(e.collectionLayout).css("display","none").insertAfter(l).stop().fadeIn(e.fade);
g=e._collection.css("position");if(k&&"absolute"===g)e._collection.css({top:k.top,left:k.left});else if("absolute"===g){e._collection.css({top:a.top+c.outerHeight(),left:a.left});k=h.offset().top+h.height();k=a.top+c.outerHeight()+e._collection.outerHeight()-k;g=a.top-e._collection.outerHeight();var m=h.offset().top;(k>m-g||e.dropup)&&e._collection.css("top",a.top-e._collection.outerHeight()-5);e._collection.hasClass(e.rightAlignClassName)&&e._collection.css("left",a.left+c.outerWidth()-e._collection.outerWidth());
k=a.left+e._collection.outerWidth();h=h.offset().left+h.width();k>h&&e._collection.css("left",a.left-(k-h));c=c.offset().left+e._collection.outerWidth();c>d(q).width()&&e._collection.css("left",a.left-(c-d(q).width()))}else c=e._collection.height()/2,c>d(q).height()/2&&(c=d(q).height()/2),e._collection.css("marginTop",-1*c);e.background&&t.background(!0,e.backgroundClassName,e.fade,l);setTimeout(function(){d("div.dt-button-background").on("click.dtb-collection",function(){});d("body").on("click.dtb-collection",
function(a){var b=d.fn.addBack?"addBack":"andSelf";d(a.target).parents()[b]().filter(e._collection).length||f()}).on("keyup.dtb-collection",function(a){27===a.keyCode&&f()});if(e.autoClose)b.on("buttons-action.b-internal",function(){f()})},10)}},background:!0,collectionLayout:"",collectionTitle:"",backgroundClassName:"dt-button-background",rightAlignClassName:"dt-button-right",autoClose:!1,fade:400,attr:{"aria-haspopup":!0}},copy:function(a,b){if(r.copyHtml5)return"copyHtml5";if(r.copyFlash&&r.copyFlash.available(a,
b))return"copyFlash"},csv:function(a,b){if(r.csvHtml5&&r.csvHtml5.available(a,b))return"csvHtml5";if(r.csvFlash&&r.csvFlash.available(a,b))return"csvFlash"},excel:function(a,b){if(r.excelHtml5&&r.excelHtml5.available(a,b))return"excelHtml5";if(r.excelFlash&&r.excelFlash.available(a,b))return"excelFlash"},pdf:function(a,b){if(r.pdfHtml5&&r.pdfHtml5.available(a,b))return"pdfHtml5";if(r.pdfFlash&&r.pdfFlash.available(a,b))return"pdfFlash"},pageLength:function(a){a=a.settings()[0].aLengthMenu;var b=d.isArray(a[0])?
a[0]:a,c=d.isArray(a[0])?a[1]:a;return{extend:"collection",text:function(a){return a.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},a.page.len())},className:"buttons-page-length",autoClose:!0,buttons:d.map(b,function(a,b){return{text:c[b],className:"button-page-length",action:function(b,c){c.page.len(a).draw()},init:function(b,c,d){var e=this;c=function(){e.active(b.page.len()===a)};b.on("length.dt"+d.namespace,c);c()},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}),
init:function(a,b,c){var d=this;a.on("length.dt"+c.namespace,function(){d.text(c.text)})},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}});p.Api.register("buttons()",function(a,b){b===l&&(b=a,a=l);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(c){if(c._buttons)return t.buttonSelector(t.instanceSelector(a,c._buttons),b)},!0);c._groupSelector=a;return c});p.Api.register("button()",function(a,b){a=this.buttons(a,b);1<a.length&&a.splice(1,a.length);return a});p.Api.registerPlural("buttons().active()",
"button().active()",function(a){return a===l?this.map(function(a){return a.inst.active(a.node)}):this.each(function(b){b.inst.active(b.node,a)})});p.Api.registerPlural("buttons().action()","button().action()",function(a){return a===l?this.map(function(a){return a.inst.action(a.node)}):this.each(function(b){b.inst.action(b.node,a)})});p.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,a)})});p.Api.register(["buttons().disable()",
"button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});p.Api.registerPlural("buttons().nodes()","button().node()",function(){var a=d();d(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});p.Api.registerPlural("buttons().processing()","button().processing()",function(a){return a===l?this.map(function(a){return a.inst.processing(a.node)}):this.each(function(b){b.inst.processing(b.node,a)})});p.Api.registerPlural("buttons().text()","button().text()",function(a){return a===
l?this.map(function(a){return a.inst.text(a.node)}):this.each(function(b){b.inst.text(b.node,a)})});p.Api.registerPlural("buttons().trigger()","button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});p.Api.registerPlural("buttons().containers()","buttons().container()",function(){var a=d(),b=this._groupSelector;this.iterator(!0,"table",function(c){if(c._buttons){c=t.instanceSelector(b,c._buttons);for(var d=0,f=c.length;d<f;d++)a=a.add(c[d].container())}});
return a});p.Api.register("button().add()",function(a,b){var c=this.context;c.length&&(c=t.instanceSelector(this._groupSelector,c[0]._buttons),c.length&&c[0].add(b,a));return this.button(this._groupSelector,a)});p.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});return this});p.Api.registerPlural("buttons().remove()","buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var w;p.Api.register("buttons.info()",
function(a,b,c){var e=this;if(!1===a)return d("#datatables_buttons_info").fadeOut(function(){d(this).remove()}),clearTimeout(w),w=null,this;w&&clearTimeout(w);d("#datatables_buttons_info").length&&d("#datatables_buttons_info").remove();a=a?"<h2>"+a+"</h2>":"";d('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a).append(d("<div/>")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body").fadeIn();c!==l&&0!==c&&(w=setTimeout(function(){e.buttons.info(!1)},c));
return this});p.Api.register("buttons.exportData()",function(a){if(this.context.length)return D(new p.Api(this.context[0]),a)});p.Api.register("buttons.exportInfo()",function(a){a||(a={});var b=a;var c="*"===b.filename&&"*"!==b.title&&b.title!==l&&null!==b.title&&""!==b.title?b.title:b.filename;"function"===typeof c&&(c=c());c===l||null===c?c=null:(-1!==c.indexOf("*")&&(c=d.trim(c.replace("*",d("head > title").text()))),c=c.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""),(b=x(b.extension))||
(b=""),c+=b);b=x(a.title);b=null===b?null:-1!==b.indexOf("*")?b.replace("*",d("head > title").text()||"Exported data"):b;return{filename:c,title:b,messageTop:z(this,a.message||a.messageTop,"top"),messageBottom:z(this,a.messageBottom,"bottom")}});var x=function(a){return null===a||a===l?null:"function"===typeof a?a():a},z=function(a,b,c){b=x(b);if(null===b)return null;a=d("caption",a.table().container()).eq(0);return"*"===b?a.css("caption-side")!==c?null:a.length?a.text():"":b},A=d("<textarea/>")[0],
D=function(a,b){var c=d.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(a){return e(a)},footer:function(a){return e(a)},body:function(a){return e(a)}},customizeData:null},b),e=function(a){if("string"!==typeof a)return a;a=a.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");a=a.replace(/<!\-\-.*?\-\->/g,"");c.stripHtml&&(a=a.replace(/<[^>]*>/g,""));c.trim&&
(a=a.replace(/^\s+|\s+$/g,""));c.stripNewlines&&(a=a.replace(/\n/g," "));c.decodeEntities&&(A.innerHTML=a,a=A.value);return a};b=a.columns(c.columns).indexes().map(function(b){var d=a.column(b).header();return c.format.header(d.innerHTML,b,d)}).toArray();var f=a.table().footer()?a.columns(c.columns).indexes().map(function(b){var d=a.column(b).footer();return c.format.footer(d?d.innerHTML:"",b,d)}).toArray():null,g=d.extend({},c.modifier);a.select&&"function"===typeof a.select.info&&g.selected===l&&
a.rows(c.rows,d.extend({selected:!0},g)).any()&&d.extend(g,{selected:!0});g=a.rows(c.rows,g).indexes().toArray();var h=a.cells(g,c.columns);g=h.render(c.orthogonal).toArray();h=h.nodes().toArray();for(var k=b.length,p=[],m=0,n=0,q=0<k?g.length/k:0;n<q;n++){for(var t=[k],r=0;r<k;r++)t[r]=c.format.body(g[m],n,r,h[m]),m++;p[n]=t}b={header:b,footer:f,body:p};c.customizeData&&c.customizeData(b);return b};d.fn.dataTable.Buttons=t;d.fn.DataTable.Buttons=t;d(n).on("init.dt plugin-init.dt",function(a,b){"dt"===
a.namespace&&(a=b.oInit.buttons||p.defaults.buttons)&&!b._buttons&&(new t(b,a)).container()});p.ext.feature.push({fnInit:u,cFeature:"B"});p.ext.features&&p.ext.features.register("buttons",u);return t});

View File

@ -624,7 +624,10 @@ var TreeController = {
'images/tree_service_map.png" /> ' 'images/tree_service_map.png" /> '
); );
if (typeof element.serviceDetail != "undefined") { if (
typeof element.serviceDetail != "undefined" &&
element.name != null
) {
$serviceDetailImage $serviceDetailImage
.click(function(e) { .click(function(e) {
e.preventDefault(); e.preventDefault();
@ -634,10 +637,11 @@ var TreeController = {
.css("cursor", "pointer"); .css("cursor", "pointer");
$content.append($serviceDetailImage); $content.append($serviceDetailImage);
$content.append(" " + element.name);
} else {
$content.remove($node);
} }
$content.append(" " + element.name);
break; break;
case "modules": case "modules":
if ( if (

View File

@ -207,11 +207,7 @@ final class ModuleGraph extends Item
// Custom graph. // Custom graph.
if (empty($customGraphId) === false) { if (empty($customGraphId) === false) {
$customGraph = \db_get_row_filter( $customGraph = \db_get_row('tgraph', 'id_graph', $customGraphId);
'tgraph',
'id_graph',
$customGraphId
);
$params = [ $params = [
'period' => $period, 'period' => $period,

File diff suppressed because one or more lines are too long

View File

@ -6105,3 +6105,30 @@ div#status_pie {
.white_table_no_border { .white_table_no_border {
border: none !important; border: none !important;
} }
/*
* ---------------------------------------------------------------------
* - SERVICES TABLE VIEW
* ---------------------------------------------------------------------
*/
#table_services {
display: grid;
grid-gap: 20px;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
grid-template-rows: 1fr;
margin-bottom: 30px;
}
.table_services_item_link {
font-size: 16px;
display: grid;
min-height: 80px;
box-sizing: border-box;
padding: 10px 10px 10px 0;
}
.table_services_item {
display: grid;
align-items: center;
grid-template-columns: 50px auto;
}

View File

@ -129,7 +129,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.735'; $version = '7.0NG.735';
$build = '190604'; $build = '190612';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -1389,6 +1389,34 @@ if (!empty($result)) {
true true
); );
} }
} else if ($row['estado'] == 3) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_UNKNOWN,
__('UNKNOWN').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
true
);
} else {
$data[6] = ui_print_status_image(
STATUS_MODULE_UNKNOWN,
__('UNKNOWN').': '.$row['datos'],
true
);
}
} else if ($row['estado'] == 4) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_NO_DATA,
__('NO DATA').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
true
);
} else {
$data[6] = ui_print_status_image(
STATUS_MODULE_NO_DATA,
__('NO DATA').': '.$row['datos'],
true
);
}
} else { } else {
$last_status = modules_get_agentmodule_last_status( $last_status = modules_get_agentmodule_last_status(
$row['id_agente_modulo'] $row['id_agente_modulo']

View File

@ -616,7 +616,11 @@ foreach ($timezones as $timezone_name => $tz) {
} }
} }
echo '<form name="user_mod" method="post" action="'.ui_get_full_url('index.php?sec=workspace&sec2=operation/users/user_edit').'&amp;modified=1&amp;id='.$id.'&amp;pure='.$config['pure'].'">'; if (is_metaconsole()) {
echo '<form name="user_mod" method="post" action="'.ui_get_full_url('index.php?sec=advanced&sec2=advanced/users_setup').'&amp;tab=user_edit&amp;modified=1&amp;id='.$id.'&amp;pure='.$config['pure'].'">';
} else {
echo '<form name="user_mod" method="post" action="'.ui_get_full_url('index.php?sec=workspace&sec2=operation/users/user_edit').'&amp;modified=1&amp;id='.$id.'&amp;pure='.$config['pure'].'">';
}
echo '<div id="user_form"> echo '<div id="user_form">
<div class="user_edit_first_row"> <div class="user_edit_first_row">

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190604 %define release 190612
# 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 7.0NG.735 %define version 7.0NG.735
%define release 190604 %define release 190612
# 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 7.0NG.735 %define version 7.0NG.735
%define release 190604 %define release 190612
%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

@ -270,7 +270,6 @@ INSERT INTO `ttipo_modulo` VALUES
(21,'async_proc', 7, 'Asyncronous proc data', 'mod_async_proc.png'), (21,'async_proc', 7, 'Asyncronous proc data', 'mod_async_proc.png'),
(22,'async_data', 6, 'Asyncronous numeric data', 'mod_async_data.png'), (22,'async_data', 6, 'Asyncronous numeric data', 'mod_async_data.png'),
(23,'async_string', 8, 'Asyncronous string data', 'mod_async_string.png'), (23,'async_string', 8, 'Asyncronous string data', 'mod_async_string.png'),
(24,'log4x',0,'Log4x','mod_log4x.png'),
(25,'web_analysis', 8, 'Web analysis data', 'module-wux.png'), (25,'web_analysis', 8, 'Web analysis data', 'module-wux.png'),
(30,'web_data',9,'Remote HTTP module to check latency','mod_web_data.png'), (30,'web_data',9,'Remote HTTP module to check latency','mod_web_data.png'),
(31,'web_proc',9,'Remote HTTP module to check server response','mod_web_proc.png'), (31,'web_proc',9,'Remote HTTP module to check server response','mod_web_proc.png'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.735-190604 Version: 7.0NG.735-190612
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="7.0NG.735-190604" pandora_version="7.0NG.735-190612"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -45,7 +45,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 = "7.0NG.735"; my $pandora_version = "7.0NG.735";
my $pandora_build = "190604"; my $pandora_build = "190612";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -4859,32 +4859,36 @@ sub pandora_process_policy_queue ($) {
logger($pa_config, "Starting policy queue patrol process.", 1); logger($pa_config, "Starting policy queue patrol process.", 1);
while($THRRUN == 1) { while($THRRUN == 1) {
eval {{
local $SIG{__DIE__};
# If we are not the master server sleep and check again. # If we are not the master server sleep and check again.
if (pandora_is_master($pa_config) == 0) { if (pandora_is_master($pa_config) == 0) {
sleep ($pa_config->{'server_threshold'}); sleep ($pa_config->{'server_threshold'});
next; next;
} }
my $operation = enterprise_hook('get_first_policy_queue', [$dbh]);
next unless (defined ($operation) && $operation ne '');
if($operation->{'operation'} eq 'apply' || $operation->{'operation'} eq 'apply_db') {
enterprise_hook('pandora_apply_policy', [$dbh, $pa_config, $operation->{'id_policy'}, $operation->{'id_agent'}, $operation->{'id'}, $operation->{'operation'}]);
}
elsif($operation->{'operation'} eq 'delete') {
if($operation->{'id_agent'} == 0) {
enterprise_hook('pandora_purge_policy_agents', [$dbh, $pa_config, $operation->{'id_policy'}]);
}
else {
enterprise_hook('pandora_delete_agent_from_policy', [$dbh, $pa_config, $operation->{'id_policy'}, $operation->{'id_agent'}]);
}
}
enterprise_hook('pandora_finish_queue_operation', [$dbh, $operation->{'id'}]);
}};
# Check the queue each 5 seconds # Check the queue each 5 seconds
sleep (5); sleep(5);
my $operation = enterprise_hook('get_first_policy_queue', [$dbh]);
next unless (defined ($operation) && $operation ne '');
if($operation->{'operation'} eq 'apply' || $operation->{'operation'} eq 'apply_db') {
enterprise_hook('pandora_apply_policy', [$dbh, $pa_config, $operation->{'id_policy'}, $operation->{'id_agent'}, $operation->{'id'}, $operation->{'operation'}]);
}
elsif($operation->{'operation'} eq 'delete') {
if($operation->{'id_agent'} == 0) {
enterprise_hook('pandora_purge_policy_agents', [$dbh, $pa_config, $operation->{'id_policy'}]);
}
else {
enterprise_hook('pandora_delete_agent_from_policy', [$dbh, $pa_config, $operation->{'id_policy'}, $operation->{'id_agent'}]);
}
}
enterprise_hook('pandora_finish_queue_operation', [$dbh, $operation->{'id'}]);
} }
db_disconnect($dbh); db_disconnect($dbh);

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# 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 = "7.0NG.735"; my $pandora_version = "7.0NG.735";
my $pandora_build = "190604"; my $pandora_build = "190612";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -29,6 +29,7 @@ use Sys::Syslog;
use Scalar::Util qw(looks_like_number); use Scalar::Util qw(looks_like_number);
use LWP::UserAgent; use LWP::UserAgent;
use threads; use threads;
use threads::shared;
# New in 3.2. Used to sendmail internally, without external scripts # New in 3.2. Used to sendmail internally, without external scripts
# use Module::Loaded; # use Module::Loaded;
@ -1864,7 +1865,7 @@ sub stop_server_threads {
$THRRUN = 0; $THRRUN = 0;
foreach my $thr (@ServerThreads) { foreach my $thr (@ServerThreads) {
$thr->detach(); $thr->join();
} }
@ServerThreads = (); @ServerThreads = ();

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190604 %define release 190612
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 7.0NG.735 %define version 7.0NG.735
%define release 190604 %define release 190612
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.735" PI_VERSION="7.0NG.735"
PI_BUILD="190604" PI_BUILD="190612"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.735 PS190604"; my $version = "7.0NG.735 PS190612";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.735 PS190604"; my $version = "7.0NG.735 PS190612";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);