Merge remote-tracking branch 'origin/develop' into ent-9554-nuevas-graficas-de-tarta-que-reemplazar-a-las-actuales-3

This commit is contained in:
Daniel Barbero 2022-12-19 09:38:21 +01:00
commit b4d306b9b1
77 changed files with 782 additions and 463 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.767-221213
Version: 7.0NG.767-221219
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.767-221213"
pandora_version="7.0NG.767-221219"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.767';
use constant AGENT_BUILD => '221213';
use constant AGENT_BUILD => '221219';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -2403,6 +2403,11 @@ sub check_collections () {
if (open (MD5_FILE, "< $ConfDir/collections/$collection_md5_file")) {
$local_collection_md5 = <MD5_FILE>;
close MD5_FILE;
if ( ! defined ($local_collection_md5) ) {
log_message ('Collection', "Size of $ConfDir/collections/$collection_md5_file is 0");
unlink ("$ConfDir/collections/$collection_md5_file");
$local_collection_md5 = "Size 0";
}
} else {
log_message ('Collection', "Could not open dir $ConfDir/collections/$collection_md5_file");
next;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.767
%define release 221213
%define release 221219
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.767
%define release 221213
%define release 221219
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.767"
PI_BUILD="221213"
PI_BUILD="221219"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{221213}
{221219}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.767 Build 221213")
#define PANDORA_VERSION ("7.0NG.767 Build 221219")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.767(Build 221213))"
VALUE "ProductVersion", "(7.0NG.767(Build 221219))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.767-221213
Version: 7.0NG.767-221219
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.767-221213"
pandora_version="7.0NG.767-221219"
package_pear=0
package_pandora=1

View File

@ -1667,3 +1667,13 @@ godmode/um_client/vendor/sebastian
godmode/um_client/vendor
update_manager_client/resources/styles/pandora.css
enterprise/meta/general/upload_head_image.php
general/first_task/transactional_list.php
enterprise/include/ajax/transactional.ajax.php
enterprise/include/class/Transactionalmap.class.php
enterprise/include/help/es/help_transactional_map_phases.php
enterprise/include/javascript/transactional/TransactionalController.js
enterprise/include/functions_transactional.php
enterprise/operation/agentes/manage_transmap.php
enterprise/operation/agentes/manage_transmap_creation.php
enterprise/operation/agentes/manage_transmap_creation_phases_data.php
enterprise/operation/agentes/transactional_map.php

View File

@ -1,5 +1,14 @@
START TRANSACTION;
ALTER TABLE treport_content ADD COLUMN use_prefix_notation tinyint(1) default '1';
ALTER TABLE treport_content_template ADD COLUMN use_prefix_notation tinyint(1) default '1';
DROP TABLE IF EXISTS `tphase`;
DROP TABLE IF EXISTS `ttransaction`;
ALTER TABLE `tagent_custom_fields` ADD `is_link_enabled` TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE `tevent_filter` ADD COLUMN `owner_user` TEXT;
ALTER TABLE `tevent_filter` ADD COLUMN `not_search` INT NOT NULL DEFAULT 0;
COMMIT;

View File

@ -1,46 +0,0 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// 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 the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
global $networkmaps_write;
global $networkmaps_manage;
check_login();
ui_require_css_file('first_task');
?>
<?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no transactions defined yet.') ]);
if ($networkmaps_write || $networkmaps_manage) {
?>
<div class="new_task">
<div class="image_task">
<?php echo html_print_image('images/first_task/icono_grande_topology.png', true, ['title' => __('Transactions')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Transactions'); ?></h3><p id="description_task">
<?php
echo __(
'The new transactional server allows you to execute tasks dependent on the others following a user-defined design. This means that it is possible to coordinate several executions to check a target at a given time.
Transaction graphs represent the different processes within our infrastructure that we use to deliver our service.'
);
?>
</p>
<form action="index.php?sec=network&sec2=enterprise/operation/agentes/manage_transmap_creation&create_transaction=1" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Transactions'); ?>" />
</form>
</div>
</div>
<?php
}

View File

@ -66,6 +66,7 @@ if ($id) {
$severity = explode(',', $filter['severity']);
$status = $filter['status'];
$search = $filter['search'];
$not_search = $filter['not_search'];
$text_agent = $filter['text_agent'];
$id_agent = $filter['id_agent'];
$text_module = $filter['text_module'];
@ -73,6 +74,7 @@ if ($id) {
$pagination = $filter['pagination'];
$event_view_hr = $filter['event_view_hr'];
$id_user_ack = $filter['id_user_ack'];
$owner_user = $filter['owner_user'];
$group_rep = $filter['group_rep'];
$date_from = str_replace('-', '/', $filter['date_from']);
$date_to = str_replace('-', '/', $filter['date_to']);
@ -115,10 +117,12 @@ if ($id) {
$severity = '';
$status = '';
$search = '';
$not_search = 0;
$text_agent = '';
$pagination = '';
$event_view_hr = '';
$id_user_ack = '';
$owner_user = '';
$group_rep = '';
$date_from = '';
$date_to = '';
@ -140,6 +144,7 @@ if ($update || $create) {
$severity = implode(',', get_parameter('severity', -1));
$status = get_parameter('status', '');
$search = get_parameter('search', '');
$not_search = get_parameter_switch('not_search', 0);
$text_agent = get_parameter('text_agent', '');
$id_agent = (int) get_parameter('id_agent');
$text_module = get_parameter('text_module', '');
@ -157,6 +162,7 @@ if ($update || $create) {
$pagination = get_parameter('pagination', '');
$event_view_hr = get_parameter('event_view_hr', '');
$id_user_ack = get_parameter('id_user_ack', '');
$owner_user = get_parameter('owner_user', '');
$group_rep = get_parameter('group_rep', '');
$date_from = get_parameter('date_from', '');
$date_to = get_parameter('date_to', '');
@ -185,12 +191,14 @@ if ($update || $create) {
'severity' => $severity,
'status' => $status,
'search' => $search,
'not_search' => $not_search,
'text_agent' => $text_agent,
'id_agent_module' => $id_agent_module,
'id_agent' => $id_agent,
'pagination' => $pagination,
'event_view_hr' => $event_view_hr,
'id_user_ack' => $id_user_ack,
'owner_user' => $owner_user,
'group_rep' => $group_rep,
'tag_with' => $tag_with_json,
'tag_without' => $tag_without_json,
@ -376,6 +384,15 @@ $table->data[6][1] = html_print_input_text(
255,
true
);
$table->data[6][1] .= ' '.html_print_checkbox_switch(
'not_search',
$not_search,
$not_search,
true,
false,
'checked_slide_events(this);',
true
);
$table->data[7][0] = '<b>'.__('Agent search').'</b>';
$params = [];
@ -420,7 +437,12 @@ $table->data[9][1] = html_print_input_text(
true
);
$table->data[10][0] = '<b>'.__('User ack.').'</b>'.' '.ui_print_help_tip(__('Choose between the users who have validated an event. '), true);
$table->data[10][0] = '<b>'.__('User ack.').'</b>';
$table->data[10][0] .= ' ';
$table->data[10][0] .= ui_print_help_tip(
__('Choose between the users who have validated an event. '),
true
);
if ($strict_user) {
$users = [$config['id_user'] => $config['id_user']];
@ -442,14 +464,25 @@ $table->data[10][1] = html_print_select(
true
);
$table->data[11][0] = '<b>'.__('Owner.').'</b>';
$table->data[11][1] = html_print_select(
$users,
'owner_user',
$owner_user,
'',
__('Any'),
0,
true
);
$repeated_sel = [
EVENT_GROUP_REP_ALL => __('All events'),
EVENT_GROUP_REP_EVENTS => __('Group events'),
EVENT_GROUP_REP_AGENTS => __('Group agents'),
EVENT_GROUP_REP_EXTRAIDS => __('Group extra id'),
];
$table->data[11][0] = '<b>'.__('Repeated').'</b>';
$table->data[11][1] = html_print_select(
$table->data[12][0] = '<b>'.__('Repeated').'</b>';
$table->data[12][1] = html_print_select(
$repeated_sel,
'group_rep',
$group_rep,
@ -459,11 +492,11 @@ $table->data[11][1] = html_print_select(
true
);
$table->data[12][0] = '<b>'.__('Date from').'</b>';
$table->data[12][1] = html_print_input_text('date_from', $date_from, '', 15, 10, true);
$table->data[13][0] = '<b>'.__('Date from').'</b>';
$table->data[13][1] = html_print_input_text('date_from', $date_from, '', 15, 10, true);
$table->data[13][0] = '<b>'.__('Date to').'</b>';
$table->data[13][1] = html_print_input_text('date_to', $date_to, '', 15, 10, true);
$table->data[14][0] = '<b>'.__('Date to').'</b>';
$table->data[14][1] = html_print_input_text('date_to', $date_to, '', 15, 10, true);
$tag_with = json_decode($tag_with_json_clean, true);
if (empty($tag_with)) {
@ -502,9 +535,9 @@ $remove_with_tag_disabled = empty($tag_with_temp);
$add_without_tag_disabled = empty($tags_select_without);
$remove_without_tag_disabled = empty($tag_without_temp);
$table->colspan[14][0] = '2';
$table->data[14][0] = '<b>'.__('Events with following tags').'</b>';
$table->data[15][0] = html_print_select(
$table->colspan[15][0] = '2';
$table->data[15][0] = '<b>'.__('Events with following tags').'</b>';
$table->data[16][0] = html_print_select(
$tags_select_with,
'select_with',
'',
@ -518,7 +551,7 @@ $table->data[15][0] = html_print_select(
false,
'width: 220px;'
);
$table->data[15][1] = html_print_button(
$table->data[16][1] = html_print_button(
__('Add'),
'add_whith',
$add_with_tag_disabled,
@ -527,7 +560,7 @@ $table->data[15][1] = html_print_button(
true
);
$table->data[16][0] = html_print_select(
$table->data[17][0] = html_print_select(
$tag_with_temp,
'tag_with_temp',
[],
@ -541,12 +574,12 @@ $table->data[16][0] = html_print_select(
false,
'width: 220px; height: 50px;'
);
$table->data[16][0] .= html_print_input_hidden(
$table->data[17][0] .= html_print_input_hidden(
'tag_with',
$tag_with_base64,
true
);
$table->data[16][1] = html_print_button(
$table->data[17][1] = html_print_button(
__('Remove'),
'remove_whith',
$remove_with_tag_disabled,
@ -555,9 +588,9 @@ $table->data[16][1] = html_print_button(
true
);
$table->colspan[17][0] = '2';
$table->data[17][0] = '<b>'.__('Events without following tags').'</b>';
$table->data[18][0] = html_print_select(
$table->colspan[18][0] = '2';
$table->data[18][0] = '<b>'.__('Events without following tags').'</b>';
$table->data[19][0] = html_print_select(
$tags_select_without,
'select_without',
'',
@ -571,7 +604,7 @@ $table->data[18][0] = html_print_select(
false,
'width: 220px;'
);
$table->data[18][1] = html_print_button(
$table->data[19][1] = html_print_button(
__('Add'),
'add_whithout',
$add_without_tag_disabled,
@ -580,7 +613,7 @@ $table->data[18][1] = html_print_button(
true
);
$table->data[19][0] = html_print_select(
$table->data[20][0] = html_print_select(
$tag_without_temp,
'tag_without_temp',
[],
@ -594,12 +627,12 @@ $table->data[19][0] = html_print_select(
false,
'width: 220px; height: 50px;'
);
$table->data[19][0] .= html_print_input_hidden(
$table->data[20][0] .= html_print_input_hidden(
'tag_without',
$tag_without_base64,
true
);
$table->data[19][1] = html_print_button(
$table->data[20][1] = html_print_button(
__('Remove'),
'remove_whithout',
$remove_without_tag_disabled,
@ -608,8 +641,8 @@ $table->data[19][1] = html_print_button(
true
);
$table->data[20][0] = '<b>'.__('Alert events').'</b>';
$table->data[20][1] = html_print_select(
$table->data[21][0] = '<b>'.__('Alert events').'</b>';
$table->data[21][1] = html_print_select(
[
'-1' => __('All'),
'0' => __('Filter alert events'),
@ -624,8 +657,8 @@ $table->data[20][1] = html_print_select(
);
if (!is_metaconsole()) {
$table->data[21][0] = '<b>'.__('Module search').'</b>';
$table->data[21][1] .= html_print_autocomplete_modules(
$table->data[22][0] = '<b>'.__('Module search').'</b>';
$table->data[22][1] .= html_print_autocomplete_modules(
'module_search',
$text_module,
false,
@ -637,17 +670,17 @@ if (!is_metaconsole()) {
);
}
$table->data[22][0] = '<b>'.__('Source').'</b>';
$table->data[22][1] = html_print_input_text('source', $source, '', 35, 255, true);
$table->data[23][0] = '<b>'.__('Source').'</b>';
$table->data[23][1] = html_print_input_text('source', $source, '', 35, 255, true);
$table->data[23][0] = '<b>'.__('Extra ID').'</b>';
$table->data[23][1] = html_print_input_text('id_extra', $id_extra, '', 11, 255, true);
$table->data[24][0] = '<b>'.__('Extra ID').'</b>';
$table->data[24][1] = html_print_input_text('id_extra', $id_extra, '', 11, 255, true);
$table->data[24][0] = '<b>'.__('Comment').'</b>';
$table->data[24][1] = html_print_input_text('user_comment', $user_comment, '', 35, 255, true);
$table->data[25][0] = '<b>'.__('Comment').'</b>';
$table->data[25][1] = html_print_input_text('user_comment', $user_comment, '', 35, 255, true);
$table->data[25][0] = '<b>'.__('Custom data filter type').'</b>';
$table->data[25][1] = html_print_select(
$table->data[26][0] = '<b>'.__('Custom data filter type').'</b>';
$table->data[26][1] = html_print_select(
[
'0' => __('Filter custom data by name field'),
'1' => __('Filter custom data by value field'),
@ -660,12 +693,12 @@ $table->data[25][1] = html_print_select(
true
);
$table->data[26][0] = '<b>'.__('Custom data').'</b>';
$table->data[26][1] = html_print_input_text('custom_data', $custom_data, '', 35, 255, true);
$table->data[27][0] = '<b>'.__('Custom data').'</b>';
$table->data[27][1] = html_print_input_text('custom_data', $custom_data, '', 35, 255, true);
if (is_metaconsole()) {
$table->data[27][0] = '<b>'.__('Id souce event').'</b>';
$table->data[27][1] = html_print_input_text(
$table->data[28][0] = '<b>'.__('Id souce event').'</b>';
$table->data[28][1] = html_print_input_text(
'id_source_event',
$id_source_event,
'',
@ -727,6 +760,14 @@ $(document).ready( function() {
});
function checked_slide_events(element) {
var value = $("#checkbox-"+element.name).val();
if (value == 0) {
$("#checkbox-"+element.name).val(1);
} else {
$("#checkbox-"+element.name).val(0);
}
}
function click_button_remove_tag(what_button) {
if (what_button == "with") {

View File

@ -181,6 +181,7 @@ if (empty($alert_templates)) {
$alert_templates = '';
}
$table = new stdClass();
$table->id = 'delete_table';
$table->width = '98%';
$table->data = [];

View File

@ -192,6 +192,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = true;
}
$table = new stdClass();
$table->id = 'delete_table';
$table->class = 'databox filters';
$table->width = '100%';

View File

@ -249,6 +249,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = true;
}
$table = new stdClass();
$table->id = 'delete_table';
$table->class = 'databox filters';
$table->width = '100%';

View File

@ -148,6 +148,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = true;
}
$table = new stdClass();
$table->id = 'delete_table';
$table->class = 'databox filters';
$table->width = '100%';

View File

@ -164,6 +164,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = true;
}
$table = new stdClass();
$table->id = 'delete_table';
$table->class = 'databox filters';
$table->width = '100%';

View File

@ -229,7 +229,8 @@ if ($add_module === true) {
// Safe output remove all entities.
io_safe_output_array($id_modules, '');
$id_modules = array_map(function ($mod) {
$id_modules = array_map(
function ($mod) {
return io_safe_input($mod);
},
$id_modules

View File

@ -169,6 +169,7 @@ $visual_format = 0;
$filter_search = '';
$filter_exclude = '';
$use_prefix_notation = true;
// Added for select fields.
$total_time = true;
@ -461,6 +462,7 @@ switch ($action) {
$lapse = $item['lapse'];
$lapse_calc = $item['lapse_calc'];
$visual_format = $item['visual_format'];
$use_prefix_notation = $item['use_prefix_notation'];
break;
case 'max_value':
@ -476,6 +478,7 @@ switch ($action) {
$lapse = $item['lapse'];
$lapse_calc = $item['lapse_calc'];
$visual_format = $item['visual_format'];
$use_prefix_notation = $item['use_prefix_notation'];
break;
case 'min_value':
@ -491,6 +494,7 @@ switch ($action) {
$lapse = $item['lapse'];
$lapse_calc = $item['lapse_calc'];
$visual_format = $item['visual_format'];
$use_prefix_notation = $item['use_prefix_notation'];
break;
case 'sumatory':
@ -504,6 +508,7 @@ switch ($action) {
$idAgentModule = $item['id_agent_module'];
$period = $item['period'];
$uncompressed_module = $item['uncompressed_module'];
$use_prefix_notation = $item['use_prefix_notation'];
break;
case 'historical_data':
@ -773,6 +778,7 @@ switch ($action) {
$show_resume = $item['show_resume'];
$show_graph = $item['show_graph'];
$order_uptodown = $item['order_uptodown'];
$use_prefix_notation = $item['use_prefix_notation'];
$text_agent = '';
if (isset($style['text_agent']) === true
@ -3404,6 +3410,22 @@ $class = 'databox filters';
</td>
</tr>
<tr id="row_use_prefix_notation" class="datos advanced_elements">
<td class="bolder">
<?php
echo __('Use prefix notation');
ui_print_help_tip(
__('Use prefix notation for numeric values (example: 20,8Kbytes/sec), otherwise full value will be displayed (example: 20.742 bytes/sec)')
);
?>
</td>
<td>
<?php
html_print_checkbox_switch('use_prefix_notation', 1, $use_prefix_notation);
?>
</td>
</tr>
<tr id="row_uncompressed_module" class="datos">
<td class="bolder">
<?php
@ -6367,6 +6389,7 @@ function chooseType() {
$("#row_show_summary").hide();
$("#row_group_by").hide();
$("#row_type_show").hide();
$("#row_use_prefix_notation").hide();
// SLA list default state.
$("#sla_list").hide();
@ -6561,6 +6584,7 @@ function chooseType() {
$("#row_lapse").show();
$("#row_visual_format").show();
$("#row_historical_db_check").hide();
$("#row_use_prefix_notation").show();
break;
case 'max_value':
@ -6572,6 +6596,7 @@ function chooseType() {
$("#row_lapse").show();
$("#row_visual_format").show();
$("#row_historical_db_check").hide();
$("#row_use_prefix_notation").show();
break;
case 'min_value':
@ -6583,6 +6608,7 @@ function chooseType() {
$("#row_lapse").show();
$("#row_visual_format").show();
$("#row_historical_db_check").hide();
$("#row_use_prefix_notation").show();
break;
case 'sumatory':
@ -6592,6 +6618,7 @@ function chooseType() {
$("#row_period").show();
$("#row_historical_db_check").hide();
$("#row_uncompressed_module").show();
$("#row_use_prefix_notation").show();
break;
case 'historical_data':
@ -6879,6 +6906,7 @@ function chooseType() {
$("#row_show_resume").show();
$("#row_show_graph").show();
$("#row_historical_db_check").hide();
$("#row_use_prefix_notation").show();
break;
case 'exception':

View File

@ -1888,6 +1888,9 @@ switch ($action) {
$values['visual_format'] = get_parameter(
'visual_format'
);
$values['use_prefix_notation'] = get_parameter(
'use_prefix_notation'
);
$good_format = true;
break;
@ -1911,6 +1914,9 @@ switch ($action) {
$values['show_graph'] = get_parameter(
'combo_graph_options'
);
$values['use_prefix_notation'] = get_parameter(
'use_prefix_notation'
);
$good_format = true;
break;
}
@ -2704,6 +2710,9 @@ switch ($action) {
$values['visual_format'] = get_parameter(
'visual_format'
);
$values['use_prefix_notation'] = get_parameter(
'use_prefix_notation'
);
$good_format = true;
break;
@ -2720,6 +2729,9 @@ switch ($action) {
$values['show_graph'] = get_parameter(
'combo_graph_options'
);
$values['use_prefix_notation'] = get_parameter(
'use_prefix_notation'
);
$good_format = true;
break;
}

View File

@ -1312,6 +1312,27 @@ $table_other->data[$row][1] = '<em>'.__('Example').'</em> '.date($config['date_f
$table_other->data[$row][1] .= html_print_input_text('date_format', $config['date_format'], '', 30, 100, true);
$row++;
$decimal_separators = [
',' => ',',
'.' => '.'
];
$table_other->data[$row][0] = __('Decimal separator');
$table_other->data[$row][1] = html_print_select(
$decimal_separators,
'decimal_separator',
$config['decimal_separator'],
'',
'',
'',
true,
false,
false
);
$row++;
if ($config['prominent_time'] == 'comparation') {
$timestamp = false;
$comparation = true;

View File

@ -1450,17 +1450,17 @@ class DiscoveryTaskList extends HTML
// Header information.
if ((int) $task['status'] <= 0 && empty($summary)) {
if ($task['type'] == DISCOVERY_APP_VMWARE && $task['utimestamp'] != 0) {
$outputMessage = __('Task completed.');
if ((int) $task['utimestamp'] !== 0) {
$output .= $this->progressTaskGraph($task);
} else {
$outputMessage = __('This task has never executed');
}
$output .= ui_print_info_message(
$outputMessage,
'',
true
);
$output .= ui_print_info_message(
$outputMessage,
'',
true
);
}
} else if ($task['status'] == 1
|| ($task['utimestamp'] == 0 && $task['interval_sweep'])
) {

View File

@ -429,7 +429,9 @@ if (check_login()) {
$table_modules->data[$key][1] = remove_right_zeros(
number_format(
$value['datos'],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
} else {

View File

@ -351,12 +351,14 @@ if ($save_event_filter) {
$values['severity'] = implode(',', get_parameter('severity', -1));
$values['status'] = get_parameter('status');
$values['search'] = get_parameter('search');
$values['not_search'] = get_parameter('not_search');
$values['text_agent'] = get_parameter('text_agent');
$values['id_agent'] = get_parameter('id_agent');
$values['id_agent_module'] = get_parameter('id_agent_module');
$values['pagination'] = get_parameter('pagination');
$values['event_view_hr'] = get_parameter('event_view_hr');
$values['id_user_ack'] = get_parameter('id_user_ack');
$values['owner_user'] = get_parameter('owner_user');
$values['group_rep'] = get_parameter('group_rep');
$values['tag_with'] = get_parameter('tag_with', io_json_mb_encode([]));
$values['tag_without'] = get_parameter(
@ -409,12 +411,14 @@ if ($update_event_filter) {
$values['severity'] = implode(',', get_parameter('severity', -1));
$values['status'] = get_parameter('status');
$values['search'] = get_parameter('search');
$values['not_search'] = get_parameter('not_search');
$values['text_agent'] = get_parameter('text_agent');
$values['id_agent'] = get_parameter('id_agent');
$values['id_agent_module'] = get_parameter('id_agent_module');
$values['pagination'] = get_parameter('pagination');
$values['event_view_hr'] = get_parameter('event_view_hr');
$values['id_user_ack'] = get_parameter('id_user_ack');
$values['owner_user'] = get_parameter('owner_user');
$values['group_rep'] = get_parameter('group_rep');
$values['tag_with'] = get_parameter('tag_with', io_json_mb_encode([]));
$values['tag_without'] = get_parameter(
@ -481,6 +485,7 @@ if ($get_filter_values) {
'user_comment' => '',
'id_extra' => '',
'id_user_ack' => '',
'owner_user' => '',
'date_from' => '',
'time_from' => '',
'date_to' => '',
@ -642,6 +647,8 @@ function load_form_filter() {
$("#status").val(val);
if (i == 'search')
$('#text-search').val(val);
if (i == 'not_search')
$('#checkbox-not_search').val(val);
if (i == 'text_agent')
$('input[name=text_agent]').val(val);
if (i == 'id_agent')
@ -654,6 +661,8 @@ function load_form_filter() {
$("#text-event_view_hr").val(val);
if (i == 'id_user_ack')
$("#id_user_ack").val(val);
if (i == 'owner_user')
$("#owner_user").val(val);
if (i == 'group_rep')
$("#group_rep").val(val);
if (i == 'tag_with')
@ -898,12 +907,14 @@ function save_new_filter() {
"severity" : $("#severity").val(),
"status" : $("#status").val(),
"search" : $("#text-search").val(),
"not_search" : $("#checkbox-not_search").val(),
"text_agent" : $("#text_id_agent").val(),
"id_agent" : $('input:hidden[name=id_agent]').val(),
"id_agent_module" : $('input:hidden[name=module_search_hidden]').val(),
"pagination" : $("#pagination").val(),
"event_view_hr" : $("#text-event_view_hr").val(),
"id_user_ack" : $("#id_user_ack").val(),
"owner_user" : $("#owner_user").val(),
"group_rep" : $("#group_rep").val(),
"tag_with": Base64.decode($("#hidden-tag_with").val()),
"tag_without": Base64.decode($("#hidden-tag_without").val()),
@ -975,12 +986,14 @@ function save_update_filter() {
"severity" : $("#severity").val(),
"status" : $("#status").val(),
"search" : $("#text-search").val(),
"not_search" : $("#checkbox-not_search").val(),
"text_agent" : $("#text_id_agent").val(),
"id_agent" : $('input:hidden[name=id_agent]').val(),
"id_agent_module" : $('input:hidden[name=module_search_hidden]').val(),
"pagination" : $("#pagination").val(),
"event_view_hr" : $("#text-event_view_hr").val(),
"id_user_ack" : $("#id_user_ack").val(),
"owner_user" : $("#owner_user").val(),
"group_rep" : $("#group_rep").val(),
"tag_with" : Base64.decode($("#hidden-tag_with").val()),
"tag_without" : Base64.decode($("#hidden-tag_without").val()),
@ -2421,6 +2434,7 @@ if ($get_events_fired) {
'severity' => -1,
'status' => -1,
'search' => '',
'not_search' => 0,
'text_agent' => '',
'id_agent' => 0,
'id_agent_module' => 0,

View File

@ -499,7 +499,9 @@ if (check_login()) {
$data[] = remove_right_zeros(
number_format(
$row[$attr[0]],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
}
@ -507,7 +509,9 @@ if (check_login()) {
$data[] = remove_right_zeros(
number_format(
$row[$attr[0]],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
}
@ -524,7 +528,9 @@ if (check_login()) {
$data[] = remove_right_zeros(
number_format(
$row[$attr[0]],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
}

View File

@ -2636,6 +2636,8 @@ class AgentWizard extends HTML
*/
private function resultsInterfaceWizard()
{
global $config;
$generalInterfaceModules = $this->getInterfacesModules();
$generalInterfaceTables = [];
$generalInterfaceModulesUpdated = [];
@ -2849,7 +2851,12 @@ class AgentWizard extends HTML
// Format current value with thousands and decimals.
if (is_numeric($currentValue) === true) {
$decimals = (is_float($currentValue) === true) ? 2 : 0;
$currentValue = number_format($currentValue, $decimals);
$currentValue = number_format(
$currentValue,
$decimals,
$config['decimal_separator'],
$config['thousand_separator']
);
}
// It unit of measure have data, attach to current value.

View File

@ -987,7 +987,7 @@ class Diagnostics extends Wizard
],
'tablesFragmentationValue' => [
'name' => __('Tables fragmentation (current value)'),
'value' => number_format($tFragmentationValue, 2).'%',
'value' => number_format($tFragmentationValue, 2, $config['decimal_separator'], $config['thousand_separator']).'%',
],
'tablesFragmentationStatus' => [
'name' => __('Table fragmentation status'),
@ -1122,7 +1122,9 @@ class Diagnostics extends Wizard
if ($totalModuleIntervalTime !== false) {
$averageTime = number_format(
((int) $totalNetworkModules / (int) $totalModuleIntervalTime),
3
3,
$config['decimal_separator'],
$config['thousand_separator']
);
}
@ -1749,7 +1751,7 @@ class Diagnostics extends Wizard
$sizeServerLog = number_format($fileSize);
$sizeServerLog = (0 + str_replace(',', '', $sizeServerLog));
$value = number_format(($fileSize / $mega), 3);
$value = number_format(($fileSize / $mega), 3, $config['decimal_separator'], $config['thousand_separator']);
$message = __('You have more than 10 MB of logs');
$status = 0;
if ($sizeServerLog <= $tenMega) {

View File

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

View File

@ -223,6 +223,8 @@ function list_files($directory, $stringSearch, $searchHandler, $return=false)
*/
function format_numeric($number, $decimals=1)
{
global $config;
// Translate to float in case there are characters in the string so
// fmod doesn't throw a notice
$number = (float) $number;
@ -231,17 +233,11 @@ function format_numeric($number, $decimals=1)
return 0;
}
// Translators: This is separator of decimal point
$dec_point = __('.');
// Translators: This is separator of decimal point
$thousands_sep = __(',');
// If has decimals
if (fmod($number, 1) > 0) {
return number_format($number, $decimals, $dec_point, $thousands_sep);
return number_format($number, $decimals, $config['decimal_separator'], $config['thousand_separator']);
}
return number_format($number, 0, $dec_point, $thousands_sep);
return number_format($number, 0, $config['decimal_separator'], $config['thousand_separator']);
}
@ -4088,14 +4084,18 @@ function series_type_graph_array($data, $show_elements_graph)
$data_return['legend'][$key] .= remove_right_zeros(
number_format(
$value['min'],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
$data_return['legend'][$key] .= ' '.__('Max:');
$data_return['legend'][$key] .= remove_right_zeros(
number_format(
$value['max'],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
$data_return['legend'][$key] .= ' '._('Avg:');
@ -4103,7 +4103,8 @@ function series_type_graph_array($data, $show_elements_graph)
number_format(
$value['avg'],
$config['graph_precision'],
$config['csv_decimal_separator']
$config['decimal_separator'],
$config['thousand_separator']
)
).' '.$str;
}
@ -4160,7 +4161,9 @@ function series_type_graph_array($data, $show_elements_graph)
$data_return['legend'][$key] .= remove_right_zeros(
number_format(
$value['data'][0][1],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
).' '.$str;
}

View File

@ -604,95 +604,6 @@ function api_get_module_last_value($idAgentModule, $trash1, $other=';', $returnT
}
/*
DB column mapping table used by tree_agents (and get module_properties)
*/
/*
* Agent related field mappings (output field => column designation for 'tagente').
* agent_id is not in this list (because it is mandatory).
* agent_id_group is not in this list.
*/
$agent_field_column_mapping = [
'agent_name' => 'nombre as agent_name',
'agent_direction' => 'direccion as agent_direction',
'agent_comentary' => 'comentarios as agent_comentary',
'agent_last_contant' => 'ultimo_contacto as agent_last_contant',
'agent_mode' => 'modo as agent_mode',
'agent_interval' => 'intervalo as agent_interval',
'agent_id_os' => 'id_os as agent_id_os',
'agent_os_version' => 'os_version as agent_os_version',
'agent_version' => 'agent_version as agent_version',
'agent_last_remote_contact' => 'ultimo_contacto_remoto as agent_last_remote_contact',
'agent_disabled' => 'disabled as agent_disabled',
'agent_id_parent' => 'id_parent as agent_id_parent',
'agent_custom_id' => 'custom_id as agent_custom_id',
'agent_server_name' => 'server_name as agent_server_name',
'agent_cascade_protection' => 'cascade_protection as agent_cascade_protection',
'agent_cascade_protection_module' => 'cascade_protection_module as agent_cascade_protection_module',
];
// module related field mappings 1/2 (output field => column for 'tagente_modulo')
// module_id_agent_modulo is not in this list
$module_field_column_mampping = [
'module_id_agent' => 'id_agente as module_id_agent',
'module_id_module_type' => 'id_tipo_modulo as module_id_module_type',
'module_description' => 'descripcion as module_description',
'module_name' => 'nombre as module_name',
'module_max' => 'max as module_max',
'module_min' => 'min as module_min',
'module_interval' => 'module_interval',
'module_tcp_port' => 'tcp_port as module_tcp_port',
'module_tcp_send' => 'tcp_send as module_tcp_send',
'module_tcp_rcv' => 'tcp_rcv as module_tcp_rcv',
'module_snmp_community' => 'snmp_community as module_snmp_community',
'module_snmp_oid' => 'snmp_oid as module_snmp_oid',
'module_ip_target' => 'ip_target as module_ip_target',
'module_id_module_group' => 'id_module_group as module_id_module_group',
'module_flag' => 'flag as module_flag',
'module_id_module' => 'id_modulo as module_id_module',
'module_disabled' => 'disabled as module_disabled',
'module_id_export' => 'id_export as module_id_export',
'module_plugin_user' => 'plugin_user as module_plugin_user',
'module_plugin_pass' => 'plugin_pass as module_plugin_pass',
'module_plugin_parameter' => 'plugin_parameter as module_plugin_parameter',
'module_id_plugin' => 'id_plugin as module_id_plugin',
'module_post_process' => 'post_process as module_post_process',
'module_prediction_module' => 'prediction_module as module_prediction_module',
'module_max_timeout' => 'max_timeout as module_max_timeout',
'module_max_retries' => 'max_retries as module_max_retries',
'module_custom_id' => 'custom_id as module_custom_id',
'module_history_data' => 'history_data as module_history_data',
'module_min_warning' => 'min_warning as module_min_warning',
'module_max_warning' => 'max_warning as module_max_warning',
'module_str_warning' => 'str_warning as module_str_warning',
'module_min_critical' => 'min_critical as module_min_critical',
'module_max_critical' => 'max_critical as module_max_critical',
'module_str_critical' => 'str_critical as module_str_critical',
'module_min_ff_event' => 'min_ff_event as module_min_ff_event',
'module_delete_pending' => 'delete_pending as module_delete_pending',
'module_plugin_macros' => 'macros as module_plugin_macros',
'module_macros' => 'module_macros as module_macros',
'module_critical_inverse' => 'critical_inverse as module_critical_inverse',
'module_warning_inverse' => 'warning_inverse as module_warning_inverse',
];
// module related field mappings 2/2 (output field => column for 'tagente_estado')
// module_id_agent_modulo is not in this list
$estado_fields_to_columns_mapping = [
'module_id_agent_state' => 'id_agente_estado as module_id_agent_state',
'module_data' => 'datos as module_data',
'module_timestamp' => 'timestamp as module_timestamp',
'module_state' => 'estado as module_state',
'module_last_try' => 'last_try as module_last_try',
'module_utimestamp' => 'utimestamp as module_utimestamp',
'module_current_interval' => 'current_interval as module_current_interval',
'module_running_by' => 'running_by as module_running_by',
'module_last_execution_try' => 'last_execution_try as module_last_execution_try',
'module_status_changes' => 'status_changes as module_status_changes',
'module_last_status' => 'last_status as module_last_status',
];
/***
* end of DB column mapping table
***/
@ -806,9 +717,9 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
'module_id_module',
'module_disabled',
'module_id_export',
'module_plugin_user',
'module_plugin_pass',
'module_plugin_parameter',
'module_plugin_pass',
'module_plugin_user',
'module_id_plugin',
'module_post_process',
'module_prediction_module',
@ -897,14 +808,88 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
'alert_actions_id_group',
];
// agent related field mappings (output field => column designation for 'tagente')
global $agent_field_column_mapping;
/*
* Agent related field mappings (output field => column designation for 'tagente').
* agent_id is not in this list (because it is mandatory).
* agent_id_group is not in this list.
*/
$agent_field_column_mapping = [
'agent_name' => 'nombre as agent_name',
'agent_direction' => 'direccion as agent_direction',
'agent_comentary' => 'comentarios as agent_comentary',
'agent_last_contant' => 'ultimo_contacto as agent_last_contant',
'agent_mode' => 'modo as agent_mode',
'agent_interval' => 'intervalo as agent_interval',
'agent_id_os' => 'id_os as agent_id_os',
'agent_os_version' => 'os_version as agent_os_version',
'agent_version' => 'agent_version as agent_version',
'agent_last_remote_contact' => 'ultimo_contacto_remoto as agent_last_remote_contact',
'agent_disabled' => 'disabled as agent_disabled',
'agent_id_parent' => 'id_parent as agent_id_parent',
'agent_custom_id' => 'custom_id as agent_custom_id',
'agent_server_name' => 'server_name as agent_server_name',
'agent_cascade_protection' => 'cascade_protection as agent_cascade_protection',
'agent_cascade_protection_module' => 'cascade_protection_module as agent_cascade_protection_module',
];
// module related field mappings 1/2 (output field => column for 'tagente_modulo')
global $module_field_column_mampping;
// module_id_agent_modulo is not in this list
// module_plugin_user, module_plugin_pass, module_plugin_macros are not in this list due to security purposes.
$module_field_column_mapping = [
'module_id_agent' => 'id_agente as module_id_agent',
'module_id_module_type' => 'id_tipo_modulo as module_id_module_type',
'module_description' => 'descripcion as module_description',
'module_name' => 'nombre as module_name',
'module_max' => 'max as module_max',
'module_min' => 'min as module_min',
'module_interval' => 'module_interval',
'module_tcp_port' => 'tcp_port as module_tcp_port',
'module_tcp_send' => 'tcp_send as module_tcp_send',
'module_tcp_rcv' => 'tcp_rcv as module_tcp_rcv',
'module_snmp_community' => 'snmp_community as module_snmp_community',
'module_snmp_oid' => 'snmp_oid as module_snmp_oid',
'module_ip_target' => 'ip_target as module_ip_target',
'module_id_module_group' => 'id_module_group as module_id_module_group',
'module_flag' => 'flag as module_flag',
'module_id_module' => 'id_modulo as module_id_module',
'module_disabled' => 'disabled as module_disabled',
'module_id_export' => 'id_export as module_id_export',
'module_plugin_parameter' => 'plugin_parameter as module_plugin_parameter',
'module_id_plugin' => 'id_plugin as module_id_plugin',
'module_post_process' => 'post_process as module_post_process',
'module_prediction_module' => 'prediction_module as module_prediction_module',
'module_max_timeout' => 'max_timeout as module_max_timeout',
'module_max_retries' => 'max_retries as module_max_retries',
'module_custom_id' => 'custom_id as module_custom_id',
'module_history_data' => 'history_data as module_history_data',
'module_min_warning' => 'min_warning as module_min_warning',
'module_max_warning' => 'max_warning as module_max_warning',
'module_str_warning' => 'str_warning as module_str_warning',
'module_min_critical' => 'min_critical as module_min_critical',
'module_max_critical' => 'max_critical as module_max_critical',
'module_str_critical' => 'str_critical as module_str_critical',
'module_min_ff_event' => 'min_ff_event as module_min_ff_event',
'module_delete_pending' => 'delete_pending as module_delete_pending',
'module_macros' => 'module_macros as module_macros',
'module_critical_inverse' => 'critical_inverse as module_critical_inverse',
'module_warning_inverse' => 'warning_inverse as module_warning_inverse',
];
// module related field mappings 2/2 (output field => column for 'tagente_estado')
global $estado_fields_to_columns_mapping;
// module_id_agent_modulo is not in this list
$estado_fields_to_columns_mapping = [
'module_id_agent_state' => 'id_agente_estado as module_id_agent_state',
'module_data' => 'datos as module_data',
'module_timestamp' => 'timestamp as module_timestamp',
'module_state' => 'estado as module_state',
'module_last_try' => 'last_try as module_last_try',
'module_utimestamp' => 'utimestamp as module_utimestamp',
'module_current_interval' => 'current_interval as module_current_interval',
'module_running_by' => 'running_by as module_running_by',
'module_last_execution_try' => 'last_execution_try as module_last_execution_try',
'module_status_changes' => 'status_changes as module_status_changes',
'module_last_status' => 'last_status as module_last_status',
];
// alert related field mappings (output field => column for 'talert_template_modules', ... )
$alert_fields_to_columns_mapping = [
@ -985,8 +970,8 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$agent_additional_columns .= (', '.$agent_field_column_mapping[$fld] );
}
if (array_key_exists($fld, $module_field_column_mampping)) {
$module_additional_columns .= (', '.$module_field_column_mampping[$fld]);
if (array_key_exists($fld, $module_field_column_mapping)) {
$module_additional_columns .= (', '.$module_field_column_mapping[$fld]);
}
if (array_key_exists($fld, $estado_fields_to_columns_mapping)) {
@ -1016,9 +1001,13 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$groups = [];
}
$groups = str_replace('\n', $returnReplace, $groups);
foreach ($groups as &$group) {
if (check_acl($config['id_user'], $group['group_id'], 'AR') === false) {
continue;
}
$group = str_replace('\n', $returnReplace, $group);
$group['type_row'] = 'group';
$returnVar[] = $group;
@ -1034,9 +1023,23 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$agents = [];
}
$agents = str_replace('\n', $returnReplace, $agents);
if ((bool) check_acl($config['id_user'], $id_group, 'AW') === true) {
if (array_search('module_plugin_user', $fields) !== false) {
$module_additional_columns .= ' ,plugin_user as module_plugin_user';
}
if (array_search('module_plugin_pass', $fields) !== false) {
$module_additional_columns .= ' ,plugin_pass as module_plugin_pass';
}
if (array_search('module_plugin_macros', $fields) !== false) {
$module_additional_columns .= ' ,macros as module_plugin_macros';
}
}
foreach ($agents as $index => &$agent) {
$agent = str_replace('\n', $returnReplace, $agent);
$agent['type_row'] = 'agent';
$returnVar[] = $agent;
@ -1048,24 +1051,26 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
// SKIP collecting MODULES and ALERTS
}
$sql = 'SELECT *
FROM (SELECT id_agente_modulo as module_id_agent_modulo '.$module_additional_columns.'
FROM tagente_modulo t1
WHERE id_agente = '.$agent['agent_id'].') t1
INNER JOIN (SELECT id_agente_modulo as module_id_agent_modulo '.$estado_additional_columns.'
FROM tagente_estado
WHERE id_agente = '.$agent['agent_id'].') t2
ON t1.module_id_agent_modulo = t2.module_id_agent_modulo';
$modules = db_get_all_rows_sql(
'SELECT *
FROM (SELECT id_agente_modulo as module_id_agent_modulo '.$module_additional_columns.'
FROM tagente_modulo
WHERE id_agente = '.$agent['agent_id'].') t1
INNER JOIN (SELECT id_agente_modulo as module_id_agent_modulo '.$estado_additional_columns.'
FROM tagente_estado
WHERE id_agente = '.$agent['agent_id'].') t2
ON t1.module_id_agent_modulo = t2.module_id_agent_modulo'
$sql
);
if ($modules === false) {
$modules = [];
}
$modules = str_replace('\n', $returnReplace, $modules);
foreach ($modules as &$module) {
$module = str_replace('\n', $returnReplace, $module);
$module['type_row'] = 'module';
if ($module['module_macros']) {
@ -1097,9 +1102,8 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$alerts = [];
}
$alerts = str_replace('\n', $returnReplace, $alerts);
foreach ($alerts as &$alert) {
$alert = str_replace('\n', $returnReplace, $alert);
$alert['type_row'] = 'alert';
$returnVar[] = $alert;
}
@ -1366,10 +1370,66 @@ function get_module_properties($id_module, $fields, $separator, $returnType, $re
];
// module related field mappings 1/2 (output field => column for 'tagente_modulo')
global $module_field_column_mampping;
// module_id_agent_modulo is not in this list
// module_plugin_user, module_plugin_pass, module_plugin_macros are not in this list due to security purposes.
$module_field_column_mapping = [
'module_id_agent' => 'id_agente as module_id_agent',
'module_id_module_type' => 'id_tipo_modulo as module_id_module_type',
'module_description' => 'descripcion as module_description',
'module_name' => 'nombre as module_name',
'module_max' => 'max as module_max',
'module_min' => 'min as module_min',
'module_interval' => 'module_interval',
'module_tcp_port' => 'tcp_port as module_tcp_port',
'module_tcp_send' => 'tcp_send as module_tcp_send',
'module_tcp_rcv' => 'tcp_rcv as module_tcp_rcv',
'module_snmp_community' => 'snmp_community as module_snmp_community',
'module_snmp_oid' => 'snmp_oid as module_snmp_oid',
'module_ip_target' => 'ip_target as module_ip_target',
'module_id_module_group' => 'id_module_group as module_id_module_group',
'module_flag' => 'flag as module_flag',
'module_id_module' => 'id_modulo as module_id_module',
'module_disabled' => 'disabled as module_disabled',
'module_id_export' => 'id_export as module_id_export',
'module_plugin_parameter' => 'plugin_parameter as module_plugin_parameter',
'module_plugin_user' => 'plugin_user as module_plugin_user',
'module_plugin_pass' => 'plugin_pass as module_plugin_pass',
'module_plugin_macros' => 'macros as module_plugin_macros',
'module_id_plugin' => 'id_plugin as module_id_plugin',
'module_post_process' => 'post_process as module_post_process',
'module_prediction_module' => 'prediction_module as module_prediction_module',
'module_max_timeout' => 'max_timeout as module_max_timeout',
'module_max_retries' => 'max_retries as module_max_retries',
'module_custom_id' => 'custom_id as module_custom_id',
'module_history_data' => 'history_data as module_history_data',
'module_min_warning' => 'min_warning as module_min_warning',
'module_max_warning' => 'max_warning as module_max_warning',
'module_str_warning' => 'str_warning as module_str_warning',
'module_min_critical' => 'min_critical as module_min_critical',
'module_max_critical' => 'max_critical as module_max_critical',
'module_str_critical' => 'str_critical as module_str_critical',
'module_min_ff_event' => 'min_ff_event as module_min_ff_event',
'module_delete_pending' => 'delete_pending as module_delete_pending',
'module_macros' => 'module_macros as module_macros',
'module_critical_inverse' => 'critical_inverse as module_critical_inverse',
'module_warning_inverse' => 'warning_inverse as module_warning_inverse',
];
// module related field mappings 2/2 (output field => column for 'tagente_estado')
global $estado_fields_to_columns_mapping;
// module_id_agent_modulo is not in this list
$estado_fields_to_columns_mapping = [
'module_id_agent_state' => 'id_agente_estado as module_id_agent_state',
'module_data' => 'datos as module_data',
'module_timestamp' => 'timestamp as module_timestamp',
'module_state' => 'estado as module_state',
'module_last_try' => 'last_try as module_last_try',
'module_utimestamp' => 'utimestamp as module_utimestamp',
'module_current_interval' => 'current_interval as module_current_interval',
'module_running_by' => 'running_by as module_running_by',
'module_last_execution_try' => 'last_execution_try as module_last_execution_try',
'module_status_changes' => 'status_changes as module_status_changes',
'module_last_status' => 'last_status as module_last_status',
];
if ($fields == false) {
$fields = $module_properties_master_fields;
@ -1379,8 +1439,8 @@ function get_module_properties($id_module, $fields, $separator, $returnType, $re
$module_additional_columns = '';
$estado_additional_columns = '';
foreach ($fields as $fld) {
if (array_key_exists($fld, $module_field_column_mampping)) {
$module_additional_columns .= (', '.$module_field_column_mampping[$fld]);
if (array_key_exists($fld, $module_field_column_mapping)) {
$module_additional_columns .= (', '.$module_field_column_mapping[$fld]);
}
if (array_key_exists($fld, $estado_fields_to_columns_mapping)) {
@ -1405,9 +1465,9 @@ function get_module_properties($id_module, $fields, $separator, $returnType, $re
$modules = [];
}
$modules = str_replace('\n', $returnReplace, $modules);
foreach ($modules as &$module) {
$module = str_replace('\n', $returnReplace, $module);
$module['type_row'] = 'module';
if ($module['module_macros']) {
@ -16930,6 +16990,32 @@ function api_set_add_permission_user_to_group($thrash1, $thrash2, $other, $retur
];
$group_exist = db_get_value_filter(
'id_grupo',
'tgrupo',
[
'id_grupo' => $values['id_grupo'],
]
);
if ((bool) $group_exist === false) {
returnError('Selected group does not exist');
return;
}
$profile_exist = db_get_value_filter(
'id_perfil',
'tperfil',
[
'id_perfil' => $values['id_perfil'],
]
);
if ((bool) $profile_exist === false) {
returnError('Selected profile does not exist');
return;
}
$where_id_up = ['id_up' => $other['data'][4]];
if ($exist_profile === $other['data'][4] && $where_id_up !== null) {
$sucessfull_insert = db_process_sql_update('tusuario_perfil', $values, $where_id_up);

View File

@ -1475,6 +1475,15 @@ function config_update_config()
if (config_update_value('use_data_multiplier', get_parameter('use_data_multiplier', '1'), true) === false) {
$error_update[] = __('Use data multiplier');
}
if (config_update_value('decimal_separator', (string) get_parameter('decimal_separator', '.'), true) === false) {
$error_update[] = __('Decimal separator');
} else {
$thousand_separator = ((string) get_parameter('decimal_separator', '.') === '.') ? ',' : '.';
if (config_update_value('thousand_separator', $thousand_separator, true) === false) {
$error_update[] = __('Thousand separator');
}
}
break;
case 'net':
@ -3446,7 +3455,7 @@ function config_process_config()
}
if (!isset($config['ehorus_port'])) {
config_update_value('ehorus_port', 18080);
config_update_value('ehorus_port', 443);
}
if (!isset($config['ehorus_req_timeout'])) {
@ -3479,6 +3488,10 @@ function config_process_config()
config_update_value('module_library_password', '');
}
if (!isset($config['decimal_separator'])) {
config_update_value('decimal_separator', '.');
}
// Finally, check if any value was overwritten in a form.
config_update_config();
}

View File

@ -640,11 +640,13 @@ function events_update_status($id_evento, $status, $filter=null)
* 'status'
* 'agent_alias'
* 'search'
* 'not_search'
* 'id_extra'
* 'id_source_event'
* 'user_comment'
* 'source'
* 'id_user_ack'
* 'owner_user'
* 'tag_with'
* 'tag_without'
* 'filter_only_alert'
@ -1058,16 +1060,40 @@ function events_get_all(
$custom_data_search = 'te.custom_data';
}
$sql_filters[] = vsprintf(
' AND (lower(ta.alias) like lower("%%%s%%")
OR te.id_evento like "%%%s%%"
OR lower(te.evento) like lower("%%%s%%")
OR lower(te.user_comment) like lower("%%%s%%")
OR lower(te.id_extra) like lower("%%%s%%")
OR lower(te.source) like lower("%%%s%%")
OR lower('.$custom_data_search.') like lower("%%%s%%") )',
array_fill(0, 7, $filter['search'])
);
$not_search = '';
$nexo = 'OR';
$array_search = [
'te.id_evento',
'lower(te.evento)',
'lower(te.user_comment)',
'lower(te.id_extra)',
'lower(te.source)',
'lower('.$custom_data_search.')',
];
if (isset($filter['not_search']) === true
&& empty($filter['not_search']) === false
) {
$not_search = 'NOT';
$nexo = 'AND';
} else {
$array_search[] = 'lower(ta.alias)';
}
$sql_search = ' AND (';
foreach ($array_search as $key => $field) {
$sql_search .= sprintf(
'%s %s %s like lower("%%%s%%")',
($key === 0) ? '' : $nexo,
$field,
$not_search,
$filter['search']
);
$sql_search .= ' ';
}
$sql_search .= ' )';
$sql_filters[] = $sql_search;
}
// Free search exclude.
@ -1152,11 +1178,19 @@ function events_get_all(
// Validated or in process by.
if (empty($filter['id_user_ack']) === false) {
$sql_filters[] = sprintf(
' AND te.owner_user like lower("%%%s%%") ',
' AND te.id_usuario like lower("%%%s%%") ',
$filter['id_user_ack']
);
}
// Owner by.
if (empty($filter['owner_user']) === false) {
$sql_filters[] = sprintf(
' AND te.owner_user like lower("%%%s%%") ',
$filter['owner_user']
);
}
$tag_names = [];
// With following tags.
if (empty($filter['tag_with']) === false) {

View File

@ -1950,7 +1950,7 @@ function html_print_extended_select_for_post_process(
$found = false;
if ($selected) {
if (array_key_exists(number_format($selected, 14, '.', ','), $fields)) {
if (array_key_exists(number_format($selected, 14, $config['decimal_separator'], $config['thousand_separator']), $fields)) {
$found = true;
}
}

View File

@ -2589,12 +2589,12 @@ function modules_get_agentmodule_data_for_humans($module)
$salida = human_milliseconds_to_string($module['datos']);
}
} else {
$salida = remove_right_zeros(number_format($module['datos'], $config['graph_precision']));
$salida = remove_right_zeros(number_format($module['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
}
break;
default:
$salida = remove_right_zeros(number_format($module['datos'], $config['graph_precision']));
$salida = remove_right_zeros(number_format($module['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
break;
}
break;
@ -2613,12 +2613,12 @@ function modules_get_agentmodule_data_for_humans($module)
$salida = human_milliseconds_to_string($module['datos']);
}
} else {
$salida = remove_right_zeros(number_format($module['datos'], $config['graph_precision']));
$salida = remove_right_zeros(number_format($module['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
}
break;
default:
$salida = remove_right_zeros(number_format($module['datos'], $config['graph_precision']));
$salida = remove_right_zeros(number_format($module['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
break;
}
}
@ -2900,7 +2900,7 @@ function modules_get_status($id_agent_module, $db_status, $data, &$status, &$tit
}
if (is_numeric($data)) {
$title .= ': '.remove_right_zeros(number_format($data, $config['graph_precision']));
$title .= ': '.remove_right_zeros(number_format($data, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
} else {
$text = io_safe_output($data);

View File

@ -1834,14 +1834,24 @@ function reporting_event_top_n(
$divisor = get_data_multiplier($units[$key_dt]);
$data['formated_value'] = format_for_graph(
$dt,
2,
'.',
',',
$divisor,
$units[$key_dt]
);
if ((bool) $content['use_prefix_notation'] === false) {
$data['formated_value'] = number_format(
$dt,
2,
$config['decimal_separator'],
$config['thousand_separator']
).' '.$units[$key_dt];
} else {
$data['formated_value'] = format_for_graph(
$dt,
2,
'.',
',',
$divisor,
$units[$key_dt]
);
}
$data_return[] = $data;
}
@ -1902,14 +1912,25 @@ function reporting_event_top_n(
$data['agent'] = $an;
$data['module'] = $module_name[$key_an];
$data['value'] = $data_top[$key_an];
$data['formated_value'] = format_for_graph(
$data_top[$key_an],
2,
'.',
',',
$divisor,
$units[$key_an]
);
if ((bool) $content['use_prefix_notation'] === false) {
$data['formated_value'] = number_format(
$data_top[$key_an],
2,
$config['decimal_separator'],
$config['thousand_separator']
).' '.$units[$key_an];
} else {
$data['formated_value'] = format_for_graph(
$data_top[$key_an],
2,
'.',
',',
$divisor,
$units[$key_an]
);
}
$data_return[] = $data;
}
@ -6963,6 +6984,13 @@ function reporting_value($report, $content, $type, $pdf=false)
if (!$config['simple_module_value']) {
$formated_value = $value;
} else if ((bool) $content['use_prefix_notation'] === false) {
$formated_value = number_format(
$value,
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
).' '.$unit;
} else {
$formated_value = format_for_graph(
$value,
@ -7123,6 +7151,13 @@ function reporting_value($report, $content, $type, $pdf=false)
);
if (!$config['simple_module_value']) {
$formated_value = $value;
} else if ((bool) $content['use_prefix_notation'] === false) {
$formated_value = number_format(
$value,
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
).' '.$unit;
} else {
$divisor = get_data_multiplier($unit);

View File

@ -2291,7 +2291,9 @@ function reporting_html_agent_module_status($table, $item, $pdf=0)
$row['data_module'] = remove_right_zeros(
number_format(
$data['data_module'],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
} else {
@ -2784,7 +2786,7 @@ function reporting_html_historical_data($table, $item, $pdf=0)
} else {
$row = [
$data[__('Date')],
remove_right_zeros(number_format($data[__('Data')], $config['graph_precision'])),
remove_right_zeros(number_format($data[__('Data')], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])),
];
}
@ -2924,7 +2926,9 @@ function reporting_html_last_value($table, $item, $pdf=0)
$dataDatos = remove_right_zeros(
number_format(
$item['data']['datos'],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
} else {
@ -3469,7 +3473,9 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0)
).' '.__('OK').': '.remove_right_zeros(
number_format(
$item['data']['ok']['value'],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
).' %</p>';
@ -3480,7 +3486,9 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0)
).' '.__('Not OK').': '.remove_right_zeros(
number_format(
$item['data']['fail']['value'],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
).' % '.'</p>';
}
@ -3834,7 +3842,9 @@ function reporting_html_value(
remove_right_zeros(
number_format(
$data[__('Maximun')],
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
),
];

View File

@ -1349,9 +1349,6 @@ function servers_get_server_string_name(int $server)
case SERVER_TYPE_ENTERPRISE_SATELLITE:
return __('Satellite server');
case SERVER_TYPE_ENTERPRISE_TRANSACTIONAL:
return __('Transactional server');
case SERVER_TYPE_ALERT:
return __('Alert server');

View File

@ -193,7 +193,7 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') {
$data = "<span title='".$last_data['datos']."' class='nowrap'>".human_milliseconds_to_string($last_data['datos']).'</span>';
} else if (is_numeric($last_data['datos'])) {
$data = "<span class='span_treeview'>".remove_right_zeros(number_format($last_data['datos'], $config['graph_precision'])).'</span>';
$data = "<span class='span_treeview'>".remove_right_zeros(number_format($last_data['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])).'</span>';
} else {
$data = ui_print_truncate_text(
io_safe_output($last_data['datos']),
@ -209,7 +209,7 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
default:
if (is_numeric($last_data['datos'])) {
$data = "<span class='span_treeview'>".remove_right_zeros(number_format($last_data['datos'], $config['graph_precision'])).'</span>';
$data = "<span class='span_treeview'>".remove_right_zeros(number_format($last_data['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])).'</span>';
} else {
$data = ui_print_truncate_text(
io_safe_output($last_data['datos']),
@ -232,7 +232,7 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') {
$data = "<span title='".human_milliseconds_to_string($last_data['datos'])."' class='nowrap'>".human_milliseconds_to_string($last_data['datos']).'</span>';
} else if (is_numeric($last_data['datos'])) {
$data = "<span class='span_treeview'>".remove_right_zeros(number_format($last_data['datos'], $config['graph_precision'])).'</span>';
$data = "<span class='span_treeview'>".remove_right_zeros(number_format($last_data['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])).'</span>';
} else {
$data = ui_print_truncate_text(
io_safe_output($last_data['datos']),
@ -248,7 +248,7 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
default:
if (is_numeric($last_data['datos'])) {
$data = "<span class='span_treeview'>".remove_right_zeros(number_format($last_data['datos'], $config['graph_precision'])).'</span>';
$data = "<span class='span_treeview'>".remove_right_zeros(number_format($last_data['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])).'</span>';
} else {
$data = ui_print_truncate_text(
io_safe_output($last_data['datos']),
@ -271,7 +271,7 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
$data_macro = modules_get_unit_macro($last_data['datos'], $module['unit']);
if ($data_macro) {
if (is_numeric($data_macro)) {
$last_data_str = "<span class='span_treeview'>".remove_right_zeros(number_format($data_macro, $config['graph_precision'])).'</span>';
$last_data_str = "<span class='span_treeview'>".remove_right_zeros(number_format($data_macro, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])).'</span>';
} else {
$last_data_str = ui_print_truncate_text(
io_safe_output($data_macro),
@ -594,10 +594,10 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$hashdata = $user.$pwd_deserialiced['auth_token'];
$hashdata = md5($hashdata);
$url = $server_data['server_url'].'/index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$agent['id_agente'].'&'.'loginhash=auto&'."loginhash_data=$hashdata&".'loginhash_user='.str_rot13($user);
$url = $server_data['server_url'].'/index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$agent['id_agente'];
if ($grants_on_node && (bool) $user_access_node !== false) {
$cellName .= '<a href="'.$url.'">'.'<b><span class="bolder pandora_upper" title="'.$agent['nombre'].'">'.$agent['alias'].'</span></b></a>';
$cellName .= '<a onclick="sendHash(\''.$url.'\')" href="#"><b><span class="bolder pandora_upper" title="'.$agent['nombre'].'">'.$agent['alias'].'</span></b></a>';
} else {
$cellName .= '<b><span class="bolder pandora_upper" title="'.$agent['nombre'].'">'.$agent['alias'].'</span></b>';
}
@ -703,7 +703,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$go_to_agent .= html_print_submit_button(__('Edit cluster'), 'upd_button', false, 'class="sub config"', true);
}
} else {
$go_to_agent .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$url_hash.'">';
$go_to_agent .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$ent.'">';
$go_to_agent .= html_print_submit_button(__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true);
}
@ -905,5 +905,12 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
metaconsole_restore_db();
}
return;
echo "
<script>
function sendHash(url) {
window.location = url+'&loginhash=auto&loginhash_data=".$hashdata.'&loginhash_user='.str_rot13($user)."';
}
</script>";
}

View File

@ -6592,10 +6592,11 @@ function ui_print_comments($comments)
} else {
$rest_time = (time() - $last_comment['utimestamp']);
$time_last = (($rest_time / 60) / 60);
$comentario = '<i>'.number_format($time_last, 0).'&nbsp; Hours &nbsp;('.$last_comment['id_user'].'):&nbsp;'.$last_comment['comment'].'';
$comentario = '<i>'.number_format($time_last, 0, $config['decimal_separator'], $config['thousand_separator']).'&nbsp; Hours &nbsp;('.$last_comment['id_user'].'):&nbsp;'.$last_comment['comment'].'';
if (strlen($comentario) > '200px') {
$comentario = '<i>'.number_format($time_last, 0).'&nbsp; Hours &nbsp;('.$last_comment['id_user'].'):&nbsp;'.$short_comment.'...';
$comentario = '<i>'.number_format($time_last, 0, $config['decimal_separator'], $config['thousand_separator']).'&nbsp; Hours &nbsp;('.$last_comment['id_user'].'):&nbsp;'.$short_comment.'...';
}
}

View File

@ -924,7 +924,7 @@ function visual_map_print_item(
$value_text = format_for_graph($module_value, 2);
if ($value_text <= 0) {
$value_text = remove_right_zeros(number_format($module_value, $config['graph_precision']));
$value_text = remove_right_zeros(number_format($module_value, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
}
if (!empty($unit_text)) {
@ -1743,7 +1743,7 @@ function visual_map_print_item(
|| (modules_is_boolean($layoutData['id_agente_modulo']) && $layoutData['show_last_value'] != 0)
) {
if (is_numeric($value)) {
$img_style_title .= ' <br>'.__('Last value: ').remove_right_zeros(number_format($value, $config['graph_precision']));
$img_style_title .= ' <br>'.__('Last value: ').remove_right_zeros(number_format($value, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
} else {
$img_style_title .= ' <br>'.__('Last value: ').$value;
}
@ -1881,13 +1881,13 @@ function visual_map_print_item(
echo '</tr>';
echo "<tr class='bg_whitesmoke height_90p'>";
echo '<td>';
echo "<div class='critical_zeros'>".remove_right_zeros(number_format($stat_agent_cr, 2)).'%</div>';
echo "<div class='critical_zeros'>".remove_right_zeros(number_format($stat_agent_cr, 2, $config['decimal_separator'], $config['thousand_separator'])).'%</div>';
echo "<div class='critical_vm'>Critical</div>";
echo "<div class='warning_zeros'>".remove_right_zeros(number_format($stat_agent_wa, 2)).'%</div>';
echo "<div class='warning_zeros'>".remove_right_zeros(number_format($stat_agent_wa, 2, $config['decimal_separator'], $config['thousand_separator'])).'%</div>';
echo "<div class='warning_vm'>Warning</div>";
echo "<div class='normal_zeros'>".remove_right_zeros(number_format($stat_agent_ok, 2)).'%</div>';
echo "<div class='normal_zeros'>".remove_right_zeros(number_format($stat_agent_ok, 2, $config['decimal_separator'], $config['thousand_separator'])).'%</div>';
echo "<div class='normal_vm'>Normal</div>";
echo "<div class='unknown_zeros'>".remove_right_zeros(number_format($stat_agent_un, 2)).'%</div>';
echo "<div class='unknown_zeros'>".remove_right_zeros(number_format($stat_agent_un, 2, $config['decimal_separator'], $config['thousand_separator'])).'%</div>';
echo "<div class='unknown_vm'>Unknown</div>";
echo '</td>';
echo '</tr>';
@ -2452,7 +2452,7 @@ function visual_map_get_simple_value($type, $id_module, $period=SECONDS_1DAY)
} else {
if (is_numeric($value)) {
if ($config['simple_module_value']) {
$value = remove_right_zeros(number_format($value, $config['graph_precision']));
$value = remove_right_zeros(number_format($value, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
}
}

View File

@ -504,11 +504,11 @@ function flot_custom_pie_chart(
foreach ($graph_values as $label => $value) {
if ($value['value']) {
if ($value['value'] > 1000000) {
$legendvalue = sprintf('%sM', remove_right_zeros(number_format(($value['value'] / 1000000), $config['graph_precision'])));
$legendvalue = sprintf('%sM', remove_right_zeros(number_format(($value['value'] / 1000000), $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])));
} else if ($value['value'] > 1000) {
$legendvalue = sprintf('%sK', remove_right_zeros(number_format(($value['value'] / 1000), $config['graph_precision'])));
$legendvalue = sprintf('%sK', remove_right_zeros(number_format(($value['value'] / 1000), $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])));
} else {
$legendvalue = remove_right_zeros(number_format($value['value'], $config['graph_precision']));
$legendvalue = remove_right_zeros(number_format($value['value'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
}
} else {
$legendvalue = __('No data');

View File

@ -555,7 +555,7 @@ class ModuleIconWidget extends Widget
// Div value.
$output .= '<div style="flex: 0 1 10px; font-size:'.$sizeValue.'px;">';
$output .= remove_right_zeros(
number_format($data_module, $config['graph_precision'])
number_format($data_module, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])
);
$output .= '</div>';

View File

@ -439,7 +439,9 @@ class ModuleValueWidget extends Widget
$dataDatos = remove_right_zeros(
number_format(
$data_module,
$config['graph_precision']
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
} else {

View File

@ -397,10 +397,12 @@ final class Group extends Item
string $groupName,
array $agentStats
): string {
$critical = \number_format($agentStats['critical'], 2).'%';
$warning = \number_format($agentStats['warning'], 2).'%';
$normal = \number_format($agentStats['normal'], 2).'%';
$unknown = \number_format($agentStats['unknown'], 2).'%';
global $config;
$critical = \number_format($agentStats['critical'], 2, $config['decimal_separator'], $config['thousand_separator']).'%';
$warning = \number_format($agentStats['warning'], 2, $config['decimal_separator'], $config['thousand_separator']).'%';
$normal = \number_format($agentStats['normal'], 2, $config['decimal_separator'], $config['thousand_separator']).'%';
$unknown = \number_format($agentStats['unknown'], 2, $config['decimal_separator'], $config['thousand_separator']).'%';
$html = '<div class="group-container">';
$html .= '<div class="group-item-title">';

View File

@ -396,8 +396,8 @@ final class Percentile extends Item
$data['value'] = (float) \number_format(
(float) $moduleValue,
(int) $config['graph_precision'],
'.',
''
$config['decimal_separator'],
$config['thousand_separator']
);
$unit = '';
if ($moduleId !== null && $moduleId !== 0) {

View File

@ -281,7 +281,7 @@ final class StaticGraph extends Item
) {
if (\is_numeric($value)) {
$imgTitle .= __('Last value: ').\remove_right_zeros(
\number_format((float) $value, (int) $config['graph_precision'])
\number_format((float) $value, (int) $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])
);
} else {
$imgTitle .= __('Last value: ').$value;

View File

@ -140,6 +140,11 @@ form.flex-row div.filter_input.filter_input_switch .p-slider {
width: 30px;
}
form .filter_input_not_search .p-switch {
flex: 0 1 30px;
margin: 0;
}
fieldset {
margin: 0 auto;
}

View File

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

View File

@ -2048,7 +2048,12 @@ if (is_ajax() === true) {
$array_filter = json_decode($networkmap['filter']);
if (isset($array_filter->z_dash)) {
$array_filter->z_dash = number_format($scale, 2);
$array_filter->z_dash = number_format(
$scale,
2,
$config['decimal_separator'],
$config['thousand_separator']
);
}
$filter = json_encode($array_filter);

View File

@ -1589,7 +1589,7 @@ if (!empty($result)) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_OK,
__('NORMAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
__('NORMAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])),
true
);
} else {
@ -1604,7 +1604,12 @@ if (!empty($result)) {
$data[6] = ui_print_status_image(
STATUS_MODULE_CRITICAL,
__('CRITICAL').': '.remove_right_zeros(
number_format($row['datos'], $config['graph_precision'])
number_format(
$row['datos'],
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
),
true
);
@ -1620,7 +1625,12 @@ if (!empty($result)) {
$data[6] = ui_print_status_image(
STATUS_MODULE_WARNING,
__('WARNING').': '.remove_right_zeros(
number_format($row['datos'], $config['graph_precision'])
number_format(
$row['datos'],
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
),
true
);
@ -1636,7 +1646,12 @@ if (!empty($result)) {
$data[6] = ui_print_status_image(
STATUS_MODULE_UNKNOWN,
__('UNKNOWN').': '.remove_right_zeros(
number_format($row['datos'], $config['graph_precision'])
number_format(
$row['datos'],
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
),
true
);
@ -1652,7 +1667,12 @@ if (!empty($result)) {
$data[6] = ui_print_status_image(
STATUS_MODULE_NO_DATA,
__('NO DATA').': '.remove_right_zeros(
number_format($row['datos'], $config['graph_precision'])
number_format(
$row['datos'],
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
),
true
);
@ -1672,7 +1692,7 @@ if (!empty($result)) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_UNKNOWN,
__('UNKNOWN').' - '.__('Last status').' '.__('NORMAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
__('UNKNOWN').' - '.__('Last status').' '.__('NORMAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])),
true
);
} else {
@ -1688,7 +1708,7 @@ if (!empty($result)) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_UNKNOWN,
__('UNKNOWN').' - '.__('Last status').' '.__('CRITICAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
__('UNKNOWN').' - '.__('Last status').' '.__('CRITICAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])),
true
);
} else {
@ -1704,7 +1724,7 @@ if (!empty($result)) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_UNKNOWN,
__('UNKNOWN').' - '.__('Last status').' '.__('WARNING').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
__('UNKNOWN').' - '.__('Last status').' '.__('WARNING').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])),
true
);
} else {
@ -1849,12 +1869,12 @@ if (!empty($result)) {
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') {
$salida = human_milliseconds_to_string($row['datos']);
} else {
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
}
break;
default:
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
break;
}
break;
@ -1866,12 +1886,12 @@ if (!empty($result)) {
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') {
$salida = human_milliseconds_to_string($row['datos']);
} else {
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
}
break;
default:
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator']));
break;
}
}

View File

@ -122,6 +122,10 @@ $search = get_parameter(
'filter[search]',
($filter['search'] ?? '')
);
$not_search = get_parameter(
'filter[not_search]',
0
);
$text_agent = get_parameter(
'filter[text_agent]',
($filter['text_agent'] ?? '')
@ -153,6 +157,10 @@ $id_user_ack = get_parameter(
'filter[id_user_ack]',
($filter['id_user_ack'] ?? '')
);
$owner_user = get_parameter(
'filter[owner_user]',
($filter['owner_user'] ?? '')
);
$group_rep = get_parameter(
'filter[group_rep]',
($filter['group_rep'] ?? '')
@ -1082,6 +1090,7 @@ if ($loaded_filter !== false && $from_event_graph != 1 && isset($fb64) === false
$severity = $filter['severity'];
$status = $filter['status'];
$search = $filter['search'];
$not_search = $filter['not_search'];
$text_agent = $filter['text_agent'];
$id_agent = $filter['id_agent'];
$id_agent_module = $filter['id_agent_module'];
@ -1095,6 +1104,7 @@ if ($loaded_filter !== false && $from_event_graph != 1 && isset($fb64) === false
$pagination = $filter['pagination'];
$event_view_hr = $filter['event_view_hr'];
$id_user_ack = $filter['id_user_ack'];
$owner_user = $filter['owner_user'];
$group_rep = $filter['group_rep'];
$tag_with = json_decode(io_safe_output($filter['tag_with']));
$tag_without = json_decode(io_safe_output($filter['tag_without']));
@ -1707,8 +1717,23 @@ $inputs[] = $in;
// Free search.
$data = html_print_input_text('search', $search, '', '', 255, true);
$in = '<div class="filter_input"><label>'.__('Free search').'</label>';
$in .= $data.'</div>';
// Search recursive groups.
$data .= ui_print_help_tip(
__('Search for elements NOT containing given text.'),
true
);
$data .= html_print_checkbox_switch(
'not_search',
$not_search,
$not_search,
true,
false,
'checked_slide_events(this);',
true
);
$in = '<div class="filter_input filter_input_not_search"><label>'.__('Free search').'</label>';
$in .= $data;
$in .= '</div>';
$inputs[] = $in;
if (is_array($severity) === false) {
@ -1747,7 +1772,7 @@ $data = html_print_checkbox_switch(
$search_recursive_groups,
true,
false,
'search_in_secondary_groups(this);',
'checked_slide_events(this);',
true
);
@ -1769,7 +1794,7 @@ $data = html_print_checkbox_switch(
$search_secondary_groups,
true,
false,
'search_in_secondary_groups(this);',
'checked_slide_events(this);',
true
);
@ -1934,6 +1959,19 @@ $in = '<div class="filter_input"><label>'.__('User ack.').'</label>';
$in .= $data.'</div>';
$adv_inputs[] = $in;
$data = html_print_select(
$user_users,
'owner_user',
$owner_user,
'',
__('Any'),
0,
true
);
$in = '<div class="filter_input"><label>'.__('Owner').'</label>';
$in .= $data.'</div>';
$adv_inputs[] = $in;
// Only alert events.
$data = html_print_select(
[
@ -3076,7 +3114,7 @@ $(document).ready( function() {
});
function search_in_secondary_groups(element) {
function checked_slide_events(element) {
var value = $("#checkbox-"+element.name).val();
if (value == 0) {
$("#checkbox-"+element.name).val(1);

View File

@ -166,8 +166,6 @@ if ($access_console_node === true) {
$sub['operation/agentes/pandora_networkmap']['text'] = __('Network map');
$sub['operation/agentes/pandora_networkmap']['id'] = 'Network map';
$sub['operation/agentes/pandora_networkmap']['refr'] = 0;
enterprise_hook('transmap_console');
}
enterprise_hook('services_menu');

View File

@ -18,7 +18,8 @@ require_once $config['homedir'].'/include/functions_reporting.php';
enterprise_include('operation/reporting/custom_reporting.php');
$searchAgents = $searchAlerts = $searchModules = check_acl($config['id_user'], 0, 'AR');
$searchUsers = $searchPolicies = (check_acl($config['id_user'], 0, 'AR') && enterprise_installed());
$searchUsers = (check_acl($config['id_user'], 0, 'AR'));
$searchPolicies = (check_acl($config['id_user'], 0, 'AR') && enterprise_installed());
$searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'RR');
$searchMaps = check_acl($config['id_user'], 0, 'VR');
$searchMain = true;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.767
%define release 221213
%define release 221219
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.767
%define release 221213
%define release 221219
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.767
%define release 221213
%define release 221219
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1238,6 +1238,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` (
`severity` TEXT,
`status` INT NOT NULL DEFAULT -1,
`search` TEXT,
`not_search` INT NOT NULL DEFAULT 0,
`text_agent` TEXT,
`id_agent` INT DEFAULT 0,
`id_agent_module` INT DEFAULT 0,
@ -1261,6 +1262,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` (
`time_to` TIME NULL,
`custom_data` VARCHAR(500) DEFAULT '',
`custom_data_filter_type` TINYINT UNSIGNED DEFAULT 0,
`owner_user` TEXT,
PRIMARY KEY (`id_filter`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@ -1622,6 +1624,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`ipam_ip_not_assigned_to_agent` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`macros_definition` TEXT,
`render_definition` TEXT,
`use_prefix_notation` TINYINT UNSIGNED NOT NULL DEFAULT 1,
PRIMARY KEY(`id_rc`),
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
ON UPDATE CASCADE ON DELETE CASCADE
@ -3253,6 +3256,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`ipam_ip_not_assigned_to_agent` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`macros_definition` TEXT,
`render_definition` TEXT,
`use_prefix_notation` TINYINT UNSIGNED NOT NULL DEFAULT 1,
PRIMARY KEY(`id_rc`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@ -3411,37 +3415,8 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- ---------------------------------------------------------------------
-- Table `ttransaction`
-- Table `treset_pass`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `ttransaction` (
`transaction_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`agent_id` INT UNSIGNED NOT NULL,
`group_id` INT UNSIGNED NOT NULL DEFAULT 0,
`description` TEXT,
`name` VARCHAR(250) NOT NULL,
`loop_interval` INT UNSIGNED NOT NULL DEFAULT 40,
`ready` INT UNSIGNED NOT NULL DEFAULT 0,
`running` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`transaction_id`)
) engine=InnoDB DEFAULT CHARSET=UTF8MB4;
-- ---------------------------------------------------------------------
-- Table `tphase`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tphase`(
`phase_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`transaction_id` INT UNSIGNED NOT NULL,
`agent_id` INT UNSIGNED NOT NULL,
`name` VARCHAR(250) NOT NULL,
`idx` INT UNSIGNED NOT NULL,
`dependencies` TEXT,
`enables` TEXT,
`launch` TEXT,
`retries` INT UNSIGNED DEFAULT null,
`timeout` INT UNSIGNED DEFAULT null,
PRIMARY KEY (`phase_id`,`transaction_id`)
) engine=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `treset_pass` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(255) NOT NULL DEFAULT '',

View File

@ -303,6 +303,10 @@ sub parse_config {
if ($parametro =~ m/^check\_name\s(.*)/i) {
$checks[$plugin_setup{"numchecks"}]{'check_name'} = trim($1);
}
if ($parametro =~ m/^check\_type\s(.*)/i) {
$checks[$plugin_setup{"numchecks"}]{'check_type'} = trim($1);
}
if ($parametro =~ m/^check\_schema\s(.*)/i) {
$checks[$plugin_setup{"numchecks"}]{'check_schema'} = trim($1);
@ -1015,6 +1019,7 @@ foreach (@checks) {
my $check_show = $_->{'show'};
my $return_type = $_->{'return_type'};
my $check_name = $_->{'check_name'};
my $check_type = $_->{'check_type'};
$result_check = 0;
# Process check (System parameters)
@ -1156,7 +1161,7 @@ foreach (@checks) {
print_module("MySQL_" . $type . '_' . $check_show, $module_type, $result_check, '', $check_status);
} else {
if (defined($check_name)) {
print_module("MySQL_" . $type . "_" . $check_name, $module_type, $result_check, '', $check_status);
print_module("MySQL_" . $type . "_" . $check_name, $check_type, $result_check, '', $check_status);
} else {
print_module("MySQL_" . $type, $module_type, $result_check, '', $check_status);
}
@ -1186,3 +1191,4 @@ foreach (@checks) {
} # type ne 'unknown'
}

View File

@ -142,26 +142,26 @@ function main_intel_dcm_agent_view()
$sql = "SELECT description FROM tagent_custom_data WHERE id_field = $id_field_derated_power AND id_agent = $id_agent";
$derated_power = db_get_value_sql($sql);
$percent = number_format((($avg_power / $derated_power) * 100), 2);
$percent = number_format((($avg_power / $derated_power) * 100), 2, $config['decimal_separator'], $config['thousand_separator']);
$data[0] = '<b>'.__('Power utilization')." $percent%</b>";
$data[0] .= progress_bar($percent, 400, 30, '', 2);
$data[0] .= '<br><br>';
$data[0] .= '<b>'.__('Current stats').'</b>';
$data[0] .= '<br><br>';
$data[0] .= __('Power demand').': <b>'.number_format($avg_power, 2).' Wh</b>';
$data[0] .= __('Power demand').': <b>'.number_format($avg_power, 2, $config['decimal_separator'], $config['thousand_separator']).' Wh</b>';
$data[0] .= '<br>';
$data[0] .= __('Inlet temp').': <b>'.number_format($avg_temp, 2).' ºC</b>';
$data[0] .= __('Inlet temp').': <b>'.number_format($avg_temp, 2, $config['decimal_separator'], $config['thousand_separator']).' ºC</b>';
$data[0] .= '<br><br><br>';
$data[0] .= '<b>'.__('Last week summary').'</b>';
$data[0] .= '<br><br>';
$data[0] .= __('Equipment energy consumed').': <b>'.number_format($mnged_energy, 2).' Wh</b>';
$data[0] .= __('Equipment energy consumed').': <b>'.number_format($mnged_energy, 2, $config['decimal_separator'], $config['thousand_separator']).' Wh</b>';
$data[0] .= '<br>';
$data[0] .= __('Equipment energy bill').': <b>'.number_format($mnged_energy_bill, 2).' €</b>';
$data[0] .= __('Equipment energy bill').': <b>'.number_format($mnged_energy_bill, 2, $config['decimal_separator'], $config['thousand_separator']).' €</b>';
$data[0] .= '<br>';
$data[0] .= __('Calculated cooling energy').': <b>'.number_format($cooling_energy, 2).' Wh</b>';
$data[0] .= __('Calculated cooling energy').': <b>'.number_format($cooling_energy, 2, $config['decimal_separator'], $config['thousand_separator']).' Wh</b>';
$data[0] .= '<br>';
$data[0] .= __('Calculated cooling energy bill').': <b>'.number_format($cooling_energy_bill, 2).' €</b>';
$data[0] .= __('Calculated cooling energy bill').': <b>'.number_format($cooling_energy_bill, 2, $config['decimal_separator'], $config['thousand_separator']).' €</b>';
// Print avg. power graph
$start_date = date('Y-m-d');

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.767-221213
Version: 7.0NG.767-221219
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.767-221213"
pandora_version="7.0NG.767-221219"
package_cpan=0
package_pandora=1

View File

@ -429,14 +429,6 @@ snmpserver 1
snmp_threads 4
# Pandora FMS TransactionalServer (PANDORA FMS ENTERPRISE ONLY).
transactionalserver 0
# Threshold for the Transactional Server (PANDORA FMS ENTERPRISE ONLY).
transactional_threshold 2
# Block size for block producer/consumer servers, that is, the number of modules
# per block (20 by default) (PANDORA FMS ENTERPRISE ONLY).

View File

@ -533,14 +533,6 @@ snmpserver 1
snmp_threads 4
# Pandora FMS TransactionalServer (PANDORA FMS ENTERPRISE ONLY).
transactionalserver 0
# Threshold for the Transactional Server (PANDORA FMS ENTERPRISE ONLY).
transactional_threshold 2
# Block size for block producer/consumer servers, that is, the number of modules
# per block (15 by default) (PANDORA FMS ENTERPRISE ONLY).

View File

@ -430,14 +430,6 @@ snmpserver 1
snmp_threads 4
# Pandora FMS TransactionalServer (PANDORA FMS ENTERPRISE ONLY).
transactionalserver 0
# Threshold for the Transactional Server (PANDORA FMS ENTERPRISE ONLY).
transactional_threshold 2
# Block size for block producer/consumer servers, that is, the number of modules
# per block (15 by default) (PANDORA FMS ENTERPRISE ONLY).

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.767";
my $pandora_build = "221213";
my $pandora_build = "221219";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
@ -256,8 +256,6 @@ sub pandora_load_config {
$pa_config->{"inventoryserver"} = 1; # default
$pa_config->{"webserver"} = 1; # 3.0
$pa_config->{"web_timeout"} = 60; # 6.0SP5
$pa_config->{"transactionalserver"} = 0; # Default 0, introduced on 6.1
$pa_config->{"transactional_threshold"} = 2; # Default 2, introduced on 6.1
$pa_config->{"transactional_pool"} = $pa_config->{"incomingdir"} . "/" . "trans"; # Default, introduced on 6.1
$pa_config->{'snmp_logfile'} = "/var/log/pandora_snmptrap.log";
$pa_config->{"network_threads"} = 3; # Fixed default
@ -776,12 +774,6 @@ sub pandora_load_config {
elsif ($parametro =~ m/^web_timeout\s+([0-9]*)/i) {
$pa_config->{'web_timeout'}= clean_blank($1);
}
elsif ($parametro =~ m/^transactionalserver\s+([0-9]*)/i) {
$pa_config->{'transactionalserver'}= clean_blank($1);
}
elsif ($parametro =~ m/^transactional_threshold\s+([0-9]*\.{0,1}[0-9]*)/i) {
$pa_config->{'transactional_threshold'}= clean_blank($1);
}
if ($parametro =~ m/^transactional_pool\s(.*)/i) {
$tbuf= clean_blank($1);
if ($tbuf =~ m/^\.(.*)/){

View File

@ -299,7 +299,6 @@ our @ServerTypes = qw (
icmpserver
snmpserver
satelliteserver
transactionalserver
mfserver
syncserver
wuxserver

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.767";
my $pandora_build = "221213";
my $pandora_build = "221219";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -72,7 +72,6 @@ our @EXPORT = qw(
SNMPSERVER
SATELLITESERVER
MFSERVER
TRANSACTIONALSERVER
SYNCSERVER
SYSLOGSERVER
WUXSERVER
@ -2837,7 +2836,6 @@ sub get_server_name {
return "ICMPSERVER" if ($server_type eq ICMPSERVER);
return "SNMPSERVER" if ($server_type eq SNMPSERVER);
return "SATELLITESERVER" if ($server_type eq SATELLITESERVER);
return "TRANSACTIONALSERVER" if ($server_type eq TRANSACTIONALSERVER);
return "MFSERVER" if ($server_type eq MFSERVER);
return "SYNCSERVER" if ($server_type eq SYNCSERVER);
return "WUXSERVER" if ($server_type eq WUXSERVER);

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.767
%define release 221213
%define release 221219
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.767
%define release 221213
%define release 221219
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.767 Build 221213";
my $version = "7.0NG.767 Build 221219";
# Pandora server configuration
my %conf;

View File

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

View File

@ -2,7 +2,7 @@
#
################################################################################
#
# Bandwith usage plugin
# Bandwidth usage plugin
#
# Requirements:
# snmpget
@ -55,7 +55,7 @@ Where OPTIONS could be:
[EXTRA]
-ifIndex Target interface to retrieve, if not specified, total
bandwith will be reported.
bandwidth will be reported.
-uniqid Use custom temporary file name.
-inUsage Show only input usage (in percentage) - 1, or not 0.
-outUsage Show only output usage (in percentage) - 1, or not 0.
@ -66,7 +66,7 @@ e.g. -v is equal to -version, -c to -community, etc.
EO_HELP
use constant {
UNKNOWN_DUPLEX => 0,
UNKNOWN_DUPLEX => 1,
HALF_DUPLEX => 2,
FULL_DUPLEX => 3,
};
@ -133,9 +133,9 @@ sub update_config_key ($) {
if ($arg eq 'inUsage') {
return "inUsage";
}
if ($arg eq 'outUsage') {
return "outUsage";
}
if ($arg eq 'outUsage') {
return "outUsage";
}
}
################################################################################
@ -188,7 +188,7 @@ sub prepare_tree {
my $inOctets = snmp_get(\%inOctets_call);
if (ref($inOctets) eq "HASH") {
if ($inOctets->{'data'} eq '') {
if (! exists($inOctets->{'data'}) || $inOctets->{'data'} eq '') {
$inOctets = 0;
} else {
$inOctets = int $inOctets->{'data'};
@ -198,18 +198,18 @@ sub prepare_tree {
next;
}
my %outOctets_call = %{$config};
if (is_enabled($config->{'use_x64'})) {
$outOctets_call{'oid'} = $config->{'oid_base'};
$outOctets_call{'oid'} .= $config->{'x64_indexes'}{'outOctets'}.$ifIndex;
} else {
$outOctets_call{'oid'} = $config->{'oid_base'};
$outOctets_call{'oid'} .= $config->{'x86_indexes'}{'outOctets'}.$ifIndex;
}
my %outOctets_call = %{$config};
if (is_enabled($config->{'use_x64'})) {
$outOctets_call{'oid'} = $config->{'oid_base'};
$outOctets_call{'oid'} .= $config->{'x64_indexes'}{'outOctets'}.$ifIndex;
} else {
$outOctets_call{'oid'} = $config->{'oid_base'};
$outOctets_call{'oid'} .= $config->{'x86_indexes'}{'outOctets'}.$ifIndex;
}
my $outOctets = snmp_get(\%outOctets_call);
if (ref($outOctets) eq "HASH") {
if ($outOctets->{'data'} eq '') {
if (! exists($outOctets->{'data'}) || $outOctets->{'data'} eq '') {
$outOctets = 0;
} else {
$outOctets = int $outOctets->{'data'};
@ -220,28 +220,27 @@ sub prepare_tree {
}
my %duplex_call = %{$config};
if (is_enabled($config->{'use_x64'})) {
$duplex_call{'oid'} = $config->{'oid_base'};
$duplex_call{'oid'} .= $config->{'x64_indexes'}{'duplex'}.$ifIndex;
} else {
$duplex_call{'oid'} = $config->{'oid_base'};
$duplex_call{'oid'} .= $config->{'x86_indexes'}{'duplex'}.$ifIndex;
}
if (is_enabled($config->{'use_x64'})) {
$duplex_call{'oid'} = $config->{'oid_base'};
$duplex_call{'oid'} .= $config->{'x64_indexes'}{'duplex'}.$ifIndex;
} else {
$duplex_call{'oid'} = $config->{'oid_base'};
$duplex_call{'oid'} .= $config->{'x86_indexes'}{'duplex'}.$ifIndex;
}
my $duplex = snmp_get(\%duplex_call);
if (ref($duplex) eq "HASH") {
if ($duplex->{'data'} eq '') {
if (! exists($duplex->{'data'}) || $duplex->{'data'} eq '') {
$duplex = 0;
} else {
$duplex = int $duplex->{'data'};
}
} else {
# Ignore, cannot retrieve inOctets.
next;
}
my %speed = %{$config};
my %speed = %{$config};
if (is_enabled($config->{'use_x64'})) {
$speed{'oid'} = $config->{'oid_base'};
$speed{'oid'} .= $config->{'x64_indexes'}{'ifSpeed'}.$ifIndex;
@ -492,9 +491,9 @@ $config->{'tmp_separator'} = ';' if empty($config->{'tmp_separator'});
$config->{'tmp'} = (($^O =~ /win/)?$ENV{'TMP'}:'/tmp') if empty($config->{'tmp'});
# Create unique name for tmp and log file for host
my $filename = $config->{'tmp'}.'/pandora_bandwith_'.$config->{'host'};
my $filename = $config->{'tmp'}.'/pandora_bandwidth_'.$config->{'host'};
if (!empty($config->{'uniqid'})) {
$filename = $config->{'tmp'}.'/pandora_bandwith_'.$config->{'uniqid'};
$filename = $config->{'tmp'}.'/pandora_bandwidth_'.$config->{'uniqid'};
}
# Replace every dot for underscore
$filename =~ tr/./_/;
@ -511,7 +510,7 @@ if ( defined($sysobjectid->{'error'}) || $sysobjectid->{'data'} eq '' ) {
# Check SNMP x64 interfaces
my $walk64 = snmp_walk({%{$config}, 'oid' => '.1.3.6.1.2.1.31.1.1.1.6'});
if ( $walk64 =~ 'No Such Instance currently exists at this OID' || $walk64 =~ 'No more variables left in this MIB View') {
if ( $walk64 !~ /.*\.[0-9]+ = Counter64: [0-9]+/ ) {
$config->{'use_x64'} = 0;
} else {
$config->{'use_x64'} = 1;
@ -556,35 +555,35 @@ my $j = 0;
my $k = 0;
foreach my $iface (keys %{$analysis_tree}) {
# Calculate summary;
if (is_enabled($analysis_tree->{$iface}{'bandwidth'})) {
$bandwidth = $analysis_tree->{$iface}{'bandwidth'};
if (is_enabled($analysis_tree->{$iface}{'bandwidth'}) || $analysis_tree->{$iface}{'bandwidth'} == 0) {
$bandwidth += $analysis_tree->{$iface}{'bandwidth'};
$i++;
}
if (is_enabled($analysis_tree->{$iface}{'inUsage'})) {
$inUsage = $analysis_tree->{$iface}{'inUsage'};
if (is_enabled($analysis_tree->{$iface}{'inUsage'}) || $analysis_tree->{$iface}{'inUsage'} == 0) {
$inUsage += $analysis_tree->{$iface}{'inUsage'};
$j++;
}
if (is_enabled($analysis_tree->{$iface}{'outUsage'})) {
$outUsage = $analysis_tree->{$iface}{'outUsage'};
if (is_enabled($analysis_tree->{$iface}{'outUsage'}) || $analysis_tree->{$iface}{'inUsage'} == 0) {
$outUsage += $analysis_tree->{$iface}{'outUsage'};
$k++;
}
}
if ($j > 0 && is_enabled($config->{'inUsage'})) {
$inUsage /= $j;
print sprintf("%.9f\n", $inUsage);
$inUsage /= $j;
print sprintf("%.9f\n", $inUsage);
} elsif ($k > 0 && is_enabled($config->{'outUsage'})) {
$outUsage /= $k;
print sprintf("%.9f\n", $outUsage);
$outUsage /= $k;
print sprintf("%.9f\n", $outUsage);
}
if ($i > 0
&& !is_enabled($config->{'inUsage'})
&& !is_enabled($config->{'outUsage'})
) {
$bandwidth /= $i;
print sprintf("%.9f\n", $bandwidth);
$bandwidth /= $i;
print sprintf("%.9f\n", $bandwidth);
}
logger($config, 'info', "Plugin ends") if (is_enabled($config->{'debug'}));