';
+ $output .= \ui_print_info_message(
+ __('Invalid regex'),
+ '',
+ true
+ );
+ $output .= '
';
+ return $output;
+ }
+
// This function check ACL.
$agents = @agents_get_group_agents(0, ['aliasRegex' => $agentRegex]);
$agentsId = \array_keys($agents);
diff --git a/pandora_console/include/lib/ITSM/Manager.php b/pandora_console/include/lib/ITSM/Manager.php
index 14bd693ed7..eebf3f665e 100644
--- a/pandora_console/include/lib/ITSM/Manager.php
+++ b/pandora_console/include/lib/ITSM/Manager.php
@@ -1120,7 +1120,10 @@ class Manager
}
$onheader = [];
- $onheader['configure'] = $setup_tab;
+ if (users_is_admin() === true) {
+ $onheader['configure'] = $setup_tab;
+ }
+
$onheader['dashboard'] = $dashboard_tab;
$onheader['list'] = $list_tab;
if ($idIncidence !== 0) {
diff --git a/pandora_console/include/styles/agent_view.css b/pandora_console/include/styles/agent_view.css
index d4a1d89a4e..1df8efdb84 100644
--- a/pandora_console/include/styles/agent_view.css
+++ b/pandora_console/include/styles/agent_view.css
@@ -6,6 +6,10 @@ div#bullets_modules span {
font-weight: 700;
}
+div.bullets_modules span {
+ font-weight: 700;
+}
+
div.agent_details_agent_caption {
flex: 1;
}
diff --git a/pandora_console/include/styles/events.css b/pandora_console/include/styles/events.css
index edf5014385..1a66ba7174 100644
--- a/pandora_console/include/styles/events.css
+++ b/pandora_console/include/styles/events.css
@@ -538,3 +538,7 @@ div.container-filter-buttons {
.ui-state-active {
border-radius: 0px !important;
}
+
+.ui-dialog.modal-sound .ui-widget-header {
+ display: flex !important;
+}
diff --git a/pandora_console/include/styles/js/jquery-ui_custom.css b/pandora_console/include/styles/js/jquery-ui_custom.css
index 9c17d7fdab..5802fc9155 100644
--- a/pandora_console/include/styles/js/jquery-ui_custom.css
+++ b/pandora_console/include/styles/js/jquery-ui_custom.css
@@ -46,15 +46,10 @@
}
.ui-dialog .ui-dialog-titlebar-minimize {
- position: absolute;
- right: 1.5em;
- width: 21px;
- margin: 0px 0 0 0;
- padding: 1px;
+ position: relative;
height: 20px;
- bottom: 30%;
- top: 2em;
- background-color: #fff !important;
+ width: 20px;
+ margin-right: 1px;
}
.ui-dialog .ui-dialog-titlebar-minimize:hover {
@@ -63,16 +58,9 @@
.ui-dialog .ui-dialog-titlebar-disengage {
position: relative;
- right: 1.5em;
- width: 21px;
- margin: 0px 0 0 0;
- padding: 1px;
height: 20px;
- bottom: 30%;
- background-color: #fff !important;
- -ms-transform: scale(1.2);
- -webkit-transform: scale(1.2);
- transform: scale(1.2);
+ width: 20px;
+ margin-right: 5px;
}
.ui-dialog .ui-dialog-titlebar-disengage:hover {
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index 50d3ec4778..8a6da80084 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -6043,18 +6043,18 @@ div.switch_radio_button label:last-of-type {
margin-top: -2px;
}
-/*
-div#bullets_modules {
- display: flex;
- margin-left: 2em;
-}
-*/
div#bullets_modules div {
display: flex;
align-items: center;
margin: 0 5px;
}
+div.bullets_modules div {
+ display: flex;
+ align-items: center;
+ margin: 0 10px;
+}
+
.orange_background {
background: #ffa631;
}
@@ -6225,7 +6225,7 @@ div#status_pie {
display: flex;
align-items: flex-start;
padding: 20px;
- padding-bottom: 0;
+ padding-bottom: 1%;
}
.agent_details_content_cluster {
@@ -6315,6 +6315,7 @@ div#status_pie {
flex-direction: column;
justify-content: center;
align-items: center;
+ width: 100%;
}
.agent_details_agent_data {
@@ -6344,23 +6345,45 @@ div#status_pie {
justify-content: flex-start;
}
+.agent_details_bullets .bullets_modules {
+ display: flex;
+ justify-content: flex-start;
+}
+
.agent_details_bullets_cluster #bullets_modules {
display: flex;
justify-content: flex-start;
flex-direction: column;
}
+.agent_details_bullets_cluster .bullets_modules {
+ display: flex;
+ justify-content: flex-start;
+ flex-direction: column;
+}
+
.agent_details_bullets_cluster #bullets_modules > div {
padding: 0px;
margin-bottom: 10px;
}
+.agent_details_bullets_cluster .bullets_modules > div {
+ padding: 0px;
+ margin-bottom: 10px;
+}
+
.agent_details_bullets #bullets_modules > div {
display: flex;
align-items: center;
padding-bottom: 20px;
}
+.agent_details_bullets .bullets_modules > div {
+ display: flex;
+ align-items: center;
+ padding-bottom: 20px;
+}
+
#agent_contact_main tr td img {
max-width: 100%;
}
@@ -6412,6 +6435,11 @@ div#status_pie {
float: right;
}
+.white_table_graph_header div.bullets_modules {
+ display: flex;
+ float: right;
+}
+
.white_table_graph_header img,
.white_table_graph_header span {
vertical-align: middle;
@@ -10809,6 +10837,13 @@ button div.fail {
-webkit-mask: url(../../images/fail@svg.svg) no-repeat center / contain;
}
+button div.refresh {
+ mask: url(../../images/refresh@svg.svg) no-repeat center / contain;
+ -webkit-mask: url(../../images/refresh@svg.svg) no-repeat center / contain;
+ width: 22px;
+ height: 22px;
+}
+
button div.force {
mask: url(../../images/force@svg.svg) no-repeat center / contain;
-webkit-mask: url(../../images/force@svg.svg) no-repeat center / contain;
@@ -12753,6 +12788,10 @@ div.agents_custom_fields #datatables_wrapper div.bottom {
justify-content: flex-start !important;
}
+.alert_view_calendar > .fc-view-harness > .fc-view > .fc-scrollgrid {
+ width: auto !important;
+}
+
.title_tactical {
padding: 10px 0px 10px 0px;
text-align: center;
@@ -12831,3 +12870,16 @@ tr.shown td.details-control {
position: absolute;
margin-left: 5px;
}
+
+.disengage-buttom-image {
+ background-color: rgb(51, 51, 51);
+ mask: url(../../images/desacoplar-ventana.svg) no-repeat right / contain;
+ -webkit-mask: url(../../images/desacoplar-ventana.svg) no-repeat right /
+ contain;
+}
+
+.minimize-buttom-image {
+ background-color: rgb(51, 51, 51);
+ mask: url(../../images/minimizar.svg) no-repeat right / contain;
+ -webkit-mask: url(../../images/minimizar.svg) no-repeat right / contain;
+}
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 36fe3a8ea4..a558cc0229 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -131,7 +131,7 @@
id = 'agent_status_main';
-$table_status->width = '100%';
+$table_status->width = '90%';
+$table_status->height = 'auto';
$table_status->cellspacing = 0;
$table_status->cellpadding = 0;
$table_status->class = 'floating_form';
-$table_status->style[0] = 'height: 32px; width: 30%; padding-right: 5px; text-align: end; vertical-align: top';
-$table_status->style[1] = 'height: 32px; width: 70%; padding-left: 5px; font-weight: lighter; vertical-align: top';
-$table_status->data['agent_os'][0] = __('OS');
-$agentOS = [];
-$agentOS[] = html_print_div([ 'content' => (empty($agent['os_version']) === true) ? get_os_name((int) $agent['id_os']) : $agent['os_version']], true);
-$agentOS[] = html_print_div([ 'style' => 'width: 16px;padding-left: 5px', 'content' => ui_print_os_icon($agent['id_os'], false, true, true, false, false, false, ['width' => '16px'])], true);
-$table_status->data['agent_os'][1] = html_print_div(['class' => 'agent_details_agent_data', 'content' => implode('', $agentOS)], true);
+$table_status->style[0] = 'height: 28px; width: 30%; padding-right: 5px; text-align: end; vertical-align: top';
+$table_status->style[1] = 'height: 28px; width: 70%; padding-left: 5px; font-weight: lighter; vertical-align: top';
+
+$os_agent_text = '';
+$os_name = get_os_name((int) $agent['id_os']);
+if (empty($agent['os_version']) !== true) {
+ $agent['os_version'] = io_safe_output($agent['os_version']);
+ if (strpos($agent['os_version'], '(') !== false) {
+ $os_name = preg_split('/[0-9]|[\(]/', $agent['os_version'])[0];
+ $os_version = explode($os_name, explode('(', $agent['os_version'])[0])[1];
+ $os_version_name = preg_split('/[\(]|[\)]/', $agent['os_version']);
+ $os_agent_text = $os_version.' ('.$os_version_name[1].')';
+ } else {
+ $os_name = preg_split('/[0-9]/', $agent['os_version'])[0];
+ $os_version = explode($os_name, explode('(', $agent['os_version'])[0])[1];
+ $os_agent_text = $os_version;
+ }
+}
+
+$table_status->data['agent_os'][0] = html_print_div([ 'style' => 'width: 16px; position: relative; left: 75%', 'content' => ui_print_os_icon($agent['id_os'], false, true, true, false, false, false, ['width' => '16px'])], true);
+$table_status->data['agent_os'][1] = $os_name;
+
+if (empty($agent['os_version']) !== true) {
+ $table_status->data['agent_os_version'][0] = __('OS Version');
+ $table_status->data['agent_os_version'][1] = $os_agent_text;
+}
$addresses = agents_get_addresses($id_agente);
$address = agents_get_address($id_agente);
@@ -124,43 +144,48 @@ foreach ($addresses as $k => $add) {
}
if (empty($address) === false) {
+ $address_text = '
'.$address.'';
+ if (!empty($addresses) === true) {
+ foreach ($addresses as $sec_address) {
+ $address_text .= '
'.$sec_address.'';
+ }
+ }
+
$table_status->data['ip_address'][0] = __('IP address');
- $table_status->data['ip_address'][1] = (empty($address) === true) ? '
'.__('N/A').'' : $address;
+ $table_status->data['ip_address'][1] = (empty($address) === true) ? '
'.__('N/A').'' : $address_text;
}
$table_status->data['agent_version'][0] = __('Agent Version');
$table_status->data['agent_version'][1] = (empty($agent['agent_version']) === true) ? '
'.__('N/A').'' : $agent['agent_version'];
$table_status->data['description'][0] = __('Description');
-$table_status->data['description'][1] = (empty($agent['comentarios']) === true) ? '
'.__('N/A').'' : $agent['comentarios'];
+$table_status->data['description'][1] = (empty($agent['comentarios']) === true) ? '
'.__('N/A').'' : ui_print_truncate_text($agent['comentarios'], 'description', true);
-$has_remote_conf = enterprise_hook(
- 'config_agents_has_remote_configuration',
- [$agent['id_agente']]
+$agentEventsHeader = html_print_div(
+ [
+ 'class' => 'agent_details_header',
+ 'content' => '',
+ ],
+ true
);
-if ((bool) $has_remote_conf) {
- $table_status->data['remote_config'][0] = __('Remote configuration');
- $table_status->data['remote_config'][1] = __('Enabled');
-
- $satellite_server = (int) db_get_value_filter(
- 'satellite_server',
- 'tagente',
- ['id_agente' => $id_agente]
- );
-
- if (empty($satellite_server) === false) {
- $satellite_name = db_get_value_filter(
- 'name',
- 'tserver',
- ['id_server' => $satellite_server]
- );
-
- $table_status->data['remote_config'][0] = __('Satellite server');
- $table_status->data['remote_config'][1] = $satellite_name;
- }
-}
-
+$agentEventsGraph = html_print_div(
+ [
+ 'class' => 'white-table-graph-content',
+ 'content' => graph_graphic_agentevents(
+ $id_agente,
+ 95,
+ 50,
+ SECONDS_1DAY,
+ '',
+ true,
+ true,
+ 500
+ ),
+ 'style' => 'margin-top: -25px',
+ ],
+ true
+);
$table_agent = $agentStatusHeader.'
@@ -170,6 +195,9 @@ $table_agent = $agentStatusHeader.'
'.$alive_animation.html_print_table($table_status, true).'
+
+
+ '.$agentEventsHeader.$agentEventsGraph.'
';
@@ -189,11 +217,12 @@ $data_opcional->class = 'floating_form';
// Gis and url address.
$agentAdditionalContent = '';
// Position Information.
-if ((bool) $config['activate_gis'] === true) {
+/*
+ if ((bool) $config['activate_gis'] === true) {
$dataPositionAgent = gis_get_data_last_position_agent(
$agent['id_agente']
);
- if (is_array($dataPositionAgent) === true && $dataPositionAgent['stored_longitude'] !== '' && $dataPositionAgent['stored_longitude'] !== '') {
+ if (is_array($dataPositionAgent) === true && $dataPositionAgent['stored_longitude'] !== '' && $dataPositionAgent['stored_latitude'] !== '') {
$data_opcional->data['agent_position'][0] = __('Position (Long, Lat)');
$dataOptionalOutput = html_print_anchor(
@@ -210,10 +239,11 @@ if ((bool) $config['activate_gis'] === true) {
$data_opcional->data['agent_position'][1] = $dataOptionalOutput;
}
-}
+}*/
// If the url description is set.
-if (empty($agent['url_address']) === false) {
+/*
+ if (empty($agent['url_address']) === false) {
$data_opcional->data['url_address'][0] = __('Url address');
$data_opcional->data['url_address'][1] = html_print_anchor(
[
@@ -222,11 +252,12 @@ if (empty($agent['url_address']) === false) {
],
true
);
-}
+}*/
// Other IP address and timezone offset.
-if (empty($addresses) === false) {
+/*
+ if (empty($addresses) === false) {
$data_opcional->data['other_ip_address'][0] = __('Other IP addresses');
$data_opcional->data['other_ip_address'][1] = html_print_div(
[
@@ -235,13 +266,14 @@ if (empty($addresses) === false) {
],
true
);
-}
-
+ }
+*/
// Timezone Offset.
-if ((int) $agent['timezone_offset'] !== 0) {
+/*
+ if ((int) $agent['timezone_offset'] !== 0) {
$data_opcional->data['timezone_offset'][0] = __('Timezone Offset');
$data_opcional->data['timezone_offset'][1] = $agent['timezone_offset'];
-}
+}*/
// Custom fields.
$fields = db_get_all_rows_filter(
@@ -485,39 +517,6 @@ $agentContact = html_print_div(
true
);
-$agentEventsHeader = html_print_div(
- [
- 'class' => 'agent_details_header',
- 'content' => '',
- ],
- true
-);
-
-$agentEventsGraph = html_print_div(
- [
- 'class' => 'white-table-graph-content',
- 'content' => graph_graphic_agentevents(
- $id_agente,
- 95,
- 70,
- SECONDS_1DAY,
- '',
- true,
- true,
- 500
- ),
- ],
- true
-);
-
-$agentEvents = html_print_div(
- [
- 'class' => 'box-flat agent_details_col w50p',
- 'content' => $agentEventsHeader.$agentEventsGraph,
- ],
- true
-);
-
/*
* EVENTS TABLE END.
*/
diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php
index 4bddd880c5..5292bb46a1 100644
--- a/pandora_console/operation/events/events.php
+++ b/pandora_console/operation/events/events.php
@@ -130,6 +130,11 @@ $severity = get_parameter(
'filter[severity]',
($filter['severity'] ?? '')
);
+$regex = get_parameter(
+ 'filter[regex]',
+ (io_safe_output($filter['regex']) ?? '')
+);
+unset($filter['regex']);
$status = get_parameter(
'filter[status]',
($filter['status'] ?? '')
@@ -378,6 +383,7 @@ if (is_ajax() === true) {
'te.owner_user',
'if(te.ack_utimestamp > 0, te.ack_utimestamp,"") as ack_utimestamp',
'te.custom_data',
+ 'te.event_custom_id',
'te.data',
'te.module_status',
'ta.alias as agent_name',
@@ -472,7 +478,7 @@ if (is_ajax() === true) {
$data = array_reduce(
$events,
- function ($carry, $item) use ($table_id, &$redirection_form_id, $filter, $compact_date, $external_url, $compact_name_event) {
+ function ($carry, $item) use ($table_id, &$redirection_form_id, $filter, $compact_date, $external_url, $compact_name_event, $regex) {
global $config;
$tmp = (object) $item;
@@ -1207,12 +1213,34 @@ if (is_ajax() === true) {
}
}
+ if (empty($tmp) === false && $regex !== '') {
+ $regex_validation = false;
+ foreach (json_decode(json_encode($tmp), true) as $key => $field) {
+ if (preg_match('/'.$regex.'/', $field)) {
+ $regex_validation = true;
+ }
+ }
+
+ if ($regex_validation === false) {
+ unset($tmp);
+ }
+ }
+
$carry[] = $tmp;
return $carry;
}
);
}
+ $data = array_values(
+ array_filter(
+ $data,
+ function ($item) {
+ return (bool) (array) $item;
+ }
+ )
+ );
+ $count = count($data);
// RecordsTotal && recordsfiltered resultados totales.
echo json_encode(
[
@@ -1293,6 +1321,7 @@ if ($loaded_filter !== false && $from_event_graph != 1 && isset($fb64) === false
$severity = $filter['severity'];
$status = $filter['status'];
$search = $filter['search'];
+ $regex = $filter['regex'];
$not_search = $filter['not_search'];
$text_agent = $filter['text_agent'];
$id_agent = $filter['id_agent'];
@@ -2057,6 +2086,12 @@ $in = '
';
$in .= $data.'
';
$inputs[] = $in;
+// REGEX search datatable.
+$in = '
';
+$in .= html_print_input_text('regex', $regex, '', '', 255, true);
+$in .= '
';
+$inputs[] = $in;
+
// User private filter.
$inputs[] = html_print_input_hidden('private_filter_event', $private_filter_event, true);
// Trick view in table.
@@ -3488,6 +3523,10 @@ $(document).ready( function() {
click_button_remove_tag("without");
});
+ $('#myInputTextField').keyup(function(){
+ $("#table_events").search($(this).val()).draw() ;
+ });
+
$("#button-events_form_search_bt").click(function(){
show_events_graph();
});
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 7e159b2cbb..370d3f5a62 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.774
-%define release 231129
+%define release 231201
# User and Group under which Apache is running
%define httpd_name httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index ba6b971a18..2caf500872 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.774
-%define release 231129
+%define release 231201
# User and Group under which Apache is running
%define httpd_name httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index fe2fce0746..92811231e2 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.774
-%define release 231129
+%define release 231201
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index 4c527345c0..fca9535e63 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -726,6 +726,7 @@ CREATE TABLE IF NOT EXISTS `tevento` (
`custom_data` TEXT,
`data` TINYTEXT,
`module_status` INT NOT NULL DEFAULT 0,
+ `event_custom_id` TEXT,
PRIMARY KEY (`id_evento`),
KEY `idx_agente` (`id_agente`),
KEY `idx_agentmodule` (`id_agentmodule`),
@@ -1271,6 +1272,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` (
`custom_data_filter_type` TINYINT UNSIGNED DEFAULT 0,
`owner_user` TEXT,
`private_filter_user` TEXT,
+ `regex` TEXT,
PRIMARY KEY (`id_filter`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@@ -2640,6 +2642,9 @@ CREATE TABLE IF NOT EXISTS `tdashboard` (
`active` TINYINT NOT NULL DEFAULT 0,
`cells` INT UNSIGNED DEFAULT 0,
`cells_slideshow` TINYINT NOT NULL DEFAULT 0,
+ `date_range` TINYINT NOT NULL DEFAULT 0,
+ `date_from` INT NOT NULL DEFAULT 0,
+ `date_to` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@@ -3031,7 +3036,6 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` (
`module` TEXT,
`alert` TEXT,
`criticity` TEXT,
- `user_comment` TEXT,
`id_tag` TEXT,
`name` TEXT,
`group_recursion` TEXT,
@@ -3046,7 +3050,6 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` (
`operator_module` TEXT COMMENT 'Operator for module',
`operator_alert` TEXT COMMENT 'Operator for alert',
`operator_criticity` TEXT COMMENT 'Operator for criticity',
- `operator_user_comment` TEXT COMMENT 'Operator for user_comment',
`operator_id_tag` TEXT COMMENT 'Operator for id_tag',
`operator_log_content` TEXT COMMENT 'Operator for log_content',
`operator_log_source` TEXT COMMENT 'Operator for log_source',
diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql
index 1628aa7d5d..28605959ed 100644
--- a/pandora_console/pandoradb_data.sql
+++ b/pandora_console/pandoradb_data.sql
@@ -156,7 +156,8 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('gotty', '/usr/bin/gotty'),
('custom_module_units', '{"bytes":"bytes","entries":"entries","files":"files","hits":"hits","sessions":"sessions","users":"users","ºC":"ºC","ºF":"ºF"}'),
('server_unique_identifier', replace(uuid(),'-','')),
-('lts_name', '');
+('lts_name', ''),
+('lts_updates', 1);
UNLOCK TABLES;
--
@@ -1167,9 +1168,9 @@ INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`) VALUES (6,'Create Pandora ITSM ticket',16);
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (7, 'Pandora Google chat', 17, "", "data=_data_", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "", "data=_data_", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (8, 'Pandora Slack', 18, "data=_data_", "", ":red_circle:", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", 0, 0, "data=_data_", "", ":green_circle:", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "");
-INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (9, 'Pandora Telegram', 19, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "");
+INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (9, 'Pandora Telegram', 19, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _timestamp_ / _data_", "", "", "", "", "", "", "", "");
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (10, 'Pandora ilert', 20, "alert", "", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "resolved", "", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
-INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (11, 'Pandora Vonage', 21, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "");
+INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (11, 'Pandora Vonage', 21, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _timestamp_ / _data_", "", "", "", "", "", "", "", "");
-- alert templates (default)
diff --git a/pandora_console/views/dashboard/formDashboard.php b/pandora_console/views/dashboard/formDashboard.php
index c36df6cf06..be21a3142e 100644
--- a/pandora_console/views/dashboard/formDashboard.php
+++ b/pandora_console/views/dashboard/formDashboard.php
@@ -102,6 +102,31 @@ $inputs = [
],
],
],
+ [
+ 'label' => __('Date range'),
+ 'arguments' => [
+ 'name' => 'date_range',
+ 'id' => 'date_range',
+ 'type' => 'switch',
+ 'value' => $arrayDashboard['date_range'],
+ 'onchange' => 'handle_date_range(this)',
+ ],
+ ],
+ [
+ 'label' => __('Select range'),
+ 'style' => 'display: none;',
+ 'class' => 'row_date_range',
+ 'arguments' => [
+ 'name' => 'range',
+ 'id' => 'range',
+ 'selected' => ($arrayDashboard['date_from'] === '0' && $arrayDashboard['date_to'] === '0') ? 300 : 'chose_range',
+ 'type' => 'date_range',
+ 'date_init' => date('Y/m/d', $arrayDashboard['date_from']),
+ 'time_init' => date('H:i:s', $arrayDashboard['date_from']),
+ 'date_end' => date('Y/m/d', $arrayDashboard['date_to']),
+ 'time_end' => date('H:i:s', $arrayDashboard['date_to']),
+ ],
+ ],
[
'block_id' => 'private',
'direct' => 1,
@@ -135,3 +160,30 @@ HTML::printForm(
'inputs' => $inputs,
]
);
+
+?>
+
+
\ No newline at end of file
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index d691de7bdc..89247f4fe7 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-server
-Version: 7.0NG.774-231129
+Version: 7.0NG.774-231201
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index b30b2c34c0..933c82a524 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.774-231129"
+pandora_version="7.0NG.774-231201"
package_cpan=0
package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 2276c30eec..b5d4610807 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.774";
-my $pandora_build = "231129";
+my $pandora_build = "231201";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm
index baabc7d047..14544ae1c0 100644
--- a/pandora_server/lib/PandoraFMS/Core.pm
+++ b/pandora_server/lib/PandoraFMS/Core.pm
@@ -4304,6 +4304,7 @@ sub pandora_event {
my $utimestamp = time ();
my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime ($utimestamp));
+ my $event_custom_id = undef;
$id_agentmodule = 0 unless defined ($id_agentmodule);
# Validate events with the same event id
@@ -4321,6 +4322,7 @@ sub pandora_event {
logger($pa_config, "Keeping In process status from last event with extended id '$id_extra'.", 10);
$ack_utimestamp = get_db_value ($dbh, 'SELECT ack_utimestamp FROM tevento WHERE id_extra=? AND estado=2', $id_extra);
$event_status = 2;
+ $event_custom_id = get_db_value ($dbh, 'SELECT event_custom_id FROM tevento WHERE id_extra=? AND estado=2', $id_extra);
}
}
@@ -4332,8 +4334,8 @@ sub pandora_event {
# Create the event
logger($pa_config, "Generating event '$evento' for agent ID $id_agente module ID $id_agentmodule.", 10);
- $event_id = db_insert ($dbh, 'id_evento','INSERT INTO tevento (id_agente, id_grupo, evento, timestamp, estado, utimestamp, event_type, id_agentmodule, id_alert_am, criticity, tags, source, id_extra, id_usuario, critical_instructions, warning_instructions, unknown_instructions, ack_utimestamp, custom_data, data, module_status)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions, $ack_utimestamp, $custom_data, safe_input($module_data), $module_status);
+ $event_id = db_insert ($dbh, 'id_evento','INSERT INTO tevento (id_agente, id_grupo, evento, timestamp, estado, utimestamp, event_type, id_agentmodule, id_alert_am, criticity, tags, source, id_extra, id_usuario, critical_instructions, warning_instructions, unknown_instructions, ack_utimestamp, custom_data, data, module_status, event_custom_id)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions, $ack_utimestamp, $custom_data, safe_input($module_data), $module_status, $event_custom_id);
if(defined($event_id) && $comment ne '') {
my $comment_id = db_insert ($dbh, 'id','INSERT INTO tevent_comment (id_event, utimestamp, comment, id_user, action)
diff --git a/pandora_server/lib/PandoraFMS/InventoryServer.pm b/pandora_server/lib/PandoraFMS/InventoryServer.pm
index 5f0f90e95d..e6b070f4d8 100644
--- a/pandora_server/lib/PandoraFMS/InventoryServer.pm
+++ b/pandora_server/lib/PandoraFMS/InventoryServer.pm
@@ -181,17 +181,21 @@ sub data_consumer ($$) {
AND tagent_module_inventory.id_module_inventory = tmodule_inventory.id_module_inventory',
$module_id);
- # No code to run
- return if ($module->{'interpreter'} eq '');
-
- # Save script in a temporary file
+ my $command;
my ($fh, $temp_file) = tempfile();
- $fh->print (decode_base64($module->{'code'}));
- close ($fh);
- set_file_permissions($pa_config, $temp_file, "0777");
- # Run the script
- my $command = $module->{'interpreter'} . ' ' . $temp_file . ' "' . $module->{'target'} . '"';
+ if ($module->{'script_mode'} == '1') {
+ my $script_file = $module->{'script_path'};
+ $command = $module->{'interpreter'} . ' ' . $script_file . ' "' . $module->{'target'} . '"';
+ } else {
+ # Save script in a temporary file
+ $fh->print (decode_base64($module->{'code'}));
+ close ($fh);
+ set_file_permissions($pa_config, $temp_file, "0777");
+
+ # Run the script
+ $command = $module->{'interpreter'} . ' ' . $temp_file . ' "' . $module->{'target'} . '"';
+ }
# Try to read the custom fields to use them as arguments into the command
if (defined($module->{'custom_fields'}) && $module->{'custom_fields'} ne '') {
@@ -206,7 +210,11 @@ sub data_consumer ($$) {
if (!defined ($decoded_cfields)) {
logger ($pa_config, "Remote inventory module ".$module->{'name'}." has failed because the custom fields can't be read", 6);
- unlink ($temp_file);
+
+ if ($module->{'script_mode'} == '2') {
+ unlink ($temp_file);
+ }
+
return;
}
@@ -237,11 +245,18 @@ sub data_consumer ($$) {
# Check for errors
if ($? != 0) {
logger ($pa_config, "Remote inventory module ".$module->{'name'}." has failed with error level $?", 6);
- unlink ($temp_file);
+
+ if ($module->{'script_mode'} == '2') {
+ unlink ($temp_file);
+ }
+
return;
}
- unlink ($temp_file);
+ if ($module->{'script_mode'} == '2') {
+ unlink ($temp_file);
+ }
+
my $utimestamp = time ();
my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime ($utimestamp));
eval {
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 3b3e22e220..d60e983bd2 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.774";
-my $pandora_build = "231129";
+my $pandora_build = "231201";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index ed418e52db..f18d9963f5 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -7,7 +7,7 @@
%define debug_package %{nil}
%define name pandorafms_server
%define version 7.0NG.774
-%define release 231129
+%define release 231201
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index d65b6d1a0f..e716d1ccbd 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.774
-%define release 231129
+%define release 231201
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 11c2eccfd3..88443bd3d4 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.774"
-PI_BUILD="231129"
+PI_BUILD="231201"
MODE=$1
if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index e4c81f523f..42767a5e06 100755
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -38,7 +38,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
-my $version = "7.0NG.774 Build 231129";
+my $version = "7.0NG.774 Build 231201";
# Pandora server configuration
my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 7553720551..5936f7bfe5 100755
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
-my $version = "7.0NG.774 Build 231129";
+my $version = "7.0NG.774 Build 231201";
# save program name for logging
my $progname = basename($0);
@@ -201,6 +201,7 @@ sub help_screen{
help_screen_line('--disable_double_auth', '
', 'Disable the double authentication for the specified user');
print "\nEVENTS:\n\n" unless $param ne '';
help_screen_line('--create_event', " [ \n\t \n\t \n\t ]", 'Add event');
+ help_screen_line('--update_event_custom_id', " ", 'Update Event Custom ID');
help_screen_line('--validate_event', " \n\t []", 'Validate events');
help_screen_line('--validate_event_id', '', 'Validate event given a event id');
help_screen_line('--get_event_info', '[]', 'Show info about a event given a event id');
@@ -4549,6 +4550,17 @@ sub cli_create_event() {
}
}
+##############################################################################
+# Update event custom id
+# Related option: --update_event_custom_id
+##############################################################################
+
+sub cli_update_event_custom_id() {
+ my ($id_event, $event_custom_id) = @ARGV[2..3];
+ my $result = api_call(\%conf, 'set', 'event_custom_id', $id_event, $event_custom_id);
+ print "\n$result\n";
+}
+
##############################################################################
# Validate event.
# Related option: --validate_event
@@ -8335,6 +8347,10 @@ sub pandora_manage_main ($$$) {
param_check($ltotal, 4, 0);
cli_insert_gis_data();
}
+ elsif ($param eq '--update_event_custom_id'){
+ param_check($ltotal, 2);
+ cli_update_event_custom_id();
+ }
else {
print_log "[ERROR] Invalid option '$param'.\n\n";
$param = '';