Merge remote-tracking branch 'origin/develop' into ent-7449-autorefresh-en-vistas-que-no-existen

This commit is contained in:
Calvo 2021-09-22 11:39:44 +02:00
commit 641c42df91
49 changed files with 249 additions and 115 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.757-210916 Version: 7.0NG.757-210922
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.757'; use constant AGENT_VERSION => '7.0NG.757';
use constant AGENT_BUILD => '210916'; use constant AGENT_BUILD => '210922';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.757" PI_VERSION="7.0NG.757"
PI_BUILD="210916" PI_BUILD="210922"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{210916} {210922}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.757-210916 Version: 7.0NG.757-210922
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -0,0 +1,6 @@
START TRANSACTION;
ALTER TABLE `tevent_filter` ADD COLUMN `time_from` TIME NULL;
ALTER TABLE `tevent_filter` ADD COLUMN `time_to` TIME NULL;
COMMIT;

View File

@ -991,7 +991,7 @@ $email = '<div class="label_select_simple">'.html_print_input_text_extended(
$view_mode, $view_mode,
'', '',
[ [
'class' => 'input input_line email_icon_input invert_filter', 'class' => 'input input_line email_icon_input',
'placeholder' => __('E-mail'), 'placeholder' => __('E-mail'),
], ],
true true

View File

@ -252,7 +252,9 @@ if ($save_event_filter) {
$values['filter_only_alert'] = get_parameter('filter_only_alert'); $values['filter_only_alert'] = get_parameter('filter_only_alert');
$values['id_group_filter'] = get_parameter('id_group_filter'); $values['id_group_filter'] = get_parameter('id_group_filter');
$values['date_from'] = get_parameter('date_from'); $values['date_from'] = get_parameter('date_from');
$values['time_from'] = get_parameter('time_from');
$values['date_to'] = get_parameter('date_to'); $values['date_to'] = get_parameter('date_to');
$values['time_to'] = get_parameter('time_to');
$values['source'] = get_parameter('source'); $values['source'] = get_parameter('source');
$values['id_extra'] = get_parameter('id_extra'); $values['id_extra'] = get_parameter('id_extra');
$values['user_comment'] = get_parameter('user_comment'); $values['user_comment'] = get_parameter('user_comment');
@ -304,13 +306,15 @@ if ($update_event_filter) {
$values['filter_only_alert'] = get_parameter('filter_only_alert'); $values['filter_only_alert'] = get_parameter('filter_only_alert');
$values['id_group_filter'] = get_parameter('id_group_filter'); $values['id_group_filter'] = get_parameter('id_group_filter');
$values['date_from'] = get_parameter('date_from'); $values['date_from'] = get_parameter('date_from');
$values['time_from'] = get_parameter('time_from');
$values['date_to'] = get_parameter('date_to'); $values['date_to'] = get_parameter('date_to');
$values['time_to'] = get_parameter('time_to');
$values['source'] = get_parameter('source'); $values['source'] = get_parameter('source');
$values['id_extra'] = get_parameter('id_extra'); $values['id_extra'] = get_parameter('id_extra');
$values['user_comment'] = get_parameter('user_comment'); $values['user_comment'] = get_parameter('user_comment');
$values['id_source_event'] = get_parameter('id_source_event'); $values['id_source_event'] = get_parameter('id_source_event');
if (is_metaconsole()) { if (is_metaconsole() === true) {
$values['server_id'] = get_parameter('server_id'); $values['server_id'] = get_parameter('server_id');
} }
@ -355,7 +359,9 @@ if ($get_filter_values) {
'id_extra' => '', 'id_extra' => '',
'id_user_ack' => '', 'id_user_ack' => '',
'date_from' => '', 'date_from' => '',
'time_from' => '',
'date_to' => '', 'date_to' => '',
'time_to' => '',
'severity' => '', 'severity' => '',
'event_type' => '', 'event_type' => '',
'group_rep' => 0, 'group_rep' => 0,
@ -380,7 +386,7 @@ if ($get_filter_values) {
} }
} }
if (is_metaconsole()) { if (is_metaconsole() === true) {
$server_name = db_get_value('server_name', 'tmetaconsole_setup', 'id', $event_filter['server_id']); $server_name = db_get_value('server_name', 'tmetaconsole_setup', 'id', $event_filter['server_id']);
if ($server_name !== false) { if ($server_name !== false) {
$event_filter['server_name'] = $server_name; $event_filter['server_name'] = $server_name;
@ -543,8 +549,12 @@ function load_form_filter() {
$("#select2-server_id-container").text(val); $("#select2-server_id-container").text(val);
if(i == 'date_from') if(i == 'date_from')
$("#text-date_from").val(val); $("#text-date_from").val(val);
if(i == 'time_from')
$("#text-time_from").val(val);
if(i == 'date_to') if(i == 'date_to')
$("#text-date_to").val(val); $("#text-date_to").val(val);
if(i == 'time_to')
$("#text-time_to").val(val);
if(i == 'module_search') if(i == 'module_search')
$('input[name=module_search]').val(val); $('input[name=module_search]').val(val);
if(i == 'group_name') if(i == 'group_name')
@ -767,7 +777,9 @@ function save_new_filter() {
"filter_only_alert" : $("#filter_only_alert").val(), "filter_only_alert" : $("#filter_only_alert").val(),
"id_group_filter": $("#id_group_filter").val(), "id_group_filter": $("#id_group_filter").val(),
"date_from": $("#text-date_from").val(), "date_from": $("#text-date_from").val(),
"time_from": $("#text-time_from").val(),
"date_to": $("#text-date_to").val(), "date_to": $("#text-date_to").val(),
"time_to": $("#text-time_to").val(),
"source": $("#text-source").val(), "source": $("#text-source").val(),
"id_extra": $("#text-id_extra").val(), "id_extra": $("#text-id_extra").val(),
"user_comment": $("#text-user_comment").val(), "user_comment": $("#text-user_comment").val(),
@ -838,7 +850,9 @@ function save_update_filter() {
"filter_only_alert" : $("#filter_only_alert").val(), "filter_only_alert" : $("#filter_only_alert").val(),
"id_group_filter": $("#id_group_filter").val(), "id_group_filter": $("#id_group_filter").val(),
"date_from": $("#text-date_from").val(), "date_from": $("#text-date_from").val(),
"time_from": $("#text-time_from").val(),
"date_to": $("#text-date_to").val(), "date_to": $("#text-date_to").val(),
"time_to": $("#text-time_to").val(),
"source": $("#text-source").val(), "source": $("#text-source").val(),
"id_extra": $("#text-id_extra").val(), "id_extra": $("#text-id_extra").val(),
"user_comment": $("#text-user_comment").val(), "user_comment": $("#text-user_comment").val(),
@ -1783,9 +1797,11 @@ if ($get_list_events_agents) {
$tag_without = get_parameter('tag_without'); $tag_without = get_parameter('tag_without');
$filter_only_alert = get_parameter('filter_only_alert'); $filter_only_alert = get_parameter('filter_only_alert');
$date_from = get_parameter('date_from'); $date_from = get_parameter('date_from');
$time_from = get_parameter('time_from', '00:00:00');
$date_to = get_parameter('date_to'); $date_to = get_parameter('date_to');
$time_to = get_parameter('time_to', '23:59:59');
$id_user = $config['id_user']; $id_user = $config['id_user'];
hd('hollllaa', true);
$returned_sql = events_sql_events_grouped_agents( $returned_sql = events_sql_events_grouped_agents(
$id_agent, $id_agent,
$server_id, $server_id,
@ -1800,7 +1816,9 @@ if ($get_list_events_agents) {
$tag_without, $tag_without,
$filter_only_alert, $filter_only_alert,
$date_from, $date_from,
$time_from,
$date_to, $date_to,
$time_to,
$id_user $id_user
); );

View File

@ -837,9 +837,12 @@ class ModuleTemplates extends HTML
$penInfo = db_get_all_rows_filter('tnetwork_profile_pen', ['id_np' => $this->id_np]); $penInfo = db_get_all_rows_filter('tnetwork_profile_pen', ['id_np' => $this->id_np]);
$penList = []; $penList = [];
// Handle if list of PEN does not exist or is empty.
if ($penInfo !== false) {
foreach ($penInfo as $pen) { foreach ($penInfo as $pen) {
$penList[] = $pen['pen']; $penList[] = $pen['pen'];
} }
}
$this->pen = implode(',', $penList); $this->pen = implode(',', $penList);
} }

View File

@ -40,7 +40,8 @@ class TreeTag extends Tree
$this->L1orderByFinal = 'tt.name'; $this->L1orderByFinal = 'tt.name';
$this->L2condition = 'AND ttm.id_tag = '.$this->rootID; $this->L2condition = 'AND ttm.id_tag = '.$this->rootID;
$this->L2inner = $this->L1innerInside; $this->L2inner = 'INNER JOIN ttag_module ttm
ON ttm.id_agente_modulo = tam.id_agente_modulo';
$this->L3forceTagCondition = true; $this->L3forceTagCondition = true;
} }

View File

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

View File

@ -3299,8 +3299,10 @@ function extract_column($array, $column)
function get_percentile($percentile, $array) function get_percentile($percentile, $array)
{ {
global $config;
sort($array); sort($array);
$index = (($percentile / 100) * count($array)); $index = (($config['percentil'] / 100) * count($array));
if (floor($index) == $index) { if (floor($index) == $index) {
$result = (($array[($index - 1)] + $array[$index]) / 2); $result = (($array[($index - 1)] + $array[$index]) / 2);

View File

@ -5777,10 +5777,6 @@ function api_set_create_alert_template($name, $thrash1, $other, $thrash3)
{ {
global $config; global $config;
if (is_metaconsole() === true) {
return;
}
$headers = getallheaders(); $headers = getallheaders();
if (isset($headers['idk']) === false if (isset($headers['idk']) === false
&& is_management_allowed($headers['idk']) === false && is_management_allowed($headers['idk']) === false
@ -16733,9 +16729,15 @@ function api_get_group_id_by_name($thrash1, $thrash2, $other, $thrash3)
return; return;
} }
if (is_array($other['data']) === true) {
$group_id = $other['data'][0];
} else {
$group_id = $other['data'];
}
$sql = sprintf( $sql = sprintf(
'SELECT id_grupo 'SELECT id_grupo
FROM tgrupo WHERE nombre = "'.$other['data'].'"' FROM tgrupo WHERE nombre = "'.$group_id.'"'
); );
$group_id = db_get_all_rows_sql($sql); $group_id = db_get_all_rows_sql($sql);

View File

@ -762,7 +762,7 @@ function events_get_all(
} }
if (isset($filter['time_from'])) { if (isset($filter['time_from'])) {
$time_from = $filter['time_from']; $time_from = (empty($filter['time_from']) === true) ? '00:00:00' : $filter['time_from'];
} }
if (isset($date_from)) { if (isset($date_from)) {
@ -785,7 +785,7 @@ function events_get_all(
} }
if (isset($filter['time_to'])) { if (isset($filter['time_to'])) {
$time_to = $filter['time_to']; $time_to = (empty($filter['time_to']) === true) ? '23:59:59' : $filter['time_to'];
} }
if (isset($date_to)) { if (isset($date_to)) {
@ -6193,7 +6193,9 @@ function events_get_events_grouped_by_agent(
* @param array $tag_without Tag_without. * @param array $tag_without Tag_without.
* @param boolean $filter_only_alert Filter_only_alert. * @param boolean $filter_only_alert Filter_only_alert.
* @param string $date_from Date_from. * @param string $date_from Date_from.
* @param string $time_from Time_from.
* @param string $date_to Date_to. * @param string $date_to Date_to.
* @param string $time_to Time_to.
* @param boolean $id_user Id_user. * @param boolean $id_user Id_user.
* @param boolean $server_id_search Server_id_search. * @param boolean $server_id_search Server_id_search.
* *
@ -6213,7 +6215,9 @@ function events_sql_events_grouped_agents(
$tag_without=[], $tag_without=[],
$filter_only_alert=false, $filter_only_alert=false,
$date_from='', $date_from='',
$time_from='',
$date_to='', $date_to='',
$time_to='',
$id_user=false, $id_user=false,
$server_id_search=false $server_id_search=false
) { ) {
@ -6320,27 +6324,35 @@ function events_sql_events_grouped_agents(
$sql_post .= " AND id_usuario = '".$id_user_ack."'"; $sql_post .= " AND id_usuario = '".$id_user_ack."'";
} }
if (!isset($date_from)) { if (isset($date_from) === false) {
$date_from = ''; $date_from = '';
} }
if (!isset($date_to)) { if (isset($time_from) === false) {
$time_from = '00:00:00';
}
if (isset($date_to) === false) {
$date_to = ''; $date_to = '';
} }
if (isset($time_to) === false || empty($time_to) === true) {
$time_to = '23:59:59';
}
if (($date_from == '') && ($date_to == '')) { if (($date_from == '') && ($date_to == '')) {
if ($event_view_hr > 0) { if ($event_view_hr > 0) {
$unixtime = (get_system_time() - ($event_view_hr * SECONDS_1HOUR)); $unixtime = (get_system_time() - ($event_view_hr * SECONDS_1HOUR));
$sql_post .= ' AND (utimestamp > '.$unixtime.')'; $sql_post .= ' AND (utimestamp > '.$unixtime.')';
} }
} else { } else {
if ($date_from != '') { if (empty($date_from) === false) {
$udate_from = strtotime($date_from.' 00:00:00'); $udate_from = strtotime($date_from.' '.$time_from);
$sql_post .= ' AND (utimestamp >= '.$udate_from.')'; $sql_post .= ' AND (utimestamp >= '.$udate_from.')';
} }
if ($date_to != '') { if (empty($date_to) === false) {
$udate_to = strtotime($date_to.' 23:59:59'); $udate_to = strtotime($date_to.' '.$time_to);
$sql_post .= ' AND (utimestamp <= '.$udate_to.')'; $sql_post .= ' AND (utimestamp <= '.$udate_to.')';
} }
} }

View File

@ -1935,7 +1935,7 @@ function html_print_extended_select_for_time(
ob_start(); ob_start();
// Use the no_meta parameter because this image is only in the base console. // Use the no_meta parameter because this image is only in the base console.
echo '<div id="'.$uniq_name.'_default" class="wauto inline_line">'; echo '<div id="'.$uniq_name.'_default" class="wauto inline_flex">';
html_print_select( html_print_select(
$fields, $fields,
$uniq_name.'_select', $uniq_name.'_select',
@ -4814,7 +4814,11 @@ function html_print_input($data, $wrapper='div', $input_only=false)
((isset($data['size']) === true) ? $data['size'] : false), ((isset($data['size']) === true) ? $data['size'] : false),
((isset($data['return']) === true) ? $data['return'] : false), ((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['style']) === true) ? $data['selected'] : false), ((isset($data['style']) === true) ? $data['selected'] : false),
((isset($data['unique']) === true) ? $data['unique'] : false) ((isset($data['unique']) === true) ? $data['unique'] : false),
((isset($data['class']) === true) ? $data['class'] : ''),
((isset($data['readonly']) === true) ? $data['readonly'] : false),
((isset($data['custom_fields']) === true) ? $data['custom_fields'] : false),
((isset($data['style_icon']) === true) ? $data['style_icon'] : '')
); );
break; break;

View File

@ -5738,7 +5738,7 @@ function ui_print_agent_autocomplete_input($parameters)
} }
$attrs = []; $attrs = [];
$attrs['style'] = 'background: url('.$icon_image.') no-repeat right; '.$text_color.''; $attrs['style'] = 'padding-right: 20px; background: url('.$icon_image.') no-repeat right; '.$text_color.'';
if (!$disabled_javascript_on_blur_function) { if (!$disabled_javascript_on_blur_function) {
$attrs['onblur'] = $javascript_on_blur_function_name.'()'; $attrs['onblur'] = $javascript_on_blur_function_name.'()';

View File

@ -354,6 +354,7 @@ class CustomGraphWidget extends Widget
'value' => $values['period'], 'value' => $values['period'],
'nothing' => __('None'), 'nothing' => __('None'),
'nothing_value' => 0, 'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
], ],
]; ];

View File

@ -325,6 +325,8 @@ class GraphModuleHistogramWidget extends Widget
'value' => $values['period'], 'value' => $values['period'],
'nothing' => __('None'), 'nothing' => __('None'),
'nothing_value' => 0, 'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
], ],
]; ];

View File

@ -310,6 +310,7 @@ class SingleGraphWidget extends Widget
'value' => $values['period'], 'value' => $values['period'],
'nothing' => __('None'), 'nothing' => __('None'),
'nothing_value' => 0, 'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
], ],
]; ];

View File

@ -335,6 +335,7 @@ class SLAPercentWidget extends Widget
'value' => $values['period'], 'value' => $values['period'],
'nothing' => __('None'), 'nothing' => __('None'),
'nothing_value' => 0, 'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
], ],
]; ];

View File

@ -240,6 +240,7 @@ class TopNWidget extends Widget
'value' => $values['period'], 'value' => $values['period'],
'nothing' => __('None'), 'nothing' => __('None'),
'nothing_value' => 0, 'nothing_value' => 0,
'style_icon' => 'flex-grow: 0',
], ],
]; ];

View File

@ -379,6 +379,11 @@ final class Percentile extends Item
$moduleValue = \modules_get_last_value($moduleId); $moduleValue = \modules_get_last_value($moduleId);
if ($moduleValue === false) { if ($moduleValue === false) {
// Restore connection.
if ($nodeConnected === true) {
\metaconsole_restore_db();
}
throw new \InvalidArgumentException( throw new \InvalidArgumentException(
'error fetching the module value' 'error fetching the module value'
); );

View File

@ -22,6 +22,7 @@
-moz-border-radius: 4px; -moz-border-radius: 4px;
-webkit-border-radius: 4px; -webkit-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
font-family: monospace;
} }
.query_result_view_container { .query_result_view_container {

View File

@ -166,7 +166,6 @@ div.target.flex {
text-align: center; text-align: center;
} }
div#rules::after { div#rules::after {
content: "Drop Here";
position: relative; position: relative;
display: block; display: block;
margin: 2em auto; margin: 2em auto;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

View File

@ -765,7 +765,7 @@ if (is_ajax()) {
$result = []; $result = [];
foreach ($last_modules_set as $module_name => $module_data) { foreach ($last_modules_set as $module_name => $module_data) {
$value = ui_print_truncate_text(io_safe_output($module_name), 'module_medium', false, true); $value = ui_print_truncate_text(io_safe_output($module_name), 'module_medium', false, true, false, '...');
$module_data_processed = array_map( $module_data_processed = array_map(
function ($item) { function ($item) {
@ -863,10 +863,12 @@ if (is_ajax()) {
io_safe_output($nameModule['nombre']), io_safe_output($nameModule['nombre']),
'module_medium', 'module_medium',
false, false,
true true,
false,
'...'
); );
} else { } else {
$result[io_safe_output($nameModule['nombre']).'$*$'.implode('|', $idAgents)] = ui_print_truncate_text(io_safe_output($nameModule['nombre']), 'module_medium', false, true); $result[io_safe_output($nameModule['nombre']).'$*$'.implode('|', $idAgents)] = ui_print_truncate_text(io_safe_output($nameModule['nombre']), 'module_medium', false, true, false, '...');
} }
} }
} }

View File

@ -71,7 +71,7 @@ $access = ($event_a == true) ? 'ER' : (($event_w == true) ? 'EW' : (($event_m ==
$readonly = false; $readonly = false;
if (!is_metaconsole() if (is_metaconsole() === false
&& isset($config['event_replication']) && isset($config['event_replication'])
&& $config['event_replication'] == 1 && $config['event_replication'] == 1
&& $config['show_events_in_local'] == 1 && $config['show_events_in_local'] == 1
@ -82,7 +82,7 @@ if (!is_metaconsole()
// Load specific stylesheet. // Load specific stylesheet.
ui_require_css_file('events'); ui_require_css_file('events');
ui_require_css_file('tables'); ui_require_css_file('tables');
if (is_metaconsole()) { if (is_metaconsole() === true) {
ui_require_css_file('tables_meta', ENTERPRISE_DIR.'/include/styles/'); ui_require_css_file('tables_meta', ENTERPRISE_DIR.'/include/styles/');
} }
@ -216,7 +216,7 @@ $section = get_parameter('section', false);
$id_source_event = get_parameter( $id_source_event = get_parameter(
'filter[id_source_event]', 'filter[id_source_event]',
$filter['id_source_event'] ($filter['id_source_event'] ?? '')
); );
$server_id = get_parameter( $server_id = get_parameter(
@ -224,7 +224,7 @@ $server_id = get_parameter(
$filter['id_server_meta'] $filter['id_server_meta']
); );
if (is_metaconsole()) { if (is_metaconsole() === true) {
// Connect to node database. // Connect to node database.
$id_node = $server_id; $id_node = $server_id;
if ($id_node != 0) { if ($id_node != 0) {
@ -235,16 +235,16 @@ if (is_metaconsole()) {
} }
if (empty($text_agent) && !empty($id_agent)) { if (empty($text_agent) && empty($id_agent) === false) {
$text_agent = agents_get_alias($id_agent); $text_agent = agents_get_alias($id_agent);
} }
if (empty($text_module) && !empty($id_agent_module)) { if (empty($text_module) && empty($id_agent_module) === false) {
$text_module = modules_get_agentmodule_name($id_agent_module); $text_module = modules_get_agentmodule_name($id_agent_module);
$text_agent = agents_get_alias(modules_get_agentmodule_agent($id_agent_module)); $text_agent = agents_get_alias(modules_get_agentmodule_agent($id_agent_module));
} }
if (is_metaconsole()) { if (is_metaconsole() === true) {
// Return to metaconsole database. // Return to metaconsole database.
if ($id_node != 0) { if ($id_node != 0) {
metaconsole_restore_db(); metaconsole_restore_db();
@ -252,7 +252,7 @@ if (is_metaconsole()) {
} }
// Ajax responses. // Ajax responses.
if (is_ajax()) { if (is_ajax() === true) {
$get_events = get_parameter('get_events', 0); $get_events = get_parameter('get_events', 0);
// Datatables offset, limit. // Datatables offset, limit.
$start = get_parameter('start', 0); $start = get_parameter('start', 0);
@ -263,7 +263,7 @@ if (is_ajax()) {
ob_start(); ob_start();
$order = get_datatable_order(true); $order = get_datatable_order(true);
if (is_array($order) && $order['field'] == 'mini_severity') { if (is_array($order) === true && $order['field'] === 'mini_severity') {
$order['field'] = 'te.criticity'; $order['field'] = 'te.criticity';
} }
@ -295,7 +295,8 @@ if (is_ajax()) {
'tg.nombre as group_name', 'tg.nombre as group_name',
'ta.direccion', 'ta.direccion',
]; ];
if (!is_metaconsole()) {
if (is_metaconsole() === false) {
$fields[] = 'am.nombre as module_name'; $fields[] = 'am.nombre as module_name';
$fields[] = 'am.id_agente_modulo as id_agentmodule'; $fields[] = 'am.id_agente_modulo as id_agentmodule';
$fields[] = 'am.custom_id as module_custom_id'; $fields[] = 'am.custom_id as module_custom_id';
@ -509,11 +510,13 @@ if ($loaded_filter !== false && $from_event_graph != 1) {
$filter_only_alert = $filter['filter_only_alert']; $filter_only_alert = $filter['filter_only_alert'];
$id_group_filter = $filter['id_group_filter']; $id_group_filter = $filter['id_group_filter'];
$date_from = $filter['date_from']; $date_from = $filter['date_from'];
$time_from = $filter['time_from'];
$date_to = $filter['date_to']; $date_to = $filter['date_to'];
$time_to = $filter['time_to'];
$source = $filter['source']; $source = $filter['source'];
$id_extra = $filter['id_extra']; $id_extra = $filter['id_extra'];
$user_comment = $filter['user_comment']; $user_comment = $filter['user_comment'];
$id_source_event = $filter['id_source_event']; $id_source_event = ($filter['id_source_event'] ?? '');
$server_id = $filter['server_id']; $server_id = $filter['server_id'];
} }
} }
@ -565,7 +568,7 @@ $tabletags_with->cellspacing = 4;
$tabletags_with->cellpadding = 4; $tabletags_with->cellpadding = 4;
$tabletags_with->class = 'noshadow'; $tabletags_with->class = 'noshadow';
$tabletags_with->styleTable = 'border: 0px;'; $tabletags_with->styleTable = 'border: 0px;';
if (is_metaconsole()) { if (is_metaconsole() === true) {
$tabletags_with->class = 'nobady'; $tabletags_with->class = 'nobady';
$tabletags_with->cellspacing = 0; $tabletags_with->cellspacing = 0;
$tabletags_with->cellpadding = 0; $tabletags_with->cellpadding = 0;
@ -642,7 +645,7 @@ $tabletags_without->width = '100%';
$tabletags_without->cellspacing = 4; $tabletags_without->cellspacing = 4;
$tabletags_without->cellpadding = 4; $tabletags_without->cellpadding = 4;
$tabletags_without->class = 'noshadow'; $tabletags_without->class = 'noshadow';
if (is_metaconsole()) { if (is_metaconsole() === true) {
$tabletags_without->class = 'nobady'; $tabletags_without->class = 'nobady';
$tabletags_without->cellspacing = 0; $tabletags_without->cellspacing = 0;
$tabletags_without->cellpadding = 0; $tabletags_without->cellpadding = 0;
@ -781,7 +784,7 @@ if ($pure) {
// Floating menu - End. // Floating menu - End.
ui_require_jquery_file('countdown'); ui_require_jquery_file('countdown');
} else { } else {
if (is_metaconsole()) { if (is_metaconsole() === true) {
// Load metaconsole frame. // Load metaconsole frame.
enterprise_hook('open_meta_frame'); enterprise_hook('open_meta_frame');
} }
@ -892,7 +895,7 @@ if ($pure) {
} }
// If the history event is not enabled, dont show the history tab. // If the history event is not enabled, dont show the history tab.
if (!isset($config['metaconsole_events_history']) || $config['metaconsole_events_history'] != 1) { if (isset($config['metaconsole_events_history']) === false || $config['metaconsole_events_history'] != 1) {
unset($onheader['history']); unset($onheader['history']);
} }
@ -913,7 +916,7 @@ if ($pure) {
break; break;
} }
if (! defined('METACONSOLE')) { if (is_metaconsole() === false) {
unset($onheader['history']); unset($onheader['history']);
ui_print_page_header( ui_print_page_header(
__('Events'), __('Events'),
@ -974,13 +977,16 @@ if (enterprise_installed() === true) {
} }
// Error div for ajax messages. // Error div for ajax messages.
echo "<div id='show_message_error'>"; html_print_div(
echo '</div>'; [
'id' => 'show_message_error',
'content' => '',
]
);
// Controls. // Controls.
if (is_metaconsole() !== true) { if (is_metaconsole() !== true) {
if (isset($config['event_replication']) if (isset($config['event_replication']) === true
&& $config['event_replication'] == 1 && $config['event_replication'] == 1
) { ) {
if ($config['show_events_in_local'] == 0) { if ($config['show_events_in_local'] == 0) {
@ -1095,7 +1101,7 @@ $in = '<div class="filter_input"><label>'.__('Free search').'</label>';
$in .= $data.'</div>'; $in .= $data.'</div>';
$inputs[] = $in; $inputs[] = $in;
if (empty($severity) && $severity !== '0') { if (empty($severity) === true && $severity !== '0') {
$severity = -1; $severity = -1;
} }
@ -1207,7 +1213,7 @@ $in .= $data.'</div>';
$adv_inputs[] = $in; $adv_inputs[] = $in;
// Mixed. Metaconsole => server, Console => module. // Mixed. Metaconsole => server, Console => module.
if (is_metaconsole()) { if (is_metaconsole() === true) {
$title = __('Server'); $title = __('Server');
$data = html_print_select_from_sql( $data = html_print_select_from_sql(
'SELECT id, server_name FROM tmetaconsole_setup', 'SELECT id, server_name FROM tmetaconsole_setup',
@ -1270,16 +1276,20 @@ $data = html_print_select(
-1, -1,
true true
); );
$in = '<div class="filter_input"><label>'.__('Alert events').'</label>';
$in .= $data.'</div>';
$adv_inputs[] = $in;
if (is_metaconsole()) { $adv_inputs[] = html_print_div(
if (empty($id_source_event) === true) { [
$id_source_event = ''; 'class' => 'filter_input',
} 'content' => sprintf(
'<label>%s</label>%s',
__('Alert events'),
$data
),
],
true
);
$input_id_source_event = (empty($id_source_event) === true) ? '' : $id_source_event; if (is_metaconsole() === true) {
$data = html_print_input_text( $data = html_print_input_text(
'id_source_event', 'id_source_event',
$id_source_event, $id_source_event,
@ -1288,19 +1298,24 @@ if (is_metaconsole()) {
255, 255,
true true
); );
$in = '<div class="filter_input"><label>'.__('Id source event').'</label>';
$in .= $data.'</div>';
$adv_inputs[] = $in;
}
if ($date_from === '0000-00-00') { $adv_inputs[] = html_print_div(
$date_from = ''; [
'class' => 'filter_input',
'content' => sprintf(
'<label>%s</label>%s',
__('Id source event'),
$data
),
],
true
);
} }
// Date from. // Date from.
$data = html_print_input_text( $inputDateFrom = html_print_input_text(
'date_from', 'date_from',
$date_from, ($date_from === '0000-00-00') ? '' : $date_from,
'', '',
false, false,
10, 10,
@ -1318,22 +1333,69 @@ $data = html_print_input_text(
// Autocomplete. // Autocomplete.
'off' 'off'
); );
$in = '<div class="filter_input">';
$in .= '<div class="filter_input_little"><label>'.__('Date from').'</label>';
$in .= $data.'</div>';
$data = ''; // Time from.
$in .= $data.'</div>'; $inputTimeFrom = html_print_input_text(
$adv_inputs[] = $in; 'time_from',
$time_from,
'',
false,
10,
true,
// Disabled.
false,
// Required.
false,
// Function.
'',
// Class.
'',
// OnChange.
'',
// Autocomplete.
'off'
);
if ($date_to === '0000-00-00') { // Date and Time From.
$date_to = ''; $adv_inputs[] = html_print_div(
} [
'class' => 'filter_input',
'content' => sprintf(
'<label>%s</label>%s<span>:</span>%s',
__('From (date:time)'),
$inputDateFrom,
$inputTimeFrom
),
],
true
);
// Time to.
$inputTimeTo = html_print_input_text(
'time_to',
$time_to,
'',
false,
10,
true,
// Disabled.
false,
// Required.
false,
// Function.
'',
// Class.
'',
// OnChange.
'',
// Autocomplete.
'off'
);
// Date to. // Date to.
$data = html_print_input_text( $inputDateTo = html_print_input_text(
'date_to', 'date_to',
$date_to, ($date_to === '0000-00-00') ? '' : $date_to,
'', '',
false, false,
10, 10,
@ -1351,16 +1413,23 @@ $data = html_print_input_text(
// Autocomplete. // Autocomplete.
'off' 'off'
); );
$in = '<div class="filter_input">';
$in .= '<div class="filter_input_little"><label>'.__('Date to').'</label>';
$in .= $data.'</div>';
$data = ''; // Date and Time To.
$in .= $data.'</div>'; $adv_inputs[] = html_print_div(
$adv_inputs[] = $in; [
'class' => 'filter_input',
'content' => sprintf(
'<label>%s</label>%s<span>:</span>%s',
__('To (date:time)'),
$inputDateTo,
$inputTimeTo
),
],
true
);
// Tags. // Tags.
if (is_metaconsole()) { if (is_metaconsole() === true) {
$data = '<fieldset><legend class="pdd_0px">'.__('Events with following tags').'</legend>'.html_print_table($tabletags_with, true).'</fieldset>'; $data = '<fieldset><legend class="pdd_0px">'.__('Events with following tags').'</legend>'.html_print_table($tabletags_with, true).'</fieldset>';
$data .= '<fieldset><legend class="pdd_0px">'.__('Events without following tags').'</legend>'.html_print_table($tabletags_without, true).'</fieldset>'; $data .= '<fieldset><legend class="pdd_0px">'.__('Events without following tags').'</legend>'.html_print_table($tabletags_without, true).'</fieldset>';
} else { } else {

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.757-210916 Version: 7.0NG.757-210922
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.757"; my $pandora_version = "7.0NG.757";
my $pandora_build = "210916"; my $pandora_build = "210922";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -4828,23 +4828,23 @@ sub generate_status_event ($$$$$$$$) {
} }
($event_type, $severity) = ('going_down_normal', 2); ($event_type, $severity) = ('going_down_normal', 2);
$description = $pa_config->{"text_going_down_normal"}; $description = safe_output($pa_config->{"text_going_down_normal"});
# Critical # Critical
} elsif ($status == 1) { } elsif ($status == 1) {
($event_type, $severity) = ('going_up_critical', 4); ($event_type, $severity) = ('going_up_critical', 4);
$description = $pa_config->{"text_going_up_critical"}; $description = safe_output($pa_config->{"text_going_up_critical"});
# Warning # Warning
} elsif ($status == 2) { } elsif ($status == 2) {
# From critical # From critical
if ($known_status == 1) { if ($known_status == 1) {
($event_type, $severity) = ('going_down_warning', 3); ($event_type, $severity) = ('going_down_warning', 3);
$description = $pa_config->{"text_going_down_warning"}; $description = safe_output($pa_config->{"text_going_down_warning"});
} }
# From normal or warning (after becoming unknown) # From normal or warning (after becoming unknown)
else { else {
($event_type, $severity) = ('going_up_warning', 3); ($event_type, $severity) = ('going_up_warning', 3);
$description = $pa_config->{"text_going_up_warning"}; $description = safe_output($pa_config->{"text_going_up_warning"});
} }
} else { } else {
# Unknown status # Unknown status

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -567,6 +567,10 @@ export default class VisualConsole {
Object.keys(this.lineLinks[item.id]).forEach(i => { Object.keys(this.lineLinks[item.id]).forEach(i => {
let lineId = parseInt(i); let lineId = parseInt(i);
const found = this.elementIds.indexOf(lineId);
if (found === -1) {
return;
}
let line = this.elementsById[lineId] as Line; let line = this.elementsById[lineId] as Line;
if (line.props) { if (line.props) {
let startX = line.props.startPosition.x; let startX = line.props.startPosition.x;