From 902a8437651782d95400c87a26303c08d9e98657 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 25 Jan 2023 17:22:54 +0100 Subject: [PATCH 01/17] implemented agents view filter management --- pandora_console/extras/mr/63.sql | 18 + pandora_console/include/ajax/agent.php | 518 ++++++++++++++++++ pandora_console/include/functions_agents.php | 44 +- .../operation/agentes/estado_agente.php | 472 ++++++++++++++-- pandora_console/pandoradb.sql | 18 + 5 files changed, 1009 insertions(+), 61 deletions(-) create mode 100644 pandora_console/extras/mr/63.sql diff --git a/pandora_console/extras/mr/63.sql b/pandora_console/extras/mr/63.sql new file mode 100644 index 0000000000..8937d5730f --- /dev/null +++ b/pandora_console/extras/mr/63.sql @@ -0,0 +1,18 @@ +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `tagent_filter` ( + `id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_name` VARCHAR(600) NOT NULL, + `id_group_filter` INT NOT NULL DEFAULT 0, + `group_id` INT NOT NULL DEFAULT 0, + `recursion` TEXT, + `status` INT NOT NULL DEFAULT -1, + `search` TEXT, + `id_os` INT NOT NULL DEFAULT 0, + `policies` TEXT, + `search_custom` TEXT, + `ag_custom_fields` TEXT, + PRIMARY KEY (`id_filter`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/include/ajax/agent.php b/pandora_console/include/ajax/agent.php index 48abefdc7e..5ba3f90799 100644 --- a/pandora_console/include/ajax/agent.php +++ b/pandora_console/include/ajax/agent.php @@ -31,6 +31,14 @@ $get_agents_interfaces = (bool) get_parameter('get_agents_interfaces'); $id_agents = get_parameter('id_agents', []); $get_agents_group = (bool) get_parameter('get_agents_group', false); $force_local = (bool) get_parameter('force_local', false); + +// Agent detail filter. +$load_filter_modal = get_parameter('load_filter_modal', 0); +$save_filter_modal = get_parameter('save_filter_modal', 0); +$get_agent_filters = get_parameter('get_agent_filters', 0); +$save_agent_filter = get_parameter('save_agent_filter', 0); +$update_agent_filter = get_parameter('update_agent_filter', 0); + if (https_is_running()) { header('Content-type: application/json'); } @@ -345,4 +353,514 @@ if ($search_agents && (!is_metaconsole() || $force_local)) { return; } +// Saves an event filter. +if ($save_agent_filter) { + $values = []; + $values['id_name'] = get_parameter('id_name'); + $values['group_id'] = get_parameter('group_id'); + $values['recursion'] = get_parameter('recursion'); + $values['status'] = get_parameter('status'); + $values['search'] = get_parameter('search'); + $values['id_os'] = get_parameter('id_os'); + $values['policies'] = json_encode(get_parameter('policies')); + $values['search_custom'] = get_parameter('search_custom'); + $values['ag_custom_fields'] = get_parameter('ag_custom_fields'); + + $exists = (bool) db_get_value_filter( + 'id_filter', + 'tagent_filter', + $values + ); + + if ($exists === true) { + echo 'duplicate'; + } else { + $result = db_process_sql_insert('tagent_filter', $values); + + if ($result === false) { + echo 'error'; + } else { + echo $result; + } + } +} + +if ($update_agent_filter) { + $values = []; + $id = get_parameter('id'); + + $values['group_id'] = get_parameter('group_id'); + $values['recursion'] = get_parameter('recursion'); + $values['status'] = get_parameter('status'); + $values['search'] = get_parameter('search'); + $values['id_os'] = get_parameter('id_os'); + $values['policies'] = json_encode(get_parameter('policies')); + $values['search_custom'] = get_parameter('search_custom'); + $values['ag_custom_fields'] = get_parameter('ag_custom_fields'); + + $result = db_process_sql_update( + 'tagent_filter', + $values, + ['id_filter' => $id] + ); + + if ($result === false) { + echo 'error'; + } else { + echo 'ok'; + } +} + +if ($get_agent_filters) { + $sql = 'SELECT id_filter, id_name FROM tagent_filter'; + + $agent_filters = db_get_all_rows_sql($sql); + + $result = []; + + if ($agent_filters !== false) { + foreach ($agent_filters as $agent_filter) { + $result[$agent_filter['id_filter']] = $agent_filter['id_name']; + } + } + + echo io_json_mb_encode($result); +} + +if ((int) $load_filter_modal === 1) { + $user_groups = users_get_groups( + $config['id_user'], + 'AR', + users_can_manage_group_all(), + true + ); + + $sql = 'SELECT id_filter, id_name + FROM tagent_filter + WHERE id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; + + $event_filters = db_get_all_rows_sql($sql); + + $filters = []; + foreach ($event_filters as $event_filter) { + $filters[$event_filter['id_filter']] = $event_filter['id_name']; + } + + echo '
'; + echo '
'; + + $table = new StdClass; + $table->id = 'load_filter_form'; + $table->width = '100%'; + $table->cellspacing = 4; + $table->cellpadding = 4; + $table->class = 'databox'; + if (is_metaconsole()) { + $table->cellspacing = 0; + $table->cellpadding = 0; + $table->class = 'databox filters'; + } + + $table->styleTable = 'font-weight: bold; color: #555; text-align:left;'; + $filter_id_width = '200px'; + if (is_metaconsole()) { + $filter_id_width = '150px'; + } + + $data = []; + $table->rowid[3] = 'update_filter_row1'; + $data[0] = __('Load filter').$jump; + $data[0] .= html_print_select( + $filters, + 'filter_id', + $current, + '', + __('None'), + 0, + true, + false, + true, + '', + false, + 'margin-left:5px; width:'.$filter_id_width.';' + ); + + $data[1] = html_print_submit_button( + __('Load filter'), + 'load_filter', + false, + 'class="sub upd"', + true + ); + $data[1] .= html_print_input_hidden('load_filter', 1, true); + $table->data[] = $data; + $table->rowclass[] = ''; + html_print_table($table); + echo '
'; + echo '
'; + ?> + + + '; + if (check_acl($config['id_user'], 0, 'AW')) { + echo '
'; + + $table = new StdClass; + $table->id = 'save_filter_form'; + $table->width = '100%'; + $table->cellspacing = 4; + $table->cellpadding = 4; + $table->class = 'databox'; + + if (is_metaconsole() === true) { + $table->class = 'databox filters'; + $table->cellspacing = 0; + $table->cellpadding = 0; + } + + $table->styleTable = 'font-weight: bold; text-align:left;'; + + if (is_metaconsole() === true) { + $table->style[0] = 'width: 50%; width:50%;'; + } + + $data = []; + $table->rowid[0] = 'update_save_selector'; + $data[0] = html_print_radio_button( + 'filter_mode', + 'new', + '', + true, + true + ).__('New filter').''; + + $data[1] = html_print_radio_button( + 'filter_mode', + 'update', + '', + false, + true + ).__('Update filter').''; + + $table->data[] = $data; + $table->rowclass[] = ''; + + $data = []; + $table->rowid[1] = 'save_filter_row1'; + $data[0] = __('Filter name').$jump; + $data[0] .= html_print_input_text('id_name', '', '', 15, 255, true); + + if (is_metaconsole() === true) { + $data[1] = __('Save in Group').$jump; + } else { + $data[1] = __('Filter group').$jump; + } + + $user_groups_array = users_get_groups_for_select( + $config['id_user'], + 'EW', + users_can_manage_group_all(), + true + ); + + $data[1] .= html_print_select( + $user_groups_array, + 'id_group_filter_dialog', + $id_group_filter, + '', + '', + 0, + true, + false, + false, + 'w130' + ); + + $table->data[] = $data; + $table->rowclass[] = ''; + + $data = []; + $table->rowid[2] = 'save_filter_row2'; + + $table->data[] = $data; + $table->rowclass[] = ''; + + $data = []; + $table->rowid[3] = 'update_filter_row1'; + $data[0] = __('Overwrite filter').$jump; + + $sql = 'SELECT id_filter, id_name FROM tagent_filter'; + $agent_filters = db_get_all_rows_sql($sql); + + $_filters_update = []; + + if ($agent_filters !== false) { + foreach ($agent_filters as $agent_filter) { + $_filters_update[$agent_filter['id_filter']] = $agent_filter['id_name']; + } + } + + $data[0] .= html_print_select( + $_filters_update, + 'overwrite_filter', + '', + '', + '', + 0, + true + ); + $data[1] = html_print_submit_button( + __('Update filter'), + 'update_filter', + false, + 'class="sub upd" onclick="save_update_filter();"', + true + ); + + $table->data[] = $data; + $table->rowclass[] = ''; + + html_print_table($table); + echo '
'; + echo html_print_submit_button( + __('Save filter'), + 'save_filter', + false, + 'class="sub upd float-right" onclick="save_new_filter();"', + true + ); + echo '
'; + } else { + include 'general/noaccess.php'; + } + + echo ''; + ?> + + 0) { + $user_groups_fl = users_get_groups( + $config['id_user'], + 'AR', + users_can_manage_group_all(), + true + ); + + $sql = sprintf( + 'SELECT id_filter, id_name + FROM tagent_filter + WHERE id_filter = %d AND id_group_filter IN (%s)', + $load_filter_id, + implode(',', array_keys($user_groups_fl)) + ); + + $loaded_filter = db_get_row_sql($sql); +} + +if ($loaded_filter['id_filter'] > 0) { + $query_filter['id_filter'] = $load_filter_id; + $filter = db_get_row_filter('tagent_filter', $query_filter, false); + + if ($filter !== false) { + $group_id = (int) $filter['group_id']; + $recursion = $filter['recursion']; + $status = $filter['status']; + $search = $filter['search']; + $os = $filter['id_os']; + $policies = json_decode($filter['policies'], true); + $search_custom = $filter['search_custom']; + $ag_custom_fields = $filter['ag_custom_fields']; + } + + + if (is_array($ag_custom_fields) === false) { + $ag_custom_fields = json_decode(io_safe_output($ag_custom_fields), true); + } + + if (is_array($policies) === false) { + $policies = json_decode(io_safe_output($policies), true); + } +} + if (check_acl($config['id_user'], 0, 'AW')) { // Prepare the tab system to the future. $tab = 'setup'; @@ -247,22 +297,47 @@ if (isset($result_delete)) { echo '
'; -echo ''; +//echo '
'; -echo ''; +html_print_table($table); -echo '
'; +//echo '
'; -echo __('Group').' '.' '.' '; +// Start Build Search Form. +// +$table = new StdClass(); +$table->width = '100%'; +$table->cellspacing = 0; +$table->cellpadding = 0; +$table->class = 'databox filters'; +$table->style[0] = 'font-weight: bold;'; +$table->style[1] = 'font-weight: bold;'; +$table->style[2] = 'font-weight: bold;'; +$table->style[3] = 'font-weight: bold;'; +$table->style[4] = 'font-weight: bold;'; + +$table->data[0][0] = __('Group'); +$table->data[0][0] .= '
'; $groups = users_get_groups(false, $access); -html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', false, false, true, '', false); +$table->data[0][0] .= html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', true, false, true, '', false); -echo '
'.' '.' '.' '.' '.' '; +//$table->data[0][1] .= '  '; -echo __('Recursion').' '.' '.' '; -html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()'); +$table->data[0][0] .= __('Recursion').' '.' '.' '; +$table->data[0][0] .= html_print_input( + [ + 'type' => 'checkbox', + 'name' => 'recursion', + 'return' => true, + 'checked' => $recursion, + 'checked' => ($recursion === true || $recursion === 'true' || $recursion === '1') ? 'checked' : false, + 'value' => 1, + ] +); -echo ''; + + +//echo ''; $fields = []; $fields[AGENT_STATUS_NORMAL] = __('Normal'); @@ -272,31 +347,125 @@ $fields[AGENT_STATUS_UNKNOWN] = __('Unknown'); $fields[AGENT_STATUS_NOT_NORMAL] = __('Not normal'); $fields[AGENT_STATUS_NOT_INIT] = __('Not init'); -echo __('Status').' '.' '.' '; -html_print_select($fields, 'status', $status, 'this.form.submit()', __('All'), AGENT_STATUS_ALL, false, false, true, '', false, 'width: 90px;'); +$table->data[0][1] = __('Status').' '.' '.' '; +$table->data[0][1] .= html_print_select($fields, 'status', $status, 'this.form.submit()', __('All'), AGENT_STATUS_ALL, true, false, true, '', false, 'width: 90px;'); -echo ''; +$table->data[0][2] = __('Search').' '.' '.' '; +$table->data[0][2] .= html_print_input_text('search', $search, '', 15, 255, true); -echo __('Search').' '.' '.' '; -html_print_input_text('search', $search, '', 15); +$table->data[1][0] = __('Operating System').' '; -echo ''; +$pre_fields = db_get_all_rows_sql( + 'select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os' +); +$fields = []; -echo __('Search in custom fields').' '.' '.' '; -html_print_input_text('search_custom', $search_custom, '', 15); +foreach ($pre_fields as $key => $value) { + $fields[$value['id_os']] = $value['name']; +} -echo ''; +$table->data[1][0] .= html_print_select($fields, 'os', $os, 'this.form.submit()', 'All', 0, true); -html_print_submit_button( +$table->data[1][1] = __('Policies').' '; + +$pre_fields = policies_get_policies(false, ['id', 'name']); +$fields = []; + +foreach ($pre_fields as $value) { + $fields[$value['id']] = $value['name']; +} + +$table->data[1][1] .= html_print_select($fields, 'policies[]', $policies, '', 'All', 0, true, true); + +$table->data[1][2] = __('Search in custom fields').' '.' '.' '; +$table->data[1][2] .= html_print_input_text('search_custom', $search_custom, '', 15, 255, true); + + +$custom_fields = db_get_all_fields_in_table('tagent_custom_fields'); +if ($custom_fields === false) { + $custom_fields = []; +} + +$div_custom_fields = '
'; +foreach ($custom_fields as $custom_field) { + $custom_field_value = ''; + if (empty($ag_custom_fields) === false) { + $custom_field_value = $ag_custom_fields[$custom_field['id_field']]; + if (empty($custom_field_value) === true) { + $custom_field_value = ''; + } + } + + $div_custom_fields .= '
'; + + $div_custom_fields .= '
'; + $div_custom_fields .= ''.$custom_field['name'].''; + $div_custom_fields .= '
'; + + $div_custom_fields .= '
'; + $div_custom_fields .= html_print_input_text( + 'ag_custom_fields['.$custom_field['id_field'].']', + $custom_field_value, + '', + 0, + 300, + true, + false, + false, + '', + 'div-input' + ); + $div_custom_fields .= '
'; +} + +$table->colspan[2][0] = 7; +$table->cellstyle[2][0] = 'padding-left: 10px;'; +$table->data[2][0] = ui_toggle( + $div_custom_fields, + __('Agent custom fields'), + '', + '', + true, + true, + '', + 'white-box-content', + 'white_table_graph' +); + + +$table->colspan[4][0] = 4; +$table->cellstyle[4][0] = 'padding-top: 0px;'; +$table->data[4][0] = html_print_button( + __('Load filter'), + 'load-filter', + false, + '', + 'class="float-left margin-right-2 sub config"', + true +); + +$table->cellstyle[4][0] .= 'padding-top: 0px;'; +$table->data[4][0] .= html_print_button( + __('Save filter'), + 'save-filter', + false, + '', + 'class="float-left margin-right-2 sub wand"', + true +); + +$table->cellstyle[4][2] = 'padding-top: 0px;'; +$table->data[4][2] = html_print_submit_button( __('Search'), 'srcbutton', '', - ['class' => 'sub search'] + ['class' => 'sub search'], + true ); -echo '
'; +''; if ($search != '') { $filter = ['string' => '%'.$search.'%']; @@ -320,6 +489,8 @@ $selectDescriptionUp = false; $selectDescriptionDown = false; $selectLastContactUp = false; $selectLastContactDown = false; +$selectLastStatusChangeUp = false; +$selectLastStatusChangeDown = false; $order = null; switch ($sortField) { @@ -479,6 +650,32 @@ switch ($sortField) { } break; + case 'last_status_change': + switch ($sort) { + case 'up': + $selectLastStatusChangeUp = $selected; + $order = [ + 'field' => 'last_status_change', + 'field2' => 'alias', + 'order' => 'ASC', + ]; + break; + + case 'down': + $selectLastStatusChangeDown = $selected; + $order = [ + 'field' => 'last_status_change', + 'field2' => 'alias', + 'order' => 'DESC', + ]; + break; + + default: + // Default. + break; + } + break; + case 'description': switch ($sort) { case 'up': @@ -518,6 +715,8 @@ switch ($sortField) { $selectDescriptionDown = false; $selectLastContactUp = false; $selectLastContactDown = false; + $selectLastStatusChangeUp = false; + $selectLastStatusChangeDown = false; $order = [ 'field' => 'alias', 'field2' => 'alias', @@ -577,6 +776,24 @@ if (!empty($search_custom)) { $search_sql_custom = ''; } +// Filter by agent custom fields. +$sql_conditions_custom_fields = ''; +if (empty($ag_custom_fields) === false) { + $cf_filter = []; + foreach ($ag_custom_fields as $field_id => $value) { + if (empty($value) === false) { + $cf_filter[] = '(tagent_custom_data.id_field = '.$field_id.' AND tagent_custom_data.description LIKE \'%'.$value.'%\')'; + } + } + + if (empty($cf_filter) === false) { + $sql_conditions_custom_fields = ' AND tagente.id_agente IN ( + SELECT tagent_custom_data.id_agent + FROM tagent_custom_data + WHERE '.implode(' AND ', $cf_filter).')'; + } +} + // Show only selected groups. if ($group_id > 0) { $groups = [$group_id]; @@ -589,23 +806,41 @@ if ($group_id > 0) { $groups = array_keys($user_groups); } +$all_policies = in_array(0, $policies ?? []); + +$id_os_sql = ''; +$policies_sql = ''; + +if ($os > 0) { + $id_os_sql = ' AND id_os = '.$os; +} + +if ($all_policies === false && is_array($policies) && count($policies) > 0) { + $policies_sql = ' AND tpolicy_agents.id_policy IN ('.implode(',', $policies).')'; +} if ($strict_user) { $count_filter = [ // 'order' => 'tagente.nombre ASC', - 'order' => 'tagente.nombre ASC', - 'disabled' => 0, - 'status' => $status, - 'search' => $search, + 'order' => 'tagente.nombre ASC', + 'disabled' => 0, + 'status' => $status, + 'search' => $search, + 'id_os' => $id_os_sql, + 'policies' => $policies_sql, + 'other_condition' => $sql_conditions_custom_fields, ]; $filter = [ // 'order' => 'tagente.nombre ASC', - 'order' => 'tagente.nombre ASC', - 'disabled' => 0, - 'status' => $status, - 'search' => $search, - 'offset' => (int) get_parameter('offset'), - 'limit' => (int) $config['block_size'], + 'order' => 'tagente.nombre ASC', + 'disabled' => 0, + 'status' => $status, + 'search' => $search, + 'offset' => (int) get_parameter('offset'), + 'limit' => (int) $config['block_size'], + 'id_os' => $id_os_sql, + 'policies' => $policies_sql, + 'other_condition' => $sql_conditions_custom_fields, ]; if ($group_id > 0) { @@ -644,28 +879,48 @@ if ($strict_user) { $agents = tags_get_all_user_agents(false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true); } else { + $count_filter = [ + 'disabled' => 0, + 'id_grupo' => $groups, + 'search' => $search_sql, + 'search_custom' => $search_sql_custom, + 'status' => $status, + 'id_os' => $id_os_sql, + 'policies' => $policies_sql, + 'other_condition' => $sql_conditions_custom_fields, + ]; + + $filter = [ + 'order' => 'nombre ASC', + 'id_grupo' => $groups, + 'disabled' => 0, + 'status' => $status, + 'search_custom' => $search_sql_custom, + 'search' => $search_sql, + 'offset' => (int) get_parameter('offset'), + 'limit' => (int) $config['block_size'], + 'id_os' => $id_os_sql, + 'policies' => $policies_sql, + 'other_condition' => $sql_conditions_custom_fields, + ]; + $total_agents = agents_count_agents_filter( - [ - 'disabled' => 0, - 'id_grupo' => $groups, - 'search' => $search_sql, - 'search_custom' => $search_sql_custom, - 'status' => $status, - ], + $count_filter, $access ); + $query_order = $order; + + if ($order['field'] === 'last_status_change') { + $query_order = [ + 'field' => 'alias', + 'field2' => 'alias', + 'order' => 'ASC', + ]; + } + $agents = agents_get_agents( - [ - 'order' => 'nombre '.' ASC', - 'id_grupo' => $groups, - 'disabled' => 0, - 'status' => $status, - 'search_custom' => $search_sql_custom, - 'search' => $search_sql, - 'offset' => (int) get_parameter('offset'), - 'limit' => (int) $config['block_size'], - ], + $filter, [ 'id_agente', 'id_grupo', @@ -688,7 +943,7 @@ if ($strict_user) { 'agent_version', ], $access, - $order + $query_order ); } @@ -720,7 +975,8 @@ $url_up_group = 'index.php?sec=view&sec2=operation/agentes/estado_agente& $url_down_group = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=group&sort=down'; $url_up_last = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=last_contact&sort=up'; $url_down_last = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=last_contact&sort=down'; - +$url_up_last_status_change = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=last_status_change&sort=up'; +$url_down_last_status_change = 'index.php?sec=view&sec2=operation/agentes/estado_agente&refr='.$refr.'&offset='.$offset.'&group_id='.$group_id.'&recursion='.$recursion.'&search='.$search.'&status='.$status.'&sort_field=last_status_change&sort=down'; // Prepare pagination. ui_pagination( @@ -740,16 +996,16 @@ $table->head[0] = __('Agent').ui_get_sorting_arrows($url_up_agente, $url_down_ag $table->size[0] = '12%'; $table->head[1] = __('Description').ui_get_sorting_arrows($url_up_description, $url_down_description, $selectDescriptionUp, $selectDescriptionDown); -$table->size[1] = '16%'; +$table->size[1] = '14%'; -$table->head[10] = __('Remote').ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown); -$table->size[10] = '9%'; +$table->head[12] = __('Remote').ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown); +$table->size[12] = '9%'; $table->head[2] = __('OS').ui_get_sorting_arrows($url_up_os, $url_down_os, $selectOsUp, $selectOsDown); $table->size[2] = '8%'; $table->head[3] = __('Interval').ui_get_sorting_arrows($url_up_interval, $url_down_interval, $selectIntervalUp, $selectIntervalDown); -$table->size[3] = '10%'; +$table->size[3] = '8%'; $table->head[4] = __('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown); $table->size[4] = '8%'; @@ -767,7 +1023,13 @@ $table->head[8] = __('Alerts'); $table->size[8] = '4%'; $table->head[9] = __('Last contact').ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown); -$table->size[9] = '15%'; +$table->size[9] = '8%'; + +$table->head[10] = __('Last status change').ui_get_sorting_arrows($url_up_last_status_change, $url_down_last_status_change, $selectLastStatusChangeUp, $selectLastStatusChangeDown); +$table->size[10] = '10%'; + +$table->head[11] = __('Agent events'); +$table->size[11] = '4%'; $table->align = []; @@ -779,6 +1041,8 @@ $table->align[6] = 'left'; $table->align[7] = 'left'; $table->align[8] = 'left'; $table->align[9] = 'left'; +$table->align[10] = 'left'; +$table->align[11] = 'left'; $table->style = []; @@ -881,12 +1145,12 @@ foreach ($agents as $agent) { $data[1] = ''.ui_print_truncate_text($agent['description'], 'description', false, true, true, '[…]').''; - $data[10] = ''; + $data[12] = ''; if (enterprise_installed()) { enterprise_include_once('include/functions_config_agents.php'); if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) { - $data[10] = ''.html_print_image( + $data[12] = ''.html_print_image( 'images/application_edit.png', true, [ @@ -930,6 +1194,27 @@ foreach ($agents as $agent) { $data[9] = agents_get_interval_status($agent); + $last_status_change_agent = agents_get_last_status_change($agent['id_agente']); + $time_elapsed = !empty($last_status_change_agent) ? human_time_comparation($last_status_change_agent) : ''.__('N/A').''; + $data[10] = $time_elapsed; + + $agent_event_filter = [ + 'id_agent' => $agent['id_agente'], + 'event_view_hr' => 48, + 'status' => -1, + ]; + + $fb64 = base64_encode(json_encode($agent_event_filter)); + $data[11] = ''.html_print_image( + 'images/lightning.png', + true, + [ + 'align' => 'middle', + 'title' => __('Agent events'), + 'class' => 'invert_filter', + ] + ).''; + // This old code was returning "never" on agents without modules, BAD !! // And does not print outdated agents in red. WRONG !!!! // $data[7] = ui_print_timestamp ($agent_info["last_contact"], true); @@ -937,6 +1222,20 @@ foreach ($agents as $agent) { } if (!empty($table->data)) { + if ($order['field'] === 'last_status_change') { + $order_direction = $order['order']; + usort( + $table->data, + function ($a, $b) use ($order_direction) { + if ($order_direction === 'ASC') { + return strtotime($a[10]) > strtotime($b[10]); + } else { + return strtotime($a[10]) < strtotime($b[10]); + } + } + ); + } + html_print_table($table); ui_pagination( @@ -975,10 +1274,69 @@ if (!empty($table->data)) { echo ''; echo ''; } + +// Load filter div for dialog. +echo ''; +echo ''; + ?> + 'StarTrek emergency simulation', ]; +$eventsounds = mysql_db_get_row_sql('SELECT * FROM tevent_sound WHERE active = 1'); +foreach ($eventsounds as $key => $row) { + $sounds[$row['sound']] = $row['name']; +} + $inputs[] = [ 'label' => \__('Sounds'), 'class' => 'flex-row', diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index bb0802a567..fd681495be 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -477,6 +477,10 @@ if ($access_console_node === true) { } Date: Mon, 30 Jan 2023 08:27:03 +0100 Subject: [PATCH 03/17] #9819 change setcion menu configuration sound --- pandora_console/godmode/menu.php | 4 ++++ pandora_console/operation/menu.php | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index d98eb9d3c6..9dc13b6abb 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -435,6 +435,10 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($ } } + $sub['godmode/events/configuration_sounds']['text'] = __('Configuration Sounds'); + $sub['godmode/events/configuration_sounds']['id'] = 'Configuration Sounds'; + $sub['godmode/events/configuration_sounds']['pages'] = ['godmode/events/configuration_sounds']; + $menu_godmode['gextensions']['sub'] = $sub; } diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index fd681495be..c777e1d97b 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -477,10 +477,6 @@ if ($access_console_node === true) { } Date: Tue, 31 Jan 2023 08:35:47 +0100 Subject: [PATCH 04/17] #9819 Change labels Accoustic console --- pandora_console/godmode/menu.php | 4 ++-- pandora_console/include/class/EventSound.class.php | 6 +++--- pandora_console/operation/events/events.php | 6 +++--- pandora_console/operation/events/sound_events.php | 4 ++-- pandora_console/operation/menu.php | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 9dc13b6abb..d4f903290e 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -435,8 +435,8 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($ } } - $sub['godmode/events/configuration_sounds']['text'] = __('Configuration Sounds'); - $sub['godmode/events/configuration_sounds']['id'] = 'Configuration Sounds'; + $sub['godmode/events/configuration_sounds']['text'] = __('Accoustic console setup'); + $sub['godmode/events/configuration_sounds']['id'] = 'Accoustic console setup'; $sub['godmode/events/configuration_sounds']['pages'] = ['godmode/events/configuration_sounds']; $menu_godmode['gextensions']['sub'] = $sub; diff --git a/pandora_console/include/class/EventSound.class.php b/pandora_console/include/class/EventSound.class.php index 93f42ec7c4..b943e9cce1 100644 --- a/pandora_console/include/class/EventSound.class.php +++ b/pandora_console/include/class/EventSound.class.php @@ -209,7 +209,7 @@ class EventSound extends HTML $titleHeader = __('Add new sound'); } else { $helpHeader = 'servers_ha_clusters_tab'; - $titleHeader = __('Events sound list'); + $titleHeader = __('Accoustic console sound list'); } // Header. @@ -223,11 +223,11 @@ class EventSound extends HTML [ [ 'link' => '', - 'label' => __('Events'), + 'label' => __('Admin tools'), ], [ 'link' => '', - 'label' => __('Configuration Sounds'), + 'label' => __('Accoustic console setup'), ], ] ); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 648581a3a6..eb885bf479 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1473,13 +1473,13 @@ if ($pure) { ] ).''; - // Sound events. + // Accoustic console. $sound_event['active'] = false; $sound_event['text'] = ''.html_print_image( 'images/sound.png', true, [ - 'title' => __('Sound events'), + 'title' => __('Accoustic console'), 'class' => 'invert_filter', ] ).''; @@ -1529,7 +1529,7 @@ if ($pure) { switch ($section) { case 'sound_event': $onheader['sound_event']['active'] = true; - $section_string = __('Sound events'); + $section_string = __('Accoustic console'); break; case 'history': diff --git a/pandora_console/operation/events/sound_events.php b/pandora_console/operation/events/sound_events.php index 2f2b11e065..6ce7a31c3a 100644 --- a/pandora_console/operation/events/sound_events.php +++ b/pandora_console/operation/events/sound_events.php @@ -60,7 +60,7 @@ ob_start(); echo ''; echo ''; -echo ''.__('Sound Events').''; +echo ''.__('Accoustic console').''; ui_require_css_file('wizard'); ui_require_css_file('discovery'); ?> @@ -161,7 +161,7 @@ if ($config['style'] === 'pandora_black' && !is_metaconsole()) { echo ''; echo ""; -echo "

".__('Sound console').'

'; +echo "

".__('Accoustic console').'

'; // Connection lost alert. ui_require_css_file('register', 'include/styles/', true); diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index c777e1d97b..eed84a4d48 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -432,11 +432,11 @@ if ($access_console_node === true) { $sub['operation/events/events_rss.php?user='.$config['id_user'].'&hashup='.$hashup.'&fb64='.$fb64]['type'] = 'direct'; } - // Sound Events. + // Accoustic console. $data_sound = base64_encode( json_encode( [ - 'title' => __('Sound Console'), + 'title' => __('Accoustic console'), 'start' => __('Start'), 'stop' => __('Stop'), 'noAlert' => __('No alert'), @@ -449,8 +449,8 @@ if ($access_console_node === true) { ); $javascript = 'javascript: openSoundEventModal(`'.$data_sound.'`);'; - $sub[$javascript]['text'] = __('Sound Events'); - $sub[$javascript]['id'] = 'Sound Events Modal'; + $sub[$javascript]['text'] = __('Accoustic console'); + $sub[$javascript]['id'] = 'Accoustic console Modal'; $sub[$javascript]['type'] = 'direct'; echo ''; From a7a0886e6ce7121299492edadd84f15d50bb5aea Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 6 Feb 2023 13:24:37 +0100 Subject: [PATCH 05/17] policy maintenance mode --- pandora_console/include/functions.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 7d4fee1d21..790df73e8a 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -6397,3 +6397,23 @@ function getBearerToken() return false; } + + +/** + * Check whether an instance of pandora_db is running. + * + * @return boolean Result. + */ +function is_pandora_db_running() +{ + $is_free_lock = mysql_db_process_sql( + 'SELECT IS_FREE_LOCK("pandora_pandora_db") AS "value"', + 'affected_rows', + '', + false + ); + + $is_free_lock = (bool) $is_free_lock[0]['value']; + + return !$is_free_lock; +} \ No newline at end of file From de3a74ae1ac61deadcfaaac4fe29ecb0dba14f26 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 6 Feb 2023 13:27:25 +0100 Subject: [PATCH 06/17] policy maintenance mode --- pandora_console/include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 790df73e8a..75e8e7ee58 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -6416,4 +6416,4 @@ function is_pandora_db_running() $is_free_lock = (bool) $is_free_lock[0]['value']; return !$is_free_lock; -} \ No newline at end of file +} From a1ccfc99eca99efe7b28a206adce400a3b3bb4af Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 6 Feb 2023 13:41:31 +0100 Subject: [PATCH 07/17] policy maintenance mode --- pandora_console/include/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 75e8e7ee58..a4713b6f67 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -6406,8 +6406,11 @@ function getBearerToken() */ function is_pandora_db_running() { + // Get current DB name: useful for metaconsole connection to node. + $db_name = db_get_sql('SELECT DATABASE()'); + $is_free_lock = mysql_db_process_sql( - 'SELECT IS_FREE_LOCK("pandora_pandora_db") AS "value"', + 'SELECT IS_FREE_LOCK("'.$db_name.'_pandora_db") AS "value"', 'affected_rows', '', false From 6d85b912e2c5f635a390ba4746a5deebe1b0f2f1 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 6 Feb 2023 16:34:40 +0100 Subject: [PATCH 08/17] 9962-Omnishell in agent view --- pandora_console/images/omnishell.png | Bin 0 -> 606 bytes pandora_console/include/functions_html.php | 21 ++++++++++++++++++ pandora_console/include/functions_ui.php | 18 +++++++++++++++ .../operation/agentes/ver_agente.php | 21 ++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 pandora_console/images/omnishell.png diff --git a/pandora_console/images/omnishell.png b/pandora_console/images/omnishell.png new file mode 100644 index 0000000000000000000000000000000000000000..02c8f0e071e936d8b8fe8d83261e3d25a867b588 GIT binary patch literal 606 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc#=yY%t50_}ki(Mh=?zc(M!jHiZ6P)IEGjV&JEe^ z#q20jYPQ>R<$?vRQ4vcvbw+q9oOct>IU4m@w63XsLBi^#3nDlSIh)LqxYp|UDsYsA zRlcn{H$$@Q@tT_!8>-*WseX26=1ybfPe1>BE3nuz({Z!gx!G?%v`>5DpJF80-`85E zCwsm0`^y&s)~g~*S_Jx-QsO%`1X{MGXf<5>yeE~@Op5m*zsH6EjWhq5*qaY7mpAb{ z=^wDq&+gRMHB67ggm<=7?cLY8a``dOH`z%xa{g(XBgIc=CY|>>bAZ2Yrb}Z&cXq1! zn#LNDPKoZLWotaM&K%-;ZP~Uobcc$XP-p1z!e=5GnZ|?soj0C%zq!e{?UiazhH=Bx`-_bDH@tpRyg2jbm4)3^8tcBu)E|@nuV?he zZB#ZBaqcwgp3GH#az!7k0 zRZ*LF8HeNg2%TlW{?@%X%d=vk^7&@@C(W(K0ShJK`dvF>e>|T2r$NCbtf1ufj{MC6 zdk>%9ypW~hwBTg@m4`BlcgAq`Kizuh(6lv=F5fy=5x7kB!{=C$qVvy+n>6SD`D|0R j;0MdX+; literal 0 HcmV?d00001 diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 31c2e5214a..44a8289b0d 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -84,6 +84,27 @@ function html_debug_print($var, $file='', $oneline=false) } +/** + * Console log. + */ +function jslog($var) +{ + $more_info = ''; + if (is_string($var)) { + $more_info = 'size: '.strlen($var); + } else if (is_bool($var)) { + $more_info = 'val: '.($var ? 'true' : 'false'); + } else if (is_null($var)) { + $more_info = 'is null'; + } else if (is_array($var)) { + $more_info = count($var); + } + + echo ''."\n"; + echo ''; +} + + // Alias for "html_debug_print" function html_debug($var, $file='', $oneline=false) { diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 6a658997f6..ce17086f02 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -7084,3 +7084,21 @@ function ui_get_inventory_module_add_form( } +function ui_print_status_div($status) +{ + switch ((int) $status) { + case 0: + $return = '
 
'; + break; + + case 1: + $return = '
 
'; + break; + + default: + $return = '
 
'; + break; + } + + return $return; +} \ No newline at end of file diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index ece6ec2d6c..b5aa181e8b 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -37,6 +37,7 @@ require_once $config['homedir'].'/include/functions_groups.php'; require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_users.php'; enterprise_include_once('include/functions_metaconsole.php'); +enterprise_include_once('include/functions_omnishell.php'); ui_require_javascript_file('openlayers.pandora'); ui_require_css_file('agent_view'); @@ -1485,6 +1486,17 @@ if ($policyTab == -1) { $policyTab = ''; } + +// Omnishell. +$tasks = count_tasks_agent($id_agente); + +if ($tasks === true) { + $omnishellTab = enterprise_hook('omnishell_tab'); + if ($omnishellTab == -1) { + $omnishellTab = ''; + } +} + // WUX Console. $modules_wux = enterprise_hook('get_wux_modules', [$id_agente]); if ($modules_wux) { @@ -1747,6 +1759,7 @@ $onheader = [ 'ncm_view' => ($ncm_tab ?? null), 'external_tools' => ($external_tools ?? null), 'incident' => ($incidenttab ?? null), + 'omnishell' => ($omnishellTab ?? null), ]; @@ -1871,6 +1884,10 @@ switch ($tab) { $tab_name = 'Policies'; break; + case 'omnishell': + $tab_name = 'Omnishell'; + break; + case 'ux_console_tab': $tab_name = 'UX Console'; break; @@ -2009,6 +2026,10 @@ switch ($tab) { enterprise_include('operation/agentes/policy_view.php'); break; + case 'omnishell': + enterprise_include('operation/agentes/omnishell_view.php'); + break; + case 'ux_console_tab': enterprise_include('operation/agentes/ux_console_view.php'); break; From 8b9803c1c558e8f08bd1d733bf8381fbd7fa5523 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 8 Feb 2023 17:04:24 +0100 Subject: [PATCH 09/17] fixed tinyMCE converting URLs to relative ones --- pandora_console/include/rest-api/models/VisualConsole/View.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/include/rest-api/models/VisualConsole/View.php b/pandora_console/include/rest-api/models/VisualConsole/View.php index cd1e25fd49..e8305df830 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/View.php +++ b/pandora_console/include/rest-api/models/VisualConsole/View.php @@ -144,6 +144,8 @@ class View extends \HTML tinyMCE.init({ selector: "#textarea_label", theme: "advanced", + convert_urls:false, + relative_urls:false, content_css: "'.ui_get_full_url(false, false, false, false).'include/styles/pandora.css", theme_advanced_font_sizes: "4pt=.visual_font_size_4pt, " + From 2a9494b48d15082942403030ec19e6938ff56ab8 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 22 Feb 2023 10:10:59 +0100 Subject: [PATCH 10/17] fix conflicts --- pandora_console/extras/mr/62.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pandora_console/extras/mr/62.sql diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql new file mode 100644 index 0000000000..794d0a4c94 --- /dev/null +++ b/pandora_console/extras/mr/62.sql @@ -0,0 +1,18 @@ +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `tagent_filter` ( + `id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_name` VARCHAR(600) NOT NULL, + `id_group_filter` INT NOT NULL DEFAULT 0, + `group_id` INT NOT NULL DEFAULT 0, + `recursion` TEXT, + `status` INT NOT NULL DEFAULT -1, + `search` TEXT, + `id_os` INT NOT NULL DEFAULT 0, + `policies` TEXT, + `search_custom` TEXT, + `ag_custom_fields` TEXT, + PRIMARY KEY (`id_filter`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +COMMIT; From dfa63378ffab0db2fa4991895df3ac1d3f0228ef Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 23 Feb 2023 11:19:17 +0100 Subject: [PATCH 11/17] Unified event timestamp and utimestamp --- pandora_console/include/functions_events.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index ca35739891..5f2e66bcae 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2412,14 +2412,17 @@ function events_create_event( $source = get_product_name(); } + // Get Timestamp. + $timestamp = time(); + $values = [ 'id_agente' => $id_agent, 'id_usuario' => $id_user, 'id_grupo' => $id_group, 'estado' => $status, - 'timestamp' => date('Y-m-d H:i:s'), + 'timestamp' => date('Y-m-d H:i:s', $timestamp), 'evento' => $event, - 'utimestamp' => time(), + 'utimestamp' => $timestamp, 'event_type' => $event_type, 'id_agentmodule' => $id_agent_module, 'id_alert_am' => $id_aam, From a1f172e713a86c9d074c0bbe80122ed70ee08528 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Tue, 28 Feb 2023 17:06:31 +0100 Subject: [PATCH 12/17] several fixes --- pandora_console/include/ajax/agent.php | 195 +++++++++++++++--- pandora_console/include/ajax/module.php | 123 +++++++++-- .../operation/agentes/estado_agente.php | 10 +- .../operation/agentes/status_monitor.php | 6 +- 4 files changed, 289 insertions(+), 45 deletions(-) diff --git a/pandora_console/include/ajax/agent.php b/pandora_console/include/ajax/agent.php index 5ba3f90799..f0884dea7f 100644 --- a/pandora_console/include/ajax/agent.php +++ b/pandora_console/include/ajax/agent.php @@ -38,6 +38,7 @@ $save_filter_modal = get_parameter('save_filter_modal', 0); $get_agent_filters = get_parameter('get_agent_filters', 0); $save_agent_filter = get_parameter('save_agent_filter', 0); $update_agent_filter = get_parameter('update_agent_filter', 0); +$delete_agent_filter = get_parameter('delete_agent_filter', 0); if (https_is_running()) { header('Content-type: application/json'); @@ -365,6 +366,7 @@ if ($save_agent_filter) { $values['policies'] = json_encode(get_parameter('policies')); $values['search_custom'] = get_parameter('search_custom'); $values['ag_custom_fields'] = get_parameter('ag_custom_fields'); + $values['id_group_filter'] = get_parameter('id_group_filter'); $exists = (bool) db_get_value_filter( 'id_filter', @@ -411,8 +413,40 @@ if ($update_agent_filter) { } } +if ($delete_agent_filter) { + $id = get_parameter('id'); + + $user_groups = users_get_groups( + $config['id_user'], + 'AW', + users_can_manage_group_all('AW'), + true + ); + + $sql = 'DELETE + FROM tagent_filter + WHERE id_filter = '.$id.' AND id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; + + $agent_filters = db_process_sql($sql); + + if ($agent_filters === false) { + echo 'error'; + } else { + echo 'ok'; + } +} + if ($get_agent_filters) { - $sql = 'SELECT id_filter, id_name FROM tagent_filter'; + $user_groups = users_get_groups( + $config['id_user'], + 'AR', + users_can_manage_group_all('AR'), + true + ); + + $sql = 'SELECT id_filter, id_name + FROM tagent_filter + WHERE id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; $agent_filters = db_get_all_rows_sql($sql); @@ -431,7 +465,7 @@ if ((int) $load_filter_modal === 1) { $user_groups = users_get_groups( $config['id_user'], 'AR', - users_can_manage_group_all(), + users_can_manage_group_all('AR'), true ); @@ -439,11 +473,11 @@ if ((int) $load_filter_modal === 1) { FROM tagent_filter WHERE id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; - $event_filters = db_get_all_rows_sql($sql); + $agent_filters = db_get_all_rows_sql($sql); $filters = []; - foreach ($event_filters as $event_filter) { - $filters[$event_filter['id_filter']] = $event_filter['id_name']; + foreach ($agent_filters as $agent_filter) { + $filters[$agent_filter['id_filter']] = $agent_filter['id_name']; } echo '
'; @@ -560,7 +594,7 @@ if ($save_filter_modal) { '', false, true - ).__('Update filter').''; + ).__('Update/delete filter').''; $table->data[] = $data; $table->rowclass[] = ''; @@ -578,8 +612,8 @@ if ($save_filter_modal) { $user_groups_array = users_get_groups_for_select( $config['id_user'], - 'EW', - users_can_manage_group_all(), + 'AW', + users_can_manage_group_all('AW'), true ); @@ -607,9 +641,19 @@ if ($save_filter_modal) { $data = []; $table->rowid[3] = 'update_filter_row1'; - $data[0] = __('Overwrite filter').$jump; + $data[0] = __('Filter').$jump; + + $user_groups = users_get_groups( + $config['id_user'], + 'AW', + users_can_manage_group_all('AW'), + true + ); + + $sql = 'SELECT id_filter, id_name + FROM tagent_filter + WHERE id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; - $sql = 'SELECT id_filter, id_name FROM tagent_filter'; $agent_filters = db_get_all_rows_sql($sql); $_filters_update = []; @@ -629,21 +673,30 @@ if ($save_filter_modal) { 0, true ); - $data[1] = html_print_submit_button( - __('Update filter'), - 'update_filter', - false, - 'class="sub upd" onclick="save_update_filter();"', - true - ); $table->data[] = $data; $table->rowclass[] = ''; html_print_table($table); - echo '
'; + echo '

'; echo html_print_submit_button( - __('Save filter'), + __('Update filter'), + 'update_filter', + false, + 'class="sub upd" onclick="save_update_filter();"', + true + ); + echo html_print_submit_button( + __('Delete filter'), + 'delete_filter', + false, + 'class="sub delete float-right" onclick="save_delete_filter();"', + true + ); + echo '
'; + echo '

'; + echo html_print_submit_button( + __('Save current filter'), 'save_filter', false, 'class="sub upd float-right" onclick="save_new_filter();"', @@ -662,6 +715,7 @@ function show_save_filter() { $('#save_filter_row1').show(); $('#save_filter_row2').show(); $('#update_filter_row1').hide(); + $('#update_delete_row').hide(); // Filter save mode selector $("[name='filter_mode']").click(function() { if ($(this).val() == 'new') { @@ -669,12 +723,14 @@ function show_save_filter() { $('#save_filter_row2').show(); $('#submit-save_filter').show(); $('#update_filter_row1').hide(); + $('#update_delete_row').hide(); } else { $('#save_filter_row1').hide(); $('#save_filter_row2').hide(); $('#update_filter_row1').show(); $('#submit-save_filter').hide(); + $('#update_delete_row').show(); } }); $("#save-filter-select").dialog({ @@ -726,7 +782,9 @@ function save_new_filter() { "policies" : $("#policies").val(), "search_custom" : $("#text-search_custom").val(), "ag_custom_fields": JSON.stringify(ag_custom_fields), + "id_group_filter": $("#id_group_filter_dialog").val(), }, + function (data) { $("#info_box").hide(); if (data == 'error') { @@ -759,6 +817,27 @@ function save_new_filter() { }).show(); } + // First remove all options of filters select. + $('#filter_id').find('option').remove().end(); + + // Add 'none' option. + $('#filter_id').append ($('').html ( ).attr ("value", 0)); + + // Reload filters select. + jQuery.post ("", + { + "page" : "include/ajax/agent", + "get_agent_filters" : 1 + }, + function (data) { + jQuery.each (data, function (i, val) { + s = js_html_entity_decode(val); + $('#filter_id').append($('').html (s).attr("value", i)); + }); + }, + "json" + ); + // Close dialog. $("#save-filter-select").dialog('close'); } @@ -793,10 +872,10 @@ function save_update_filter() { "group_id" : $("#group_id").val(), "recursion" : $("#checkbox-recursion").is(':checked'), "status" : $("#status").val(), - "search" : $("#search").val(), + "search" : $("#text-search").val(), "id_os" : $("#os").val(), "policies" : $("#policies").val(), - "search_custom" : $("#search_custom").val(), + "search_custom" : $("#text-search_custom").val(), "ag_custom_fields": JSON.stringify(ag_custom_fields), }, function (data) { @@ -821,11 +900,13 @@ function save_update_filter() { } }); - // First remove all options of filters select + // First remove all options of filters select. $('#filter_id').find('option').remove().end(); - // Add 'none' option the first - $('#filter_id').append ($('').html ( ).attr ("value", 0)); - // Reload filters select + + // Add 'none' option. + $('#filter_id').append ($('').html ( ).attr ("value", 0)); + + // Reload filters select. jQuery.post ("", { "page" : "include/ajax/agent", @@ -853,7 +934,69 @@ function save_update_filter() { $('#filter_loaded_span').html($('#filter_loaded_text').html() + ': ' + name_filter_update); return false; } - + +function save_delete_filter() { + var id_filter_update = $("#overwrite_filter").val(); + + jQuery.post ("", + { + "page" : "include/ajax/agent", + "delete_agent_filter" : 1, + "id" : $("#overwrite_filter").val(), + }, + function (data) { + $(".info_box").hide(); + if (data == 'ok') { + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "success_update_filter") { + return true; + } + else + return false; + }).show(); + } + else { + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "error_create_filter") { + return true; + } + else + return false; + }).show(); + } + }); + + // First remove all options of filters select. + $('#filter_id').find('option').remove().end(); + + // Add 'none' option. + $('#filter_id').append ($('').html ( ).attr ("value", 0)); + + // Reload filters select. + jQuery.post ("", + { + "page" : "include/ajax/agent", + "get_agent_filters" : 1 + }, + function (data) { + jQuery.each (data, function (i, val) { + s = js_html_entity_decode(val); + if (i == id_filter_update) { + $('#filter_id').append ($('').html (s).attr ("value", i)); + } + else { + $('#filter_id').append ($('').html (s).attr ("value", i)); + } + }); + }, + "json" + ); + + // Close dialog + $('.ui-dialog-titlebar-close').trigger('click'); + + return false; +} $(document).ready(function() { show_save_filter(); diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 3857c5d6b2..ec87996805 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -73,6 +73,7 @@ if (check_login()) { $get_monitor_filters = get_parameter('get_monitor_filters', 0); $save_monitor_filter = get_parameter('save_monitor_filter', 0); $update_monitor_filter = get_parameter('update_monitor_filter', 0); + $delete_monitor_filter = get_parameter('delete_monitor_filter', 0); if ($get_agent_modules_json_by_name === true) { $agent_name = get_parameter('agent_name'); @@ -1740,6 +1741,29 @@ if (check_login()) { } } + if ($delete_monitor_filter) { + $id = get_parameter('id'); + + $user_groups = users_get_groups( + $config['id_user'], + 'AW', + users_can_manage_group_all('AW'), + true + ); + + $sql = 'DELETE + FROM tmonitor_filter + WHERE id_filter = '.$id.' AND id_group_filter IN ('.implode(',', array_keys($user_groups)).')'; + + $monitor_filters = db_process_sql($sql); + + if ($monitor_filters === false) { + echo 'error'; + } else { + echo 'ok'; + } + } + if ($get_monitor_filters) { $sql = 'SELECT id_filter, id_name FROM tmonitor_filter'; @@ -1760,7 +1784,7 @@ if (check_login()) { $user_groups = users_get_groups( $config['id_user'], 'AR', - users_can_manage_group_all(), + users_can_manage_group_all('AR'), true ); @@ -1886,7 +1910,7 @@ if (check_login()) { '', false, true - ).__('Update filter').''; + ).__('Update/delete filter').''; $table->data[] = $data; $table->rowclass[] = ''; @@ -1904,7 +1928,7 @@ if (check_login()) { $user_groups_array = users_get_groups_for_select( $config['id_user'], 'AW', - users_can_manage_group_all(), + users_can_manage_group_all('AW'), true ); @@ -1954,21 +1978,30 @@ if (check_login()) { 0, true ); - $data[1] = html_print_submit_button( - __('Update filter'), - 'update_filter', - false, - 'class="sub upd" onclick="save_update_filter();"', - true - ); $table->data[] = $data; $table->rowclass[] = ''; html_print_table($table); - echo '
'; + echo '

'; echo html_print_submit_button( - __('Save filter'), + __('Update filter'), + 'update_filter', + false, + 'class="sub upd" onclick="save_update_filter();"', + true + ); + echo html_print_submit_button( + __('Delete filter'), + 'delete_filter', + false, + 'class="sub delete float-right" onclick="save_delete_filter();"', + true + ); + echo '
'; + echo '

'; + echo html_print_submit_button( + __('Save current filter'), 'save_filter', false, 'class="sub upd float-right" onclick="save_new_filter();"', @@ -1986,6 +2019,7 @@ if (check_login()) { $('#save_filter_row1').show(); $('#save_filter_row2').show(); $('#update_filter_row1').hide(); + $('#update_delete_row').hide(); // Filter save mode selector $("[name='filter_mode']").click(function() { if ($(this).val() == 'new') { @@ -1993,12 +2027,14 @@ if (check_login()) { $('#save_filter_row2').show(); $('#submit-save_filter').show(); $('#update_filter_row1').hide(); + $('#update_delete_row').hide(); } else { $('#save_filter_row1').hide(); $('#save_filter_row2').hide(); $('#update_filter_row1').show(); $('#submit-save_filter').hide(); + $('#update_delete_row').show(); } }); $("#save-filter-select").dialog({ @@ -2189,6 +2225,69 @@ if (check_login()) { $('#filter_loaded_span').html($('#filter_loaded_text').html() + ': ' + name_filter_update); return false; } + + function save_delete_filter() { + var id_filter_update = $("#overwrite_filter").val(); + + jQuery.post ("", + { + "page" : "include/ajax/module", + "delete_monitor_filter" : 1, + "id" : $("#overwrite_filter").val(), + }, + function (data) { + $(".info_box").hide(); + if (data == 'ok') { + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "success_update_filter") { + return true; + } + else + return false; + }).show(); + } + else { + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "error_create_filter") { + return true; + } + else + return false; + }).show(); + } + }); + + // First remove all options of filters select. + $('#filter_id').find('option').remove().end(); + + // Add 'none' option. + $('#filter_id').append ($('').html ( ).attr ("value", 0)); + + // Reload filters select. + jQuery.post ("", + { + "page" : "include/ajax/module", + "get_monitor_filters" : 1 + }, + function (data) { + jQuery.each (data, function (i, val) { + s = js_html_entity_decode(val); + if (i == id_filter_update) { + $('#filter_id').append ($('').html (s).attr ("value", i)); + } + else { + $('#filter_id').append ($('').html (s).attr ("value", i)); + } + }); + }, + "json" + ); + + // Close dialog + $('.ui-dialog-titlebar-close').trigger('click'); + + return false; + } $(document).ready(function() { show_save_filter(); diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 5314c36df7..8e49877037 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -319,11 +319,11 @@ $table->data[0][0] .= '
Date: Wed, 1 Mar 2023 14:19:35 +0100 Subject: [PATCH 13/17] error fix --- pandora_console/operation/agentes/estado_generalagente.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index a0bd1bca8f..dca542b800 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -644,6 +644,7 @@ $last_incident = db_get_row_sql( ); if ($last_incident != false) { + $table_incident = new stdClass(); $table_incident->id = 'agent_incident_main'; $table_incident->width = '100%'; $table_incident->cellspacing = 0; From 296ec44ef40c38bf156d3d6a543165bc3cf7afed Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 1 Mar 2023 16:10:18 +0100 Subject: [PATCH 14/17] minor fix --- pandora_console/operation/agentes/estado_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 8e49877037..c2e797f3fd 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -199,7 +199,7 @@ if ($load_filter_id > 0) { $user_groups_fl = users_get_groups( $config['id_user'], 'AR', - users_can_manage_group_all(), + users_can_manage_group_all('AR'), true ); From 2f4543a0234ae05ef17b283270c4c5d4c2596d16 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 2 Mar 2023 08:20:43 +0100 Subject: [PATCH 15/17] #9517 Change MR sql --- pandora_console/extras/mr/62.sql | 2 ++ pandora_console/extras/mr/63.sql | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 pandora_console/extras/mr/63.sql diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql index b5358f6254..b04dd12c25 100644 --- a/pandora_console/extras/mr/62.sql +++ b/pandora_console/extras/mr/62.sql @@ -4,4 +4,6 @@ START TRANSACTION; CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); CREATE INDEX idx_disabled ON talert_template_modules (disabled); +INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0'); + COMMIT; diff --git a/pandora_console/extras/mr/63.sql b/pandora_console/extras/mr/63.sql deleted file mode 100644 index 401d4a748c..0000000000 --- a/pandora_console/extras/mr/63.sql +++ /dev/null @@ -1,5 +0,0 @@ -START TRANSACTION; - -INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0'); - -COMMIT; From 590ddc827c4b5749b4c7d2eccb31d434a1c739a0 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 2 Mar 2023 08:29:06 +0100 Subject: [PATCH 16/17] #9819 Change MR and add pandoradb.sql create table teventsound --- pandora_console/extras/mr/62.sql | 7 +++++++ pandora_console/extras/mr/65.sql | 10 ---------- pandora_console/pandoradb.sql | 10 ++++++++++ 3 files changed, 17 insertions(+), 10 deletions(-) delete mode 100644 pandora_console/extras/mr/65.sql diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql index b5358f6254..a265c1a62d 100644 --- a/pandora_console/extras/mr/62.sql +++ b/pandora_console/extras/mr/62.sql @@ -1,6 +1,13 @@ -- Active: 1653046769261@@172.16.0.2@3306@pandora START TRANSACTION; +CREATE TABLE `tevent_sound` ( + `id` INT NOT NULL AUTO_INCREMENT, + `name` TEXT NULL, + `sound` TEXT NULL, + `active` TINYINT NOT NULL DEFAULT '1', +PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); CREATE INDEX idx_disabled ON talert_template_modules (disabled); diff --git a/pandora_console/extras/mr/65.sql b/pandora_console/extras/mr/65.sql deleted file mode 100644 index 7e65e62c2f..0000000000 --- a/pandora_console/extras/mr/65.sql +++ /dev/null @@ -1,10 +0,0 @@ -START TRANSACTION; - -CREATE TABLE `tevent_sound` ( - `id` INT NOT NULL AUTO_INCREMENT, - `name` TEXT NULL, - `sound` TEXT NULL, - `active` TINYINT NOT NULL DEFAULT '1', -PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -COMMIT; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 530a0049ac..3da24db710 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -4179,3 +4179,13 @@ CREATE TABLE IF NOT EXISTS `tmonitor_filter` ( `ag_custom_fields` TEXT, PRIMARY KEY (`id_filter`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +-- --------------------------------------------------------------------- +-- Table `tevent_sound` +-- --------------------------------------------------------------------- +CREATE TABLE `tevent_sound` ( + `id` INT NOT NULL AUTO_INCREMENT, + `name` TEXT NULL, + `sound` TEXT NULL, + `active` TINYINT NOT NULL DEFAULT '1', +PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file From 1f046e94466cf781fd0869b80e12545ef584d227 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 3 Mar 2023 01:00:24 +0100 Subject: [PATCH 17/17] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index a8a7940165..7a6aeff356 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230302 +Version: 7.0NG.769-230303 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 21522e4937..fa61aa49c9 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/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.769-230302" +pandora_version="7.0NG.769-230303" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a1e5ea6e0e..0a12df1c9f 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230302'; +use constant AGENT_BUILD => '230303'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 107be42b57..89ea2a0b9f 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230302 +%define release 230303 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 0f5ae307c0..aed2381793 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230302 +%define release 230303 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 6c14bec893..c63a4a6cfc 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230302" +PI_BUILD="230303" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 0c79064ec1..2c51bc2a4b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230302} +{230303} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 13c0a7445d..acf6b701e5 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.769 Build 230302") +#define PANDORA_VERSION ("7.0NG.769 Build 230303") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index eff0e22339..c6e79f7d24 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230302))" + VALUE "ProductVersion", "(7.0NG.769(Build 230303))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 59ea1588fa..57d645e9b5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230302 +Version: 7.0NG.769-230303 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index aaae992e96..f701f80ec0 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/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.769-230302" +pandora_version="7.0NG.769-230303" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3ba4310159..70d3efe878 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC230302'; +$build_version = 'PC230303'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 7938198596..f89f637f9e 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index b3438f8d82..258f04a16d 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.769 -%define release 230302 +%define release 230303 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 3b050ebbea..14deb9c3c3 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.769 -%define release 230302 +%define release 230303 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 5f1d3b7245..ea2a1a70ed 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230302" +PI_BUILD="230303" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 74cbb27d4c..6889216e80 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.769 Build 230302"; +my $version = "7.0NG.769 Build 230303"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index dc01241c19..b7374ab423 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.769 Build 230302"; +my $version = "7.0NG.769 Build 230303"; # save program name for logging my $progname = basename($0);