Merge remote-tracking branch 'origin/develop' into ent-3499-Numero_de_respuestas_de_eventos_masivas
Former-commit-id: 4a8482ccef3661c83553dff8f5533c29321f95f2
This commit is contained in:
commit
300626e551
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.731-190219
|
||||
Version: 7.0NG.731-190220
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.731-190219"
|
||||
pandora_version="7.0NG.731-190220"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.731';
|
||||
use constant AGENT_BUILD => '190219';
|
||||
use constant AGENT_BUILD => '190220';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.731
|
||||
%define release 190219
|
||||
%define release 190220
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.731
|
||||
%define release 190219
|
||||
%define release 190220
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.731"
|
||||
PI_BUILD="190219"
|
||||
PI_BUILD="190220"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{190219}
|
||||
{190220}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.731(Build 190219)")
|
||||
#define PANDORA_VERSION ("7.0NG.731(Build 190220)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.731(Build 190219))"
|
||||
VALUE "ProductVersion", "(7.0NG.731(Build 190220))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.731-190219
|
||||
Version: 7.0NG.731-190220
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.731-190219"
|
||||
pandora_version="7.0NG.731-190220"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -229,7 +229,7 @@ if (!$new_agent) {
|
|||
$table->data[0][1] .= " <span align='right'><a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Alias');
|
||||
$table->data[1][0] = __('Alias').ui_print_help_tip(__('Characters /,\,|,%,#,&,$ are not allowed'), true).'</span>';
|
||||
$table->data[1][1] = html_print_input_text('alias', $alias, '', 50, 100, true);
|
||||
if ($new_agent) {
|
||||
$table->data[1][1] .= html_print_checkbox('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name');
|
||||
|
|
|
@ -159,7 +159,8 @@ $module_macros = [];
|
|||
// Create agent
|
||||
if ($create_agent) {
|
||||
$mssg_warning = 0;
|
||||
$alias = (string) get_parameter_post('alias', '');
|
||||
$alias = trim (preg_replace('/[\/\\\|%#&$-]/', '',
|
||||
html_entity_decode( str_replace('`','‘',(string) get_parameter_post ("alias", "")))));
|
||||
$alias_as_name = (int) get_parameter_post('alias_as_name', 0);
|
||||
$direccion_agente = (string) get_parameter_post('direccion', '');
|
||||
$unique_ip = (int) get_parameter_post('unique_ip', 0);
|
||||
|
@ -764,7 +765,8 @@ if ($update_agent) {
|
|||
$mssg_warning = 0;
|
||||
$id_agente = (int) get_parameter_post('id_agente');
|
||||
$nombre_agente = str_replace('`', '‘', (string) get_parameter_post('agente', ''));
|
||||
$alias = str_replace('`', '‘', (string) get_parameter_post('alias', ''));
|
||||
$alias = trim (preg_replace('/[\/\\\|%#&$-]/', '',
|
||||
html_entity_decode( str_replace('`','‘',(string) get_parameter_post ("alias", "")))));
|
||||
$alias_as_name = (int) get_parameter_post('alias_as_name', 0);
|
||||
$direccion_agente = (string) get_parameter_post('direccion', '');
|
||||
$unique_ip = (int) get_parameter_post('unique_ip', 0);
|
||||
|
@ -932,7 +934,7 @@ if ($update_agent) {
|
|||
|
||||
$result = db_process_sql_update('tagente', $values, ['id_agente' => $id_agente]);
|
||||
|
||||
if ($result == false && $update_custom_result == false) {
|
||||
if ($result === false && $update_custom_result == false) {
|
||||
ui_print_error_message(
|
||||
__('There was a problem updating the agent')
|
||||
);
|
||||
|
|
|
@ -1116,8 +1116,13 @@ switch ($action) {
|
|||
$name_it = (string) get_parameter('name');
|
||||
$values['name'] = reporting_label_macro($items_label, $name_it);
|
||||
|
||||
// Added support for projection graphs, prediction date and SLA reports
|
||||
// 'top_n_value','top_n' and 'text' fields will be reused for these types of report
|
||||
/*
|
||||
Added support for projection graphs,
|
||||
prediction date and SLA reports
|
||||
'top_n_value','top_n' and 'text'
|
||||
fields will be reused for these types of report
|
||||
*/
|
||||
|
||||
switch ($values['type']) {
|
||||
case 'projection_graph':
|
||||
$values['period'] = get_parameter('period1');
|
||||
|
@ -1127,7 +1132,8 @@ switch ($action) {
|
|||
break;
|
||||
|
||||
case 'event_report_log':
|
||||
$agents_to_report = get_parameter('id_agents2');
|
||||
|
||||
$agents_to_report = get_parameter('id_agents3');
|
||||
$source = get_parameter('source', '');
|
||||
$search = get_parameter('search', '');
|
||||
$log_number = get_parameter('log_number', '');
|
||||
|
@ -1525,7 +1531,7 @@ switch ($action) {
|
|||
break;
|
||||
|
||||
case 'event_report_log':
|
||||
$agents_to_report = get_parameter('id_agents2');
|
||||
$agents_to_report = get_parameter('id_agents3');
|
||||
$source = get_parameter('source', '');
|
||||
$search = get_parameter('search', '');
|
||||
$log_number = get_parameter('log_number', '');
|
||||
|
@ -1632,17 +1638,6 @@ switch ($action) {
|
|||
$values['server_name'] = get_parameter('combo_server');
|
||||
}
|
||||
|
||||
|
||||
if (is_metaconsole()) {
|
||||
// For SQL Query check if it is setted in the meta
|
||||
if ($values['type'] == 'sql') {
|
||||
if (empty($values['server_name'])) {
|
||||
$good_format = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$values['id_agent'] = get_parameter('id_agent');
|
||||
$values['id_gs'] = get_parameter('id_custom_graph');
|
||||
if (($values['type'] == 'alert_report_agent') or ($values['type'] == 'event_report_agent') or ($values['type'] == 'agent_configuration') or ($values['type'] == 'group_configuration')) {
|
||||
|
|
|
@ -134,7 +134,8 @@ if (is_ajax()) {
|
|||
set_unless_defined($config['double_auth_enabled'], false);
|
||||
$row = [];
|
||||
$row['name'] = __('Double authentication').ui_print_help_tip(__('If this option is enabled, the users can use double authentication with their accounts'), true);
|
||||
$row['control'] = html_print_checkbox_toogle_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true);
|
||||
$row['control'] = html_print_input_hidden('double_auth_enabled', 0);
|
||||
$row['control'] .= html_print_checkbox_toogle_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true);
|
||||
$table->data['double_auth_enabled'] = $row;
|
||||
|
||||
// Session timeout
|
||||
|
|
|
@ -90,9 +90,9 @@ if ($get_response_params) {
|
|||
}
|
||||
|
||||
if ($get_response_target) {
|
||||
$response_id = get_parameter('response_id');
|
||||
$event_id = get_parameter('event_id');
|
||||
$server_id = get_parameter('server_id', 0);
|
||||
$response_id = (int) get_parameter('response_id');
|
||||
$event_id = (int) get_parameter('event_id');
|
||||
$server_id = (int) get_parameter('server_id');
|
||||
|
||||
$event_response = db_get_row('tevent_response', 'id', $response_id);
|
||||
|
||||
|
@ -101,7 +101,6 @@ if ($get_response_target) {
|
|||
}
|
||||
|
||||
echo events_get_response_target($event_id, $response_id, $server_id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,16 +88,13 @@ if (file_exists('languages/'.$user_language.'.mo')) {
|
|||
$params['menu'] = false;
|
||||
|
||||
if ((!isset($params['width']) || ($params['width'] <= 0))) {
|
||||
$params['width'] = 1048;
|
||||
$params['width'] = 650;
|
||||
}
|
||||
|
||||
$params_combined = json_decode($_REQUEST['data_combined'], true);
|
||||
$module_list = json_decode($_REQUEST['data_module_list'], true);
|
||||
$type_graph_pdf = $_REQUEST['type_graph_pdf'];
|
||||
|
||||
$aux_font_size = $config['font_size'];
|
||||
$config['font_size'] = ($config['font_size'] + 3);
|
||||
|
||||
echo '<div>';
|
||||
switch ($type_graph_pdf) {
|
||||
case 'combined':
|
||||
|
@ -216,7 +213,6 @@ if (file_exists('languages/'.$user_language.'.mo')) {
|
|||
|
||||
echo '</div>';
|
||||
|
||||
$config['font_size'] = $aux_font_size;
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC190219';
|
||||
$build_version = 'PC190220';
|
||||
$pandora_version = 'v7.0NG.731';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -3102,7 +3102,7 @@ function select_agents_for_module_group(
|
|||
'AND',
|
||||
'tagente_modulo',
|
||||
true,
|
||||
[],
|
||||
$filter['tags'],
|
||||
false
|
||||
);
|
||||
$sql_tags_inner = 'INNER JOIN ttag_module
|
||||
|
|
|
@ -37,7 +37,7 @@ function events_get_all_fields()
|
|||
$columns['estado'] = __('Status');
|
||||
$columns['timestamp'] = __('Timestamp');
|
||||
$columns['event_type'] = __('Event type');
|
||||
$columns['id_agentmodule'] = __('Agent module');
|
||||
$columns['id_agentmodule'] = __('Module name');
|
||||
$columns['id_alert_am'] = __('Alert');
|
||||
$columns['criticity'] = __('Severity');
|
||||
$columns['user_comment'] = __('Comment');
|
||||
|
@ -2089,27 +2089,34 @@ function events_page_responses($event, $childrens_ids=[])
|
|||
}
|
||||
|
||||
|
||||
// Replace macros in the target of a response and return it
|
||||
// If server_id > 0, is a metaconsole query
|
||||
function events_get_response_target($event_id, $response_id, $server_id, $history=false)
|
||||
{
|
||||
/**
|
||||
* Replace macros in the target of a response and return it.
|
||||
* If server_id > 0, it's a metaconsole query.
|
||||
*
|
||||
* @param integer $event_id Event identifier.
|
||||
* @param integer $response_id Event response identifier.
|
||||
* @param integer $server_id Node identifier (for metaconsole).
|
||||
* @param boolean $history Use the history database or not.
|
||||
*
|
||||
* @return string The response text with the macros applied.
|
||||
*/
|
||||
function events_get_response_target(
|
||||
int $event_id,
|
||||
int $response_id,
|
||||
int $server_id=0,
|
||||
bool $history=false
|
||||
) {
|
||||
global $config;
|
||||
|
||||
$event_response = db_get_row('tevent_response', 'id', $response_id);
|
||||
|
||||
if ($server_id > 0) {
|
||||
$meta = true;
|
||||
} else {
|
||||
$meta = false;
|
||||
}
|
||||
|
||||
// If server_id > 0, it's a metaconsole query.
|
||||
$meta = $server_id > 0;
|
||||
$event_table = events_get_events_table($meta, $history);
|
||||
|
||||
$event = db_get_row($event_table, 'id_evento', $event_id);
|
||||
|
||||
$event_response = db_get_row('tevent_response', 'id', $response_id);
|
||||
$target = io_safe_output($event_response['target']);
|
||||
|
||||
// Substitute each macro
|
||||
// Substitute each macro.
|
||||
if (strpos($target, '_agent_address_') !== false) {
|
||||
if ($meta) {
|
||||
$agente_table_name = 'tmetaconsole_agent';
|
||||
|
@ -2123,7 +2130,7 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor
|
|||
}
|
||||
|
||||
$ip = db_get_value_filter('direccion', $agente_table_name, $filter);
|
||||
// If agent has not an ip, display N/A
|
||||
// If agent has not an IP, display N/A.
|
||||
if ($ip === false) {
|
||||
$ip = __('N/A');
|
||||
}
|
||||
|
@ -2288,7 +2295,7 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor
|
|||
$target = str_replace('_group_custom_id_', $group_custom_id, $target);
|
||||
}
|
||||
|
||||
// Parse the event custom data
|
||||
// Parse the event custom data.
|
||||
if (!empty($event['custom_data'])) {
|
||||
$custom_data = json_decode(base64_decode($event['custom_data']));
|
||||
foreach ($custom_data as $key => $value) {
|
||||
|
@ -2296,6 +2303,11 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor
|
|||
}
|
||||
}
|
||||
|
||||
// This will replace the macro with the current logged user.
|
||||
if (strpos($target, '_current_user_') !== false) {
|
||||
$target = str_replace('_current_user_', $config['id_user'], $target);
|
||||
}
|
||||
|
||||
return $target;
|
||||
}
|
||||
|
||||
|
|
|
@ -126,6 +126,12 @@ if (isset($config['homedir_filemanager'])) {
|
|||
$homedir_filemanager = $config['homedir'];
|
||||
}
|
||||
|
||||
$sec2 = get_parameter('sec2');
|
||||
if ($sec2 == 'enterprise/godmode/agentes/collections') {
|
||||
$homedir_filemanager .= '/attachment/collection/';
|
||||
}
|
||||
|
||||
|
||||
$upload_file_or_zip = (bool) get_parameter('upload_file_or_zip');
|
||||
|
||||
if ($upload_file_or_zip) {
|
||||
|
@ -499,12 +505,6 @@ function filemanager_file_explorer(
|
|||
$homedir_filemanager = $config['homedir'];
|
||||
}
|
||||
|
||||
unset($config['homedir_filemanager']);
|
||||
config_update_value(
|
||||
'homedir_filemanager',
|
||||
$homedir_filemanager
|
||||
);
|
||||
|
||||
$hack_metaconsole = '';
|
||||
if (defined('METACONSOLE')) {
|
||||
$hack_metaconsole = '../../';
|
||||
|
@ -938,4 +938,3 @@ function filemanager_list_dir($dirpath)
|
|||
|
||||
return array_merge($dirs, $files);
|
||||
}
|
||||
|
||||
|
|
|
@ -245,7 +245,9 @@ function grafico_modulo_sparse_data(
|
|||
}
|
||||
}
|
||||
|
||||
if ($array_data === false || (!$params['graph_combined'] && !isset($array_data['sum1']['data'][0][1]))) {
|
||||
if ($array_data === false || (!$params['graph_combined']
|
||||
&& !isset($array_data['sum1']['data'][0][1]) && !$params['baseline'])
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -4918,21 +4920,19 @@ function get_baseline_data($agent_module_id, $date_array, $data_module_graph, $p
|
|||
$period = $date_array['period'];
|
||||
$date = $date_array['final_date'];
|
||||
$array_data = [];
|
||||
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
$date_array = [];
|
||||
$date_array['period'] = $period;
|
||||
$date_array['final_date'] = ($date - $period * $i);
|
||||
$date_array['start_date'] = ($date - $period * ($i + 1));
|
||||
|
||||
$data = grafico_modulo_sparse_data(
|
||||
$date_array['final_date'] = ($date - ($period * $i));
|
||||
$date_array['start_date'] = ($date - ($period * ($i + 1)));
|
||||
$array_data[] = grafico_modulo_sparse_data(
|
||||
$agent_module_id,
|
||||
$date_array,
|
||||
$data_module_graph,
|
||||
$params,
|
||||
$i
|
||||
);
|
||||
|
||||
$array_data[] = $data;
|
||||
}
|
||||
|
||||
$result = [];
|
||||
|
|
|
@ -1822,35 +1822,35 @@ function html_get_predefined_table($model='transparent', $columns=4)
|
|||
* Print a nicely formatted table. Code taken from moodle.
|
||||
*
|
||||
* @param object Object with several properties:
|
||||
* $table->head - An array of heading names.
|
||||
* $table->head_colspan - An array of colspans of each head column.
|
||||
* $table->headstyle - An array of styles of each head column.
|
||||
* $table->align - An array of column alignments
|
||||
* $table->valign - An array of column alignments
|
||||
* $table->size - An array of column sizes
|
||||
* $table->wrap - An array of "nowrap"s or nothing
|
||||
* $table->style - An array of personalized style for each column.
|
||||
* $table->rowid - An array of personalized ids of each row.
|
||||
* $table->rowstyle - An array of personalized style of each row.
|
||||
* $table->rowclass - An array of personalized classes of each row (odd-evens classes will be ignored).
|
||||
* $table->colspan - An array of colspans of each column.
|
||||
* $table->rowspan - An array of rowspans of each column.
|
||||
* $table->data[] - An array of arrays containing the data.
|
||||
* $table->width - A percentage of the page
|
||||
* $table->border - Border of the table.
|
||||
* $table->tablealign - Align the whole table (float left or right)
|
||||
* $table->cellpadding - Padding on each cell
|
||||
* $table->cellspacing - Spacing between cells
|
||||
* $table->cellstyle - Style of a cell
|
||||
* $table->cellclass - Class of a cell
|
||||
* $table->class - CSS table class
|
||||
* $table->id - Table ID (useful in JavaScript)
|
||||
* $table->headclass[] - An array of classes for each heading
|
||||
* $table->title - Title of the table is a single string that will be on top of the table in the head spanning the whole table
|
||||
* $table->titlestyle - Title style
|
||||
* $table->titleclass - Title class
|
||||
* $table->styleTable - Table style
|
||||
* $table->caption - Table title
|
||||
* $table->head - An array of heading names.
|
||||
* $table->head_colspan - An array of colspans of each head column.
|
||||
* $table->headstyle - An array of styles of each head column.
|
||||
* $table->align - An array of column alignments
|
||||
* $table->valign - An array of column alignments
|
||||
* $table->size - An array of column sizes
|
||||
* $table->wrap - An array of "nowrap"s or nothing
|
||||
* $table->style - An array of personalized style for each column.
|
||||
* $table->rowid - An array of personalized ids of each row.
|
||||
* $table->rowstyle - An array of personalized style of each row.
|
||||
* $table->rowclass - An array of personalized classes of each row (odd-evens classes will be ignored).
|
||||
* $table->colspan - An array of colspans of each column.
|
||||
* $table->rowspan - An array of rowspans of each column.
|
||||
* $table->data[] - An array of arrays containing the data.
|
||||
* $table->width - A percentage of the page
|
||||
* $table->border - Border of the table.
|
||||
* $table->tablealign - Align the whole table (float left or right)
|
||||
* $table->cellpadding - Padding on each cell
|
||||
* $table->cellspacing - Spacing between cells
|
||||
* $table->cellstyle - Style of a cell
|
||||
* $table->cellclass - Class of a cell
|
||||
* $table->class - CSS table class
|
||||
* $table->id - Table ID (useful in JavaScript)
|
||||
* $table->headclass[] - An array of classes for each heading
|
||||
* $table->title - Title of the table is a single string that will be on top of the table in the head spanning the whole table
|
||||
* $table->titlestyle - Title style
|
||||
* $table->titleclass - Title class
|
||||
* $table->styleTable - Table style
|
||||
* $table->caption - Table title
|
||||
* @param bool Whether to return an output string or echo now
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
|
|
|
@ -142,7 +142,6 @@ function reporting_make_reporting_data(
|
|||
enterprise_include_once('include/functions_metaconsole.php');
|
||||
|
||||
$return = [];
|
||||
|
||||
if (!empty($report)) {
|
||||
$contents = $report['contents'];
|
||||
} else {
|
||||
|
@ -261,7 +260,7 @@ function reporting_make_reporting_data(
|
|||
}
|
||||
|
||||
if (isset($content['style']['name_label'])) {
|
||||
// Add macros name
|
||||
// Add macros name.
|
||||
$items_label = [];
|
||||
$items_label['type'] = $content['type'];
|
||||
$items_label['id_agent'] = $content['id_agent'];
|
||||
|
@ -272,11 +271,10 @@ function reporting_make_reporting_data(
|
|||
$metaconsole_on = is_metaconsole();
|
||||
$server_name = $content['server_name'];
|
||||
|
||||
// Metaconsole connection
|
||||
// Metaconsole connection.
|
||||
if ($metaconsole_on && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
// ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -889,7 +887,6 @@ function reporting_SLA(
|
|||
if ($metaconsole_on && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
// ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -898,7 +895,7 @@ function reporting_SLA(
|
|||
|| modules_is_not_init($sla['id_agent_module'])
|
||||
) {
|
||||
if ($metaconsole_on) {
|
||||
// Restore db connection
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
|
@ -6794,7 +6791,6 @@ function reporting_general($report, $content)
|
|||
if (!is_numeric($data_res[$index])) {
|
||||
$return['data'][$ag_name][$mod_name] = $data_res[$index];
|
||||
} else {
|
||||
hd($data_res[$index], true);
|
||||
$return['data'][$ag_name][$mod_name] = format_for_graph($data_res[$index], 2).' '.$unit;
|
||||
}
|
||||
}
|
||||
|
@ -11336,3 +11332,27 @@ function reporting_translate_sla_status_for_graph($status)
|
|||
];
|
||||
return $sts[$status];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print header to report pdf and add page break
|
||||
*
|
||||
* @param string $title Title of report.
|
||||
* @param string $description Description of report.
|
||||
*
|
||||
* @return html Return table of header.
|
||||
*/
|
||||
function reporting_header_table_for_pdf(string $title='', string $description='')
|
||||
{
|
||||
$result_pdf .= '<pagebreak>';
|
||||
$result_pdf .= '<table class="header_table databox">';
|
||||
$result_pdf .= '<thead class="header_tr"><tr>';
|
||||
$result_pdf .= '<th class="th_first" colspan="2">';
|
||||
$result_pdf .= $title;
|
||||
$result_pdf .= '</th><th style="font-size: 15px;" align="right">';
|
||||
$result_pdf .= '</th></tr><tr><th colspan="3" class="th_description">';
|
||||
$result_pdf .= $description;
|
||||
$result_pdf .= '</th></tr></thead></table>';
|
||||
|
||||
return $result_pdf;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -748,7 +748,7 @@ function tags_get_acl_tags(
|
|||
$id_user = $config['id_user'];
|
||||
}
|
||||
|
||||
if (is_user_admin($id_user)) {
|
||||
if (is_user_admin($id_user) && empty($childrens_ids)) {
|
||||
switch ($return_mode) {
|
||||
case 'data':
|
||||
return [];
|
||||
|
@ -797,7 +797,8 @@ function tags_get_acl_tags(
|
|||
// Return the condition of the tags for tagente_modulo table
|
||||
$condition = tags_get_acl_tags_module_condition(
|
||||
$acltags,
|
||||
$query_table
|
||||
$query_table,
|
||||
empty($childrens_ids) ? [] : $childrens_ids
|
||||
);
|
||||
if (!empty($condition)) {
|
||||
return " $query_prefix ".$condition;
|
||||
|
@ -825,7 +826,7 @@ function tags_get_acl_tags(
|
|||
*
|
||||
* @return string SQL condition for tagente_module
|
||||
*/
|
||||
function tags_get_acl_tags_module_condition($acltags, $modules_table='')
|
||||
function tags_get_acl_tags_module_condition($acltags, $modules_table='', $force_tags=[])
|
||||
{
|
||||
if (!empty($modules_table)) {
|
||||
$modules_table .= '.';
|
||||
|
@ -839,6 +840,17 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table='')
|
|||
// The acltags array contains the groups with the acl propagation applied
|
||||
// after the changes done into the 'tags_get_user_groups_and_tags' function.
|
||||
foreach ($acltags as $group_id => $group_tags) {
|
||||
if (empty($group_tags)) {
|
||||
$group_tags = [];
|
||||
if (!empty($force_tags)) {
|
||||
$group_tags = $force_tags;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($group_tags)) {
|
||||
$group_tags = array_intersect($force_tags, $group_tags);
|
||||
}
|
||||
|
||||
$tag_join = '';
|
||||
if (!empty($group_tags)) {
|
||||
$tag_join = sprintf('AND ttag_module.id_tag IN (%s)', is_array($group_tags) ? implode(',', $group_tags) : $group_tags);
|
||||
|
@ -849,7 +861,7 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table='')
|
|||
}
|
||||
|
||||
$group_conditions[] = $agent_condition;
|
||||
} else {
|
||||
} else if (!empty($force_tags)) {
|
||||
$without_tags[] = $group_id;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -856,6 +856,7 @@ function pandoraFlotSlicebar(
|
|||
}
|
||||
|
||||
var font_size = parseInt(font_size);
|
||||
if (font != undefined)
|
||||
var font = font
|
||||
.split("/")
|
||||
.pop()
|
||||
|
|
|
@ -32,7 +32,8 @@ The accepted macros are:
|
|||
<li><b>Event associated module name:</b> _module_name_</li>
|
||||
<li><b>Event owner user:</b> _owner_user_</li>
|
||||
<li><b>User ID:</b> _user_id_</li>
|
||||
</ul>
|
||||
<li><b>Id of the user who fires the response:</b> _current_user_</li>
|
||||
</ul>
|
||||
|
||||
<h4>Custom fields</h4>
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ Las macros aceptadas son las siguientes:
|
|||
<li><b>Nombre del módulo asociado al evento:</b> _module_name_</li>
|
||||
<li><b>Usuario propietario del evento:</b> _owner_user_</li>
|
||||
<li><b>Id del usuario:</b> _user_id_</li>
|
||||
<li><b>Id del usuario que ejecuta la respuesta:</b> _current_user_</li>
|
||||
</ul>
|
||||
|
||||
<h4>Campos personalizados</h4>
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
<li><b>Event associated module name:</b> _module_name_</li>
|
||||
<li><b>Event owner user:</b> _owner_user_</li>
|
||||
<li><b>User ID:</b> _user_id_</li>
|
||||
<li><b>Id of the user who fires the response:</b> _current_user_</li>
|
||||
</ul>
|
||||
|
||||
<h4>Custom fields</h4>
|
||||
|
|
|
@ -503,6 +503,14 @@ function module_changed_by_multiple_modules(event, id_module, selected) {
|
|||
selection_mode = "common";
|
||||
}
|
||||
|
||||
var tags_selected = [];
|
||||
|
||||
var tags_to_search = $("#tags").val();
|
||||
if (tags_to_search != null) {
|
||||
if (tags_to_search[0] != -1) {
|
||||
tags_selected = tags_to_search;
|
||||
}
|
||||
}
|
||||
jQuery.post(
|
||||
"ajax.php",
|
||||
{
|
||||
|
@ -510,7 +518,8 @@ function module_changed_by_multiple_modules(event, id_module, selected) {
|
|||
get_agents_json_for_multiple_modules: 1,
|
||||
status_module: status_module,
|
||||
"module_name[]": idModules,
|
||||
selection_mode: selection_mode
|
||||
selection_mode: selection_mode,
|
||||
tags: tags_selected
|
||||
},
|
||||
function(data) {
|
||||
$("#agents").append(
|
||||
|
|
|
@ -1,24 +1,30 @@
|
|||
/*
|
||||
Author: The Pandora FMS team
|
||||
Name: Default theme
|
||||
Description: The default Pandora FMS theme layout
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==========================================================
|
||||
// Copyright (c) 2004-2019 Artica Soluciones Tecnológicas S.L
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
/* Tree view styles */
|
||||
/*@import url(tree.css);
|
||||
|
@ -2053,82 +2059,58 @@ div#logo_text3 {
|
|||
|
||||
/* TABLAS */
|
||||
/* Cells divs to set individual styles with the table objects */
|
||||
div.cellBold {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellBold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.cellRight {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellRight {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.cellCenter {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellCenter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.cellWhite {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellWhite {
|
||||
background: #fff;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
div.cellNormal {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellNormal {
|
||||
background: #6eb432;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
div.cellCritical {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellCritical {
|
||||
background: #f85858;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
div.cellWarning {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellWarning {
|
||||
background: #ffea59;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
div.cellUnknown {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellUnknown {
|
||||
background: #aaaaaa;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
div.cellNotInit {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellNotInit {
|
||||
background: #3ba0ff;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
div.cellAlert {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellAlert {
|
||||
background: #ff8800;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
div.cellBorder1 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellBorder1 {
|
||||
border: 1px solid #666;
|
||||
}
|
||||
|
||||
div.cellBig {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
td.cellBig {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
|
@ -4561,4 +4543,4 @@ input:checked + .slider:before {
|
|||
.no-close .ui-dialog-titlebar-close {
|
||||
display: none;
|
||||
}
|
||||
/* jQuery dialog */
|
||||
/* --- END - JQUERY-UI --- */
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
table.header_table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.header_table thead tr th,
|
||||
table.header_table tbody tr td {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
thead.header_tr tr {
|
||||
background: #e6e6e6;
|
||||
}
|
||||
|
||||
thead.header_tr tr th {
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
thead.header_tr tr th.th_first {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
thead.header_tr tr th.th_description {
|
||||
background-color: #f5f5f5;
|
||||
color: #1c1c1c;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
table.table_beauty {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.table_beauty tbody tr td {
|
||||
padding: 5px;
|
||||
border: 0.1pt solid #acacac;
|
||||
}
|
||||
|
||||
table.databox {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
th.title_table_pdf {
|
||||
background-color: #acacac;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
table.table_agent_module tr td {
|
||||
padding: 5px;
|
||||
}
|
|
@ -1363,4 +1363,3 @@ require 'include/php_to_js_values.php';
|
|||
if (__PAN_XHPROF__ === 1) {
|
||||
pandora_xhprof_display_result('node_index');
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.731';
|
||||
$build = '190219';
|
||||
$build = '190220';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -177,11 +177,14 @@ if (is_ajax()) {
|
|||
$nameModules = get_parameter('module_name');
|
||||
$selection_mode = get_parameter('selection_mode', 'common') == 'all';
|
||||
$status_modulo = (int) get_parameter('status_module', -1);
|
||||
|
||||
$tags_selected = (array) get_parameter('tags', []);
|
||||
$names = select_agents_for_module_group(
|
||||
$nameModules,
|
||||
$selection_mode,
|
||||
['status' => $status_modulo],
|
||||
[
|
||||
'status' => $status_modulo,
|
||||
'tags' => $tags_selected,
|
||||
],
|
||||
'AW'
|
||||
);
|
||||
|
||||
|
|
|
@ -390,10 +390,13 @@ $table->data[] = $data;
|
|||
|
||||
// Double auth
|
||||
$double_auth_enabled = (bool) db_get_value('id', 'tuser_double_auth', 'id_user', $config['id_user']);
|
||||
$data = [];
|
||||
$data[0] = '<span style="width:50%;float:left;">'.__('Double authentication').'</span>';
|
||||
$data[0] .= $jump;
|
||||
$data[0] .= '<span style="width:20%;float:left;line-height:20px;">'.html_print_checkbox('double_auth', 1, $double_auth_enabled, true).'</span>';
|
||||
$data = array();
|
||||
if ($config['double_auth_enabled']) {
|
||||
$data[0] = '<span style="width:50%;float:left;">'.__('Double authentication').'</span>';
|
||||
$data[0] .= $jump;
|
||||
$data[0] .= '<span style="width:20%;float:left;line-height:20px;">'.html_print_checkbox('double_auth', 1, $double_auth_enabled, true).'</span>';
|
||||
}
|
||||
|
||||
if ($double_auth_enabled) {
|
||||
$data[0] .= $jump;
|
||||
$data[0] .= html_print_button(__('Show information'), 'show_info', false, 'javascript:show_double_auth_info();', '', true);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.731
|
||||
%define release 190219
|
||||
%define release 190220
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.731
|
||||
%define release 190219
|
||||
%define release 190220
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.731-190219
|
||||
Version: 7.0NG.731-190220
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.731-190219"
|
||||
pandora_version="7.0NG.731-190220"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.731";
|
||||
my $pandora_build = "190219";
|
||||
my $pandora_build = "190220";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -3454,6 +3454,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
|
|||
|
||||
# Specific SNMP Trap alert macros for regexp selectors in trap info
|
||||
my %macros;
|
||||
$macros{'_trap_id_'} = $trap_id;
|
||||
$macros{'_snmp_oid_'} = $trap_oid;
|
||||
$macros{'_snmp_value_'} = $trap_value;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.731";
|
||||
my $pandora_build = "190219";
|
||||
my $pandora_build = "190220";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.731
|
||||
%define release 190219
|
||||
%define release 190220
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.731
|
||||
%define release 190219
|
||||
%define release 190220
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.731"
|
||||
PI_BUILD="190219"
|
||||
PI_BUILD="190220"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.731 PS190219";
|
||||
my $version = "7.0NG.731 PS190220";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.731 PS190219";
|
||||
my $version = "7.0NG.731 PS190220";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue