update branch

This commit is contained in:
marcos 2019-11-18 18:46:57 +01:00
commit 76b7e52107
34 changed files with 311 additions and 212 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.740-191113 Version: 7.0NG.740-191118
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.740-191113" pandora_version="7.0NG.740-191118"
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.740'; use constant AGENT_VERSION => '7.0NG.740';
use constant AGENT_BUILD => '191113'; use constant AGENT_BUILD => '191118';
# 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;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.740 %define version 7.0NG.740
%define release 191113 %define release 191118
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.740 %define version 7.0NG.740
%define release 191113 %define release 191118
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.740" PI_VERSION="7.0NG.740"
PI_BUILD="191113" PI_BUILD="191118"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

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

View File

@ -8,6 +8,10 @@ INSERT INTO `ttipo_modulo` VALUES
(36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'), (36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'),
(37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png'); (37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png');
<<<<<<< HEAD
ALTER TABLE `tcredential_store` MODIFY COLUMN `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM'; ALTER TABLE `tcredential_store` MODIFY COLUMN `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM';
=======
INSERT INTO `tconfig`(`token`, `value`) VALUES ('welcome_state', -1);
>>>>>>> origin/develop
COMMIT; COMMIT;

View File

@ -348,7 +348,7 @@ if ($config['menu_type'] == 'classic') {
// Support. // Support.
if (defined('PANDORA_ENTERPRISE')) { if (enterprise_installed()) {
$header_support_link = $config['custom_support_url']; $header_support_link = $config['custom_support_url'];
} else { } else {
$header_support_link = 'https://pandorafms.com/forums/'; $header_support_link = 'https://pandorafms.com/forums/';
@ -635,12 +635,6 @@ if ($config['menu_type'] == 'classic') {
* Loads modal from AJAX to add feedback. * Loads modal from AJAX to add feedback.
*/ */
function show_feedback() { function show_feedback() {
<?php
// Require specific CSS and JS.
ui_require_css_file('wizard');
ui_require_css_file('discovery');
ui_require_css_file('diagnostics');
?>
var btn_ok_text = '<?php echo __('Send'); ?>'; var btn_ok_text = '<?php echo __('Send'); ?>';
var btn_cancel_text = '<?php echo __('Cancel'); ?>'; var btn_cancel_text = '<?php echo __('Cancel'); ?>';
var title = '<?php echo __('Report an issue'); ?>'; var title = '<?php echo __('Report an issue'); ?>';
@ -719,13 +713,15 @@ if ($config['menu_type'] == 'classic') {
$("#agent_access").css("display",""); $("#agent_access").css("display","");
}); });
// Feedback. <?php if (enterprise_installed()) { ?>
$("#feedback-header").click(function () { // Feedback.
// Clean DOM. $("#feedback-header").click(function () {
$("#feedback-header").empty(); // Clean DOM.
// Function charge Modal. $("#feedback-header").empty();
show_feedback(); // Function charge Modal.
}); show_feedback();
});
<?php } ?>
function blinkpubli(){ function blinkpubli(){
$(".publienterprise").delay(100).fadeTo(300,0.2).delay(100).fadeTo(300,1, blinkpubli); $(".publienterprise").delay(100).fadeTo(300,0.2).delay(100).fadeTo(300,1, blinkpubli);

View File

@ -70,6 +70,7 @@ class Diagnostics extends Wizard
$this->ajaxController = $page; $this->ajaxController = $page;
$this->pdf = $pdf; $this->pdf = $pdf;
$this->product_name = io_safe_output(get_product_name());
} }
@ -126,7 +127,7 @@ class Diagnostics extends Wizard
// Header. // Header.
ui_print_page_header( ui_print_page_header(
__('Pandora FMS Diagnostic tool'), __('%s Diagnostic tool', $this->product_name),
'images/gm_massive_operations.png', 'images/gm_massive_operations.png',
false, false,
'diagnostic_tool_tab', 'diagnostic_tool_tab',
@ -190,7 +191,7 @@ class Diagnostics extends Wizard
foreach ($infoMethods as $key => $method) { foreach ($infoMethods as $key => $method) {
switch ($method) { switch ($method) {
case 'getStatusInfo': case 'getStatusInfo':
$title = __('Info status pandoraFms'); $title = __('Info status %s', $this->product_name);
break; break;
case 'getPHPSetup': case 'getPHPSetup':
@ -219,16 +220,17 @@ class Diagnostics extends Wizard
case 'getTablesFragmentation': case 'getTablesFragmentation':
$title = __( $title = __(
'Tables fragmentation in the Pandora FMS database' 'Tables fragmentation in the %s database',
$this->product_name
); );
break; break;
case 'getPandoraFMSLogsDates': case 'getPandoraFMSLogsDates':
$title = __('Pandora FMS logs dates'); $title = __('%s logs dates', $this->product_name);
break; break;
case 'getLicenceInformation': case 'getLicenceInformation':
$title = __('Pandora FMS Licence Information'); $title = __('%s Licence Information', $this->product_name);
break; break;
case 'getAttachmentFolder': case 'getAttachmentFolder':
@ -240,7 +242,7 @@ class Diagnostics extends Wizard
break; break;
case 'getServerThreads': case 'getServerThreads':
$title = __('Pandora FMS server threads'); $title = __('%s server threads', $this->product_name);
break; break;
case 'getShowEngine': case 'getShowEngine':
@ -399,11 +401,11 @@ class Diagnostics extends Wizard
'error' => false, 'error' => false,
'data' => [ 'data' => [
'buildVersion' => [ 'buildVersion' => [
'name' => __('Pandora FMS Build'), 'name' => __('%s Build', $this->product_name),
'value' => $build_version, 'value' => $build_version,
], ],
'version' => [ 'version' => [
'name' => __('Pandora FMS Version'), 'name' => __('%s Version', $this->product_name),
'value' => $pandora_version, 'value' => $pandora_version,
], ],
'mr' => [ 'mr' => [
@ -512,7 +514,7 @@ class Diagnostics extends Wizard
'error' => false, 'error' => false,
'data' => [ 'data' => [
'countAgents' => [ 'countAgents' => [
'name' => __('Total agentsy'), 'name' => __('Total agents'),
'value' => $countAgents, 'value' => $countAgents,
], ],
'countModules' => [ 'countModules' => [
@ -586,7 +588,10 @@ class Diagnostics extends Wizard
$pandoraDbLastRun = __('Pandora DB has never been executed'); $pandoraDbLastRun = __('Pandora DB has never been executed');
if ($dateDbMantenaince !== false) { if ($dateDbMantenaince !== false) {
$difference = ($currentTime - $dateDbMantenaince); $difference = ($currentTime - $dateDbMantenaince);
$pandoraDbLastRun = human_time_comparation($difference); $pandoraDbLastRun = human_time_description_raw(
$difference,
true
);
$pandoraDbLastRun .= ' '.__('Ago'); $pandoraDbLastRun .= ' '.__('Ago');
} }
@ -602,7 +607,7 @@ class Diagnostics extends Wizard
'value' => $notInitAgents, 'value' => $notInitAgents,
], ],
'pandoraDbLastRun' => [ 'pandoraDbLastRun' => [
'name' => __('PandoraDB Last run'), 'name' => __('Pandora DB Last run'),
'value' => $pandoraDbLastRun, 'value' => $pandoraDbLastRun,
], ],
], ],
@ -671,17 +676,54 @@ class Diagnostics extends Wizard
$cpuProcessor = 'cat /proc/cpuinfo | grep "processor" | wc -l'; $cpuProcessor = 'cat /proc/cpuinfo | grep "processor" | wc -l';
$ramMemTotal = 'cat /proc/meminfo | grep "MemTotal"'; $ramMemTotal = 'cat /proc/meminfo | grep "MemTotal"';
exec(
"ifconfig | awk '{ print $2}' | grep -E -o '([0-9]{1,3}[\.]){3}[0-9]{1,3}'",
$output
);
$ips = implode(', ', $output);
$result = [ $result = [
'error' => false, 'error' => false,
'data' => [ 'data' => [
'cpuInfo' => [ 'cpuInfo' => [
'name' => __('CPU'), 'name' => __('CPU'),
'value' => exec($cpuModelName).' x '.exec($cpuProcessor), 'value' => exec($cpuModelName).' x '.exec($cpuProcessor),
], ],
'ramInfo' => [ 'ramInfo' => [
'name' => __('RAM'), 'name' => __('RAM'),
'value' => exec($ramMemTotal), 'value' => exec($ramMemTotal),
], ],
'osInfo' => [
'name' => __('Os'),
'value' => exec('uname -a'),
],
'hostnameInfo' => [
'name' => __('Hostname'),
'value' => exec('hostname'),
],
'ipInfo' => [
'name' => __('Ip'),
'value' => $ips,
],
],
];
} else {
$result = [
'error' => false,
'data' => [
'osInfo' => [
'name' => __('OS'),
'value' => exec('ver'),
],
'hostnameInfo' => [
'name' => __('Hostname'),
'value' => exec('hostname'),
],
'ipInfo' => [
'name' => __('Ip'),
'value' => exec('ipconfig | findstr IPv4'),
],
], ],
]; ];
} }
@ -706,18 +748,34 @@ class Diagnostics extends Wizard
$bytes = 1048576; $bytes = 1048576;
$mega = 1024; $mega = 1024;
switch ($item['Variable_name']) { switch ($item['Variable_name']) {
case 'sql_mode': case 'innodb_buffer_pool_size':
$name = __('Sql mode'); $name = __('InnoDB buffer pool size');
$value = ($item['Value']); $value = ($item['Value'] / $bytes);
$status = (empty($item['Value']) === true) ? 1 : 0; $status = (($item['Value'] / $bytes) >= 250) ? 1 : 0;
$message = __('Must be empty'); $message = __(
'It has to be 40% of the server memory not recommended to be greater or less'
);
break; break;
case 'innodb_log_file_size': case 'innodb_file_per_table':
$name = __('InnoDB log file size'); $name = __('InnoDB file per table');
$value = ($item['Value'] / $bytes); $value = $item['Value'];
$status = (($item['Value'] / $bytes) >= 64) ? 1 : 0; $status = ($item['Value'] === 'ON') ? 1 : 0;
$message = __('Min. Recommended Value').' 64M'; $message = __('Recommended ON');
break;
case 'innodb_flush_log_at_trx_commit':
$name = __('InnoDB flush log at trx-commit');
$value = $item['Value'];
$status = ($item['Value'] == 2) ? 1 : 0;
$message = __('Recommended Value').' 2';
break;
case 'innodb_lock_wait_timeout':
$name = __('InnoDB lock wait timeout');
$value = $item['Value'];
$status = ($item['Value'] >= 90) ? 1 : 0;
$message = __('Min. Recommended Value').' 90s';
break; break;
case 'innodb_log_buffer_size': case 'innodb_log_buffer_size':
@ -727,11 +785,11 @@ class Diagnostics extends Wizard
$message = __('Min. Recommended Value').' 16M'; $message = __('Min. Recommended Value').' 16M';
break; break;
case 'innodb_flush_log_at_trx_commit': case 'innodb_log_file_size':
$name = __('InnoDB flush log at trx-commit'); $name = __('InnoDB log file size');
$value = $item['Value']; $value = ($item['Value'] / $bytes);
$status = (($item['Value'] / $bytes) >= 0) ? 1 : 0; $status = (($item['Value'] / $bytes) >= 64) ? 1 : 0;
$message = __('Min. Recommended Value').' 0'; $message = __('Min. Recommended Value').' 64M';
break; break;
case 'max_allowed_packet': case 'max_allowed_packet':
@ -741,27 +799,34 @@ class Diagnostics extends Wizard
$message = __('Min. Recommended Value').' 32M'; $message = __('Min. Recommended Value').' 32M';
break; break;
case 'innodb_buffer_pool_size': case 'max_connections':
$name = __('InnoDB buffer pool size'); $name = __('Maximun connections');
$value = ($item['Value'] / $mega); $value = $item['Value'];
$status = (($item['Value'] / $mega) >= 250) ? 1 : 0; $status = (($item['Value']) >= 90) ? 1 : 0;
$message = __( $message = __('Min. Recommended Value');
'It has to be 40% of the server memory not recommended to be greater or less' $message .= ' 90 ';
); $message .= __('conections');
break; break;
case 'sort_buffer_size': case 'query_cache_limit':
$name = __('Sort buffer size'); $name = __('Query cache limit');
$value = number_format(($item['Value'] / $mega), 2); $value = ($item['Value'] / $bytes);
$status = (($item['Value'] / $bytes) >= 8) ? 1 : 0;
$message = __('Min. Recommended Value').' 8M';
break;
case 'query_cache_min_res_unit':
$name = __('Query cache min-res-unit');
$value = ($item['Value'] / $mega);
$status = (($item['Value'] / $mega) >= 2) ? 1 : 0;
$message = __('Min. Recommended Value').' 2M';
break;
case 'query_cache_size':
$name = __('Query cache size');
$value = ($item['Value'] / $bytes);
$status = (($item['Value'] / $bytes) >= 32) ? 1 : 0; $status = (($item['Value'] / $bytes) >= 32) ? 1 : 0;
$message = __('Min. Recommended Value').' 32'; $message = __('Min. Recommended Value').' 32M';
break;
case 'join_buffer_size':
$name = __('Join buffer size');
$value = ($item['Value'] / $mega);
$status = (($item['Value'] / $bytes) >= 265) ? 1 : 0;
$message = __('Min. Recommended Value 265');
break; break;
case 'query_cache_type': case 'query_cache_type':
@ -771,83 +836,48 @@ class Diagnostics extends Wizard
$message = __('Recommended ON'); $message = __('Recommended ON');
break; break;
case 'query_cache_size': case 'read_buffer_size':
$name = __('Query cache size'); $name = __('Read buffer size');
$value = ($item['Value'] / $bytes); $value = ($item['Value'] / $mega);
$status = (($item['Value'] / $bytes) >= 32) ? 1 : 0; $status = (($item['Value'] / $mega) >= 32) ? 1 : 0;
$message = __('Min. Recommended Value').' 32MB'; $message = __('Min. Recommended Value').' 32K';
break; break;
case 'query_cache_limit': case 'read_rnd_buffer_size':
$name = __('Query cache limit'); $name = __('Read rnd-buffer size');
$value = ($item['Value'] / $bytes); $value = ($item['Value'] / $mega);
$status = (($item['Value'] / $bytes) >= 256) ? 1 : 0; $status = (($item['Value'] / $mega) >= 32) ? 1 : 0;
$message = __('Min. Recommended Value').' 256K'; $message = __('Min. Recommended Value').' 32K';
break; break;
case 'innodb_lock_wait_timeout': case 'sort_buffer_size':
$name = __('InnoDB lock wait timeout'); $name = __('Sort buffer size');
$value = $item['Value']; $value = ($item['Value'] / $mega);
$status = (($item['Value'] / $bytes) >= 90) ? 1 : 0; $status = (($item['Value'] / $mega) >= 32) ? 1 : 0;
$message = __('Min. Recommended Value').' 90s'; $message = __('Min. Recommended Value').' 32K';
break;
case 'sql_mode':
$name = __('Sql mode');
$value = ($item['Value']);
$status = (empty($item['Value']) === true) ? 1 : 0;
$message = __('Must be empty');
break; break;
case 'thread_cache_size': case 'thread_cache_size':
$name = __('Thread cache size'); $name = __('Thread cache size');
$value = $item['Value']; $value = $item['Value'];
$status = (($item['Value'] / $bytes) >= 8) ? 1 : 0; $status = ($item['Value'] >= 8) ? 1 : 0;
$message = __('Min. Recommended Value').' 8'; $message = __('Min. Recommended Value').' 8';
break; break;
case 'thread_stack': case 'thread_stack':
$name = __('Thread stack'); $name = __('Thread stack');
$value = ($item['Value'] / $bytes); $value = ($item['Value'] / $mega);
$status = (($item['Value'] / $bytes) >= 256) ? 1 : 0; $status = (($item['Value'] / $mega) >= 256) ? 1 : 0;
$message = __('Min. Recommended Value').' 256K';
break;
case 'max_connections':
$name = __('Maximun connections');
$value = $item['Value'];
$status = (($item['Value'] / $bytes) >= 90) ? 1 : 0;
$message = __('Min. Recommended Value').' 90';
break;
case 'key_buffer_size':
$name = __('Key buffer size');
$value = ($item['Value'] / $bytes);
$status = (($item['Value'] / $bytes) >= 256) ? 1 : 0;
$message = __('Min. Recommended Value').' 256'; $message = __('Min. Recommended Value').' 256';
break; break;
case 'read_buffer_size':
$name = __('Read buffer size');
$value = ($item['Value'] / $bytes);
$status = (($item['Value'] / $bytes) >= 32) ? 1 : 0;
$message = __('Min. Recommended Value').' 32';
break;
case 'read_rnd_buffer_size':
$name = __('Read rnd-buffer size');
$value = ($item['Value'] / $bytes);
$status = (($item['Value'] / $bytes) >= 32) ? 1 : 0;
$message = __('Min. Recommended Value').' 32';
break;
case 'query_cache_min_res_unit':
$name = __('Query cache min-res-unit');
$value = ($item['Value'] / $bytes);
$status = (($item['Value'] / $bytes) >= 2) ? 1 : 0;
$message = __('Min. Recommended Value').' 2k';
break;
case 'innodb_file_per_table':
$name = __('InnoDB file per table');
$value = $item['Value'];
$status = ($item['Value'] === 'ON') ? 1 : 0;
$message = __('Recommended ON');
break;
default: default:
$name = ''; $name = '';
$value = 0; $value = 0;
@ -949,10 +979,10 @@ class Diagnostics extends Wizard
$unit = 'M'; $unit = 'M';
$pathServerLogs = 'var/log/pandora/pandora_server.log'; $pathServerLogs = '/var/log/pandora/pandora_server.log';
$servers = $this->getLogInfo($pathServerLogs); $servers = $this->getLogInfo($pathServerLogs);
$pathErrLogs = 'var/log/pandora/pandora_server.error'; $pathErrLogs = '/var/log/pandora/pandora_server.error';
$errors = $this->getLogInfo($pathErrLogs); $errors = $this->getLogInfo($pathErrLogs);
$pathConsoleLogs = $config['homedir'].'/pandora_console.log'; $pathConsoleLogs = $config['homedir'].'/pandora_console.log';
@ -1014,6 +1044,7 @@ class Diagnostics extends Wizard
$customerKey = db_get_value_sql($sql); $customerKey = db_get_value_sql($sql);
// Extract Info license. // Extract Info license.
enterprise_include_once('include/functions_license.php');
$license = enterprise_hook('license_get_info'); $license = enterprise_hook('license_get_info');
// Agent Capacity. // Agent Capacity.
@ -1046,6 +1077,7 @@ class Diagnostics extends Wizard
WHERE id_tipo_modulo WHERE id_tipo_modulo
BETWEEN 6 AND 18' BETWEEN 6 AND 18'
); );
$totalModuleIntervalTime = db_get_value_sql( $totalModuleIntervalTime = db_get_value_sql(
'SELECT SUM(module_interval) 'SELECT SUM(module_interval)
FROM tagente_modulo FROM tagente_modulo
@ -1056,26 +1088,26 @@ class Diagnostics extends Wizard
$averageTime = 0; $averageTime = 0;
if ($totalModuleIntervalTime !== false) { if ($totalModuleIntervalTime !== false) {
$averageTime = number_format( $averageTime = number_format(
((int) $totalModuleIntervalTime / (int) $totalNetworkModules), ((int) $totalNetworkModules / (int) $totalModuleIntervalTime),
3 3
); );
} }
$moduleNetworkmsg = __( $moduleNetworkmsg = __(
sprintf( sprintf(
'The system is not overloaded (average time %d)', 'The system is not overloaded (average time %f)',
$average_time $averageTime
) )
); );
$moduleNetworkst = 1; $moduleNetworkst = 1;
if ($average_time === 0) { if ($averageTime === 0) {
$moduleNetworkmsg = __('The system has no load'); $moduleNetworkmsg = __('The system has no load');
$moduleNetworkst = 0; $moduleNetworkst = 0;
} else if ($averageTime < 180) { } else if ($averageTime > 180) {
$moduleNetworkmsg = __( $moduleNetworkmsg = __(
sprintf( sprintf(
'The system is overloaded (average time %d) and a very fine configuration is required', 'The system is overloaded (average time %f) and a very fine configuration is required',
$average_time $averageTime
) )
); );
$moduleNetworkst = 0; $moduleNetworkst = 0;
@ -1248,37 +1280,47 @@ class Diagnostics extends Wizard
{ {
global $config; global $config;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $result = [];
return []; $totalServerThreads = 0;
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
$totalServerThreads = shell_exec(
'ps -T aux | grep pandora_server | grep -v grep | wc -l'
);
} }
$totalServerThreads = shell_exec( include_once $config['homedir'].'/include/functions_servers.php';
'ps -T aux | grep pandora_server | grep -v grep | wc -l' $sql = 'SELECT `name`, server_type, threads FROM tserver';
); $servers = db_get_all_rows_sql($sql);
$percentageThreadsRam = shell_exec(
"ps axo pmem,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'"
);
$percentageThreadsCpu = shell_exec(
"ps axo pcpu,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'"
);
$result = [ if (isset($servers) === true && is_array($servers) === true) {
'error' => false, $sum_threads = 0;
'data' => [ foreach ($servers as $key => $value) {
'totalServerThreads' => [ $result['data']['threads_server_'.$value['server_type']] = [
'name' => __('Total server threads'), 'name' => __('Threads').' '.\servers_get_server_string_name(
'value' => $totalServerThreads, $value['server_type']
], ),
'percentageThreadsRam' => [ 'value' => $value['threads'],
'name' => __('Percentage of threads used by the RAM'), ];
'value' => $percentageThreadsRam.' %',
], $sum_threads += $value['threads'];
'percentageThreadsCpu' => [ }
'name' => __('Percentage of threads used by the CPU'),
'value' => $percentageThreadsCpu.' %', $result['data']['total_threads'] = [
], 'name' => __('Total threads'),
], 'value' => $sum_threads,
]; 'status' => ($sum_threads < $totalServerThreads) ? 2 : 1,
];
if ($sum_threads < $totalServerThreads) {
$result['data']['total_threads']['message'] = __(
'Current pandora_server running threads'
);
} else {
__(
'There\'s more pandora_server threads than configured, are you running multiple servers simultaneusly?.'
);
}
}
return json_encode($result); return json_encode($result);
} }
@ -1311,8 +1353,8 @@ class Diagnostics extends Wizard
$lenght = strlen($innodb[0]['Status']); $lenght = strlen($innodb[0]['Status']);
$data = []; $data = [];
for ($i = 0; $i < $lenght; $i = ($i + 500)) { for ($i = 0; $i < $lenght; $i = ($i + 300)) {
$str = substr($innodb[0]['Status'], $i, ($i + 500)); $str = substr($innodb[0]['Status'], $i, ($i + 300));
$data['showEngine-'.$i] = [ $data['showEngine-'.$i] = [
'name' => '', 'name' => '',
'value' => '<pre>'.$str.'</pre>', 'value' => '<pre>'.$str.'</pre>',
@ -1669,7 +1711,7 @@ class Diagnostics extends Wizard
'status' => 0, 'status' => 0,
]; ];
if (is_file($path) === true) { if (file_exists($path) === true) {
$fileSize = filesize($path); $fileSize = filesize($path);
$sizeServerLog = number_format($fileSize); $sizeServerLog = number_format($fileSize);
$sizeServerLog = (0 + str_replace(',', '', $sizeServerLog)); $sizeServerLog = (0 + str_replace(',', '', $sizeServerLog));
@ -1726,7 +1768,17 @@ class Diagnostics extends Wizard
// of objects, making a post-process of certain fields. // of objects, making a post-process of certain fields.
if (isset($items[$key]['status']) === true) { if (isset($items[$key]['status']) === true) {
$acumValue = $items[$key]['value']; $acumValue = $items[$key]['value'];
if ($items[$key]['status'] === 1) {
if ($items[$key]['status'] === 2) {
$items[$key]['value'] = html_print_image(
'images/icono-warning.png',
true,
[
'title' => __('Warning'),
'style' => 'width:15px;',
]
);
} else if ($items[$key]['status'] === 1) {
$items[$key]['value'] = html_print_image( $items[$key]['value'] = html_print_image(
'images/exito.png', 'images/exito.png',
true, true,
@ -1868,7 +1920,7 @@ class Diagnostics extends Wizard
$mail_feedback = 'feedback@artica.es'; $mail_feedback = 'feedback@artica.es';
$email = $mail_feedback; $email = $mail_feedback;
$subject = 'PandoraFMS Report '.$config['pandora_uid']; $subject = $this->product_name.' Report '.$config['pandora_uid'];
$text = get_parameter('what-happened', ''); $text = get_parameter('what-happened', '');
$attachment = get_parameter_switch('include_installation_data', 0); $attachment = get_parameter_switch('include_installation_data', 0);
$email_from = get_parameter_switch('email', ''); $email_from = get_parameter_switch('email', '');

View File

@ -342,11 +342,11 @@ class WelcomeWindow extends Wizard
$btn_create_alert_class = ''; $btn_create_alert_class = '';
$btn_create_discovery_class = 'pending'; $btn_create_discovery_class = 'pending';
$li_configure_mail_class = 'green'; $li_configure_mail_class = 'row_green';
$li_create_agent_class = 'green'; $li_create_agent_class = 'row_green';
$li_create_module_class = 'grey'; $li_create_module_class = 'row_grey';
$li_create_alert_class = 'grey'; $li_create_alert_class = 'row_grey';
$li_create_discovery_class = 'green'; $li_create_discovery_class = 'row_green';
if (empty($config['welcome_mail_configured']) === false) { if (empty($config['welcome_mail_configured']) === false) {
$btn_configure_mail_class = ' completed'; $btn_configure_mail_class = ' completed';
@ -355,18 +355,18 @@ class WelcomeWindow extends Wizard
if (empty($config['welcome_id_agent']) === false) { if (empty($config['welcome_id_agent']) === false) {
$btn_create_agent_class = ' completed'; $btn_create_agent_class = ' completed';
$btn_create_module_class = ' pending'; $btn_create_module_class = ' pending';
$li_create_module_class = 'green'; $li_create_module_class = 'row_green';
} }
if (empty($config['welcome_module']) === false) { if (empty($config['welcome_module']) === false) {
$btn_create_module_class = ' completed'; $btn_create_module_class = ' completed';
$btn_create_alert_class = ' pending'; $btn_create_alert_class = ' pending';
$li_create_module_class = 'green'; $li_create_module_class = 'row_green';
} }
if (empty($config['welcome_alert']) === false) { if (empty($config['welcome_alert']) === false) {
$btn_create_alert_class = ' completed'; $btn_create_alert_class = ' completed';
$li_create_alert_class = 'green'; $li_create_alert_class = 'row_green';
} }
if (empty($config['welcome_task']) === false) { if (empty($config['welcome_task']) === false) {
@ -380,8 +380,8 @@ class WelcomeWindow extends Wizard
$btn_create_module_class = ' completed'; $btn_create_module_class = ' completed';
$btn_create_alert_class = ' completed'; $btn_create_alert_class = ' completed';
$btn_create_discovery_class = ' completed'; $btn_create_discovery_class = ' completed';
$li_create_module_class = 'green'; $li_create_module_class = 'row_green';
$li_create_alert_class = 'green'; $li_create_alert_class = 'row_green';
} }
$form = [ $form = [
@ -547,7 +547,10 @@ class WelcomeWindow extends Wizard
], ],
], ],
], ],
[ ];
if (enterprise_installed()) {
$inputs[] = [
'wrapper' => 'div', 'wrapper' => 'div',
'block_id' => 'div_not_working', 'block_id' => 'div_not_working',
'class' => 'hole flex-row w100p', 'class' => 'hole flex-row w100p',
@ -573,8 +576,8 @@ class WelcomeWindow extends Wizard
], ],
], ],
], ];
]; }
$output = $this->printForm( $output = $this->printForm(
[ [

View File

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

View File

@ -4580,7 +4580,7 @@ function events_page_comments($event, $ajax=false)
continue; continue;
} }
$comments_array[] = json_decode(io_safe_output($comm), true); $comments_array[] = io_safe_output(json_decode($comm, true));
} }
} else { } else {
// If comments are not stored in json, the format is old. // If comments are not stored in json, the format is old.

View File

@ -3169,6 +3169,9 @@ function ui_print_datatable(array $parameters)
); );
} }
// Languages.
$processing = __('Processing');
// Extra html. // Extra html.
$extra = ''; $extra = '';
if (isset($parameters['extra_html']) && !empty($parameters['extra_html'])) { if (isset($parameters['extra_html']) && !empty($parameters['extra_html'])) {
@ -3233,6 +3236,9 @@ function ui_print_datatable(array $parameters)
searching: false, searching: false,
responsive: true, responsive: true,
dom: "plfrtiBp", dom: "plfrtiBp",
language: {
processing:"'.$processing.'"
},
buttons: [ buttons: [
{ {
extend: "csv", extend: "csv",
@ -5738,7 +5744,7 @@ function ui_print_comments($comments)
continue; continue;
} }
$comments_array[] = json_decode(io_safe_output($comm), true); $comments_array[] = io_safe_output(json_decode($comm, true));
} }
} }

View File

@ -17,6 +17,10 @@
text-align: justify; text-align: justify;
} }
.dataTables_wrapper {
min-height: 150px;
}
.datatables-td-title { .datatables-td-title {
width: 25% !important; width: 25% !important;
font-weight: bolder; font-weight: bolder;

View File

@ -6,15 +6,8 @@
overflow: hidden; overflow: hidden;
} }
#welcome_modal_window { #welcome_modal_window * {
/* font-size: 10pt;
max-height: 100%;
height: 100%;
border-left: 1em solid #82b92f;
margin-bottom: -59px;
padding-bottom: 100px;
margin-left: -1px;
*/
} }
#welcome_form ul.wizard > li { #welcome_form ul.wizard > li {
@ -86,7 +79,7 @@
border-left: 4px solid #79a930; border-left: 4px solid #79a930;
} }
#welcome_form li:not(.centered_full):not(.white_box).grey { #welcome_form li:not(.centered_full):not(.white_box).row_grey {
border-left: 4px solid #d6d6d6; border-left: 4px solid #d6d6d6;
} }

View File

@ -5917,6 +5917,47 @@ table.table_modal_alternate tr td:first-child {
width: 101%; width: 101%;
} }
/*Font header feedback*/
form#modal_form_feedback {
padding: 10px;
}
form#modal_form_feedback label {
margin-bottom: 10px;
color: #343434;
font-weight: bold;
font-size: 10pt;
}
form#modal_form_feedback input[type="email"] {
background-color: transparent;
border: none;
border-radius: 0;
border-bottom: 1px solid #ccc;
font-family: "lato-bolder", "Open Sans", sans-serif;
font-weight: lighter;
padding: 0px 0px 2px 0px;
box-sizing: border-box;
margin-bottom: 4px;
}
form#modal_form_feedback ul.wizard li {
padding-bottom: 10px;
padding-top: 10px;
}
form#modal_form_feedback ul.wizard li > label:not(.p-switch) {
width: 250px;
vertical-align: top;
display: inline-block;
}
form#modal_form_feedback ul.wizard li > textarea {
width: 600px;
height: 15em;
display: inline-block;
font-family: monospace;
}
/* /*
* --------------------------------------------------------------------- * ---------------------------------------------------------------------
* - FONT SIZES IN AGENT VIEW. This changes the font size of the agent * - FONT SIZES IN AGENT VIEW. This changes the font size of the agent

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.740 %define version 7.0NG.740
%define release 191113 %define release 191118
# 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.740 %define version 7.0NG.740
%define release 191113 %define release 191118
# 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.740 %define version 7.0NG.740
%define release 191113 %define release 191118
%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

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.740-191113 Version: 7.0NG.740-191118
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.740-191113" pandora_version="7.0NG.740-191118"
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.740"; my $pandora_version = "7.0NG.740";
my $pandora_build = "191113"; my $pandora_build = "191118";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

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.740"; my $pandora_version = "7.0NG.740";
my $pandora_build = "191113"; my $pandora_build = "191118";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

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

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.740" PI_VERSION="7.0NG.740"
PI_BUILD="191113" PI_BUILD="191118"
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.740 PS191113"; my $version = "7.0NG.740 PS191118";
# 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.740 PS191113"; my $version = "7.0NG.740 PS191118";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);