Merge branch 'develop' into 'ent-4967-9083-Valores-unidades-en-graficas-no-son-por-1024'

# Conflicts:
#   pandora_console/extras/mr/35.sql
This commit is contained in:
Alejandro Campos 2020-01-14 10:28:55 +01:00
commit dcd2aae3c5
60 changed files with 366 additions and 210 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.742-200107
Version: 7.0NG.742-200114
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.742"
PI_BUILD="200107"
PI_BUILD="200114"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{200107}
{200114}
ViewReadme
{Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.742-200107
Version: 7.0NG.742-200114
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -798,11 +798,7 @@ function mainAgentsModules()
echo "<td style='text-align: center;'>";
$win_handle = dechex(crc32($module_id.$module['name']));
$graph_type = return_graphtype(modules_get_agentmodule_type($module_id));
$link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'label='.rawurlencode(
urlencode(
base64_encode($module['name'])
)
).'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."')";
$link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."')";
echo '<a href="javascript:'.$link.'">';
switch ($status) {

View File

@ -64,9 +64,11 @@ if (!empty($files)) {
$document_root = str_replace('\\', '/', io_safe_output($_SERVER['DOCUMENT_ROOT']));
$file['location'] = str_replace('\\', '/', io_safe_output($file['location']));
$relative_path = str_replace($document_root, '', $file['location']);
$file_path = base64_encode($relative_path);
$hash = md5($relative_path.$config['dbpass']);
$url = ui_get_full_url("include/get_file.php?file=$file_path&hash=$hash");
$file_name = explode('/', $file['location']);
$file_decoded = $file_name[(count($file_name) - 1)];
$file_path = base64_encode($file_decoded);
$hash = md5($file_path.$config['dbpass']);
$url = ui_get_full_url('include/get_file.php?file='.urlencode($file_path).'&hash='.$hash);
$date_format = ($config['date_format']) ? io_safe_output($config['date_format']) : 'F j, Y - H:m';
$data[0] = "<a href=\"$url\" target=\"_blank\">".$file['name'].'</a>';

View File

@ -1,5 +1,6 @@
START TRANSACTION;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_module_units', '{"bytes":"bytes","entries":"entries","files":"files","hits":"hits","sessions":"sessions","users":"users","ºC":"ºC","ºF":"ºF"}');
ALTER TABLE `tevent_filter` MODIFY `severity` TEXT NOT NULL;
COMMIT;

View File

@ -1401,6 +1401,7 @@ ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `id_source_event` int(10);
ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL;
ALTER TABLE `tevent_filter` MODIFY COLUMN `severity` text NOT NULL;
-- ---------------------------------------------------------------------
-- Table `tusuario`

View File

@ -55,7 +55,7 @@ if ($id) {
$id_group = $filter['id_group'];
$id_name = $filter['id_name'];
$event_type = $filter['event_type'];
$severity = $filter['severity'];
$severity = explode(',', $filter['severity']);
$status = $filter['status'];
$search = $filter['search'];
$text_agent = $filter['text_agent'];
@ -123,7 +123,7 @@ if ($update || $create) {
$id_group_filter = get_parameter('id_group_filter');
$id_name = (string) get_parameter('id_name');
$event_type = get_parameter('event_type', '');
$severity = get_parameter('severity', '');
$severity = implode(',', get_parameter('severity', -1));
$status = get_parameter('status', '');
$search = get_parameter('search', '');
$text_agent = get_parameter('text_agent', '');
@ -172,6 +172,8 @@ if ($update || $create) {
'user_comment' => $user_comment,
'filter_only_alert' => $filter_only_alert,
];
$severity = explode(',', $severity);
}
if ($update) {
@ -289,15 +291,24 @@ $table->data[3][1] = html_print_select(
true
);
if (empty($severity) && $severity !== '0') {
$severity = -1;
}
$table->data[4][0] = '<b>'.__('Severity').'</b>';
$table->data[4][1] = html_print_select(
get_priorities(),
'severity',
'severity[]',
$severity,
'',
__('All'),
'-1',
true
-1,
true,
true,
true,
'',
false,
'width: 175px'
);
$fields = events_get_all_status();

View File

@ -290,7 +290,7 @@ $table_aux = new stdClass();
foreach ($result_graphs as $graph) {
$data = [];
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text(io_safe_output($graph['name']), 70).'</a>';
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text($graph['name'], 70).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70);

View File

@ -1207,8 +1207,7 @@ switch ($action) {
$report_id_user = get_parameter('report_id_user');
$non_interactive = get_parameter('non_interactive', 0);
// Pretty font by default for pdf.
$custom_font = 'FreeSans.ttf';
$custom_font = $config['custom_report_front_font'];
switch ($type_access_selected) {
case 'group_view':
@ -1284,7 +1283,6 @@ switch ($action) {
$metaconsole_report = (int) is_metaconsole();
if ($config['custom_report_front']) {
$custom_font = $config['custom_report_front_font'];
$logo = $config['custom_report_front_logo'];
$header = $config['custom_report_front_header'];
$first_page = $config['custom_report_front_firstpage'];

View File

@ -1049,6 +1049,20 @@ $row++;
$row++;
$table_report->data[$row][0] = __('PDF font family');
$table_report->data[$row][1] = html_print_select(
$fonts,
'custom_report_front_font',
$config['custom_report_front_font'],
false,
__('Default'),
'',
true
);
$row++;
$table_report->data[$row][0] = __('Graph image height for HTML reports');
$table_report->data[$row][0] .= ui_print_help_tip(
__('This is the height in pixels of the module graph or custom graph in the reports (only: HTML)'),
@ -1079,18 +1093,6 @@ $row++;
}
}
// Font
$table_report->data['custom_report_front-font'][0] = __('Custom report front').' - '.__('Font family');
$table_report->data['custom_report_front-font'][1] = html_print_select(
$fonts,
'custom_report_front_font',
$config['custom_report_front_font'],
false,
__('Default'),
'',
true
);
// Logo
$table_report->data['custom_report_front-logo'][0] = __('Custom report front').' - '.__('Custom logo').ui_print_help_tip(
__("The dir of custom logos is in your www Console in 'images/custom_logo'. You can upload more files (ONLY JPEG AND PNG) in upload tool in console."),
@ -1434,7 +1436,6 @@ function edit_csv_divider () {
function display_custom_report_front (show,table) {
if (show == true) {
$('tr#'+table+'-custom_report_front-font').show();
$('tr#'+table+'-custom_report_front-logo').show();
$('tr#'+table+'-custom_report_front-preview').show();
$('tr#'+table+'-custom_report_front-header').show();
@ -1442,7 +1443,6 @@ function display_custom_report_front (show,table) {
$('tr#'+table+'-custom_report_front-footer').show();
}
else {
$('tr#'+table+'-custom_report_front-font').hide();
$('tr#'+table+'-custom_report_front-logo').hide();
$('tr#'+table+'-custom_report_front-preview').hide();
$('tr#'+table+'-custom_report_front-header').hide();

View File

@ -243,6 +243,12 @@ if ($create_user) {
$password_new = '';
$password_confirm = '';
$new_user = true;
} else if (preg_match('/^\s+|\s+$/', io_safe_output($id))) {
ui_print_error_message(__('Invalid user ID: leading or trailing blank spaces not allowed'));
$user_info = $values;
$password_new = '';
$password_confirm = '';
$new_user = true;
} else if ($password_new == '') {
ui_print_error_message(__('Passwords cannot be empty'));
$user_info = $values;

View File

@ -231,7 +231,7 @@ if ($save_event_filter) {
$values['id_name'] = get_parameter('id_name');
$values['id_group'] = get_parameter('id_group');
$values['event_type'] = get_parameter('event_type');
$values['severity'] = get_parameter('severity');
$values['severity'] = implode(',', get_parameter('severity', -1));
$values['status'] = get_parameter('status');
$values['search'] = get_parameter('search');
$values['text_agent'] = get_parameter('text_agent');
@ -278,7 +278,7 @@ if ($update_event_filter) {
$id = get_parameter('id');
$values['id_group'] = get_parameter('id_group');
$values['event_type'] = get_parameter('event_type');
$values['severity'] = get_parameter('severity');
$values['severity'] = implode(',', get_parameter('severity', -1));
$values['status'] = get_parameter('status');
$values['search'] = get_parameter('search');
$values['text_agent'] = get_parameter('text_agent');
@ -439,8 +439,10 @@ function load_form_filter() {
$("#id_group").val(val);
if (i == 'event_type')
$("#event_type").val(val);
if (i == 'severity')
$("#severity").val(val);
if (i == 'severity') {
const multiple = val.split(",");
$("#severity").val(multiple);
}
if (i == 'status')
$("#status").val(val);
if (i == 'search')
@ -1579,7 +1581,7 @@ if ($get_list_events_agents) {
$id_agent = get_parameter('id_agent');
$server_id = get_parameter('server_id');
$event_type = get_parameter('event_type');
$severity = get_parameter('severity');
$severity = implode(',', get_parameter('severity', -1));
$status = get_parameter('status');
$search = get_parameter('search');
$id_agent_module = get_parameter('id_agent_module');

View File

@ -1141,11 +1141,7 @@ if (check_login()) {
$draw_events = 0;
}
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;id='.$module['id_agente_modulo'].'&amp;label='.rawurlencode(
urlencode(
base64_encode($module['nombre'])
)
).'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 700)";
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;id='.$module['id_agente_modulo'].'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 700)";
if (!is_snapshot_data($module['datos'])) {
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;';
}

View File

@ -404,6 +404,13 @@ if ($search_minor) {
$return['have_minor'] = true;
$size_mr = get_number_of_mr($package, $ent, $offline);
$return['mr'] = $size_mr;
} else {
$product_name = io_safe_output(get_product_name());
$version = get_parameter('version', '');
db_pandora_audit(
'ERROR: Update '.$product_name,
'Update version of '.$product_name.' by '.$config['id_user'].' has failed.'
);
}
echo json_encode($return);

View File

@ -1658,7 +1658,6 @@ class NetworkMap
$node['style']['label'] = $node['name'];
}
$node['style']['shape'] = 'circle';
if (isset($source_data['color'])) {
$item['color'] = $source_data['color'];
} else {
@ -2960,7 +2959,7 @@ class NetworkMap
'',
0,
true
).'&nbsp;<span id="shape_icon_in_progress" style="display: none;">'.html_print_image('images/spinner.gif', true).'</span><span id="shape_icon_correct" style="display: none;">'.html_print_image('images/dot_green.png', true).'</span><span id="shape_icon_fail" style="display: none;">'.html_print_image('images/dot_red.png', true).'</span>';
).'&nbsp;<span id="shape_icon_in_progress" style="display: none;">'.html_print_image('images/spinner.gif', true).'</span><span id="shape_icon_correct" style="display: none;">'.html_print_image('images/success.png', true, ['width' => '18px']).'</span><span id="shape_icon_fail" style="display: none;">'.html_print_image('images/icono-bad.png', true, ['width' => '18px']).'</span>';
$table->data['node_name'][0] = __('Name');
$table->data['node_name'][1] = html_print_input_text(
'edit_name_node',

View File

@ -653,7 +653,6 @@ class Tree
'type' => $graphType,
'period' => SECONDS_1DAY,
'id' => $module['id'],
'label' => base64_encode($module['name']),
'refresh' => SECONDS_10MINUTES,
];

View File

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

View File

@ -146,7 +146,7 @@ function agents_get_next_contact_time_left(int $id_agente)
if ($id_agente > 0) {
$last_contact = db_get_value_sql(
sprintf(
'SELECT format(intervalo,2) - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto > ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto))) as "val"
'SELECT CAST(intervalo AS SIGNED) - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto >= ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto))) as "val"
FROM `tagente`
WHERE id_agente = %d ',
$id_agente
@ -3512,13 +3512,18 @@ function agents_get_status_animation($up=true)
function agents_get_agent_id_by_alias_regex($alias_regex, $flag='i', $limit=0)
{
$agents_id = [];
$all_agents = agents_get_agents(false, ['id_agente', 'alias']);
if (is_metaconsole()) {
$all_agents = agents_meta_get_agents('AR', '|');
} else {
$all_agents = agents_get_group_agents(0, true, 'lower', false, false, true, '|');
}
$agent_match = '/'.$alias_regex.'/'.$flag;
foreach ($all_agents as $agent) {
$result_agent_match = preg_match($agent_match, $agent['alias']);
foreach ($all_agents as $agent_id => $agent_alias) {
$result_agent_match = preg_match($agent_match, $agent_alias);
if ($result_agent_match) {
$agents_id[] = $agent['id_agente'];
$agents_id[] = $agent_id;
$i++;
if ($i === $limit) {
break;

View File

@ -551,8 +551,9 @@ function cron_list_table()
$report_per_agent = $args[0];
$report_name = $args[3];
$email = $args[4];
$data[2] .= '<br>- '.__('Template').": <a href='index.php?sec=reporting&sec2=operation/reporting/reporting_viewer";
$data[2] .= '&id='.$args[0]."'>".$template['name'].'</a>';
$data[2] .= '<br>- '.__('Template').': ';
$data[2] .= '<a href="'.ui_get_full_url('index.php?sec=reporting&sec2=enterprise/godmode/reporting/reporting_builder.template&action=edit&id_template='.$args[0]).'">';
$data[2] .= $template['name'].'</a>';
$data[2] .= '<br>- '.__('Agents').': '.$agents_id.'</a>';
$data[2] .= '<br>- '.__('Report per agent').': '.$report_per_agent.'</a>';
$data[2] .= '<br>- '.__('Report name').': '.$report_name.'</a>';

View File

@ -624,7 +624,37 @@ function events_update_status($id_evento, $status, $filter=null, $history=false)
break;
}
return db_process_sql($update_sql);
$result = db_process_sql($update_sql);
if ($result) {
switch ($status) {
case EVENT_STATUS_NEW:
$status_string = 'New';
break;
case EVENT_STATUS_VALIDATED:
$status_string = 'Validated';
break;
case EVENT_STATUS_INPROCESS:
$status_string = 'In process';
break;
default:
$status_string = '';
break;
}
events_comment(
$id_evento,
'',
'Change status to '.$status_string,
is_metaconsole() ? true : false,
$history
);
}
return $result;
}
@ -751,43 +781,78 @@ function events_get_all(
}
if (isset($filter['severity']) && $filter['severity'] > 0) {
switch ($filter['severity']) {
case EVENT_CRIT_MAINTENANCE:
case EVENT_CRIT_INFORMATIONAL:
case EVENT_CRIT_NORMAL:
case EVENT_CRIT_MINOR:
case EVENT_CRIT_WARNING:
case EVENT_CRIT_MAJOR:
case EVENT_CRIT_CRITICAL:
default:
$sql_filters[] = sprintf(
' AND criticity = %d ',
$filter['severity']
);
break;
if (is_array($filter['severity'])) {
if (!in_array(-1, $filter['severity'])) {
$not_normal = array_search(EVENT_CRIT_NOT_NORMAL, $filter['severity']);
if ($not_normal !== false) {
unset($filter['severity'][$not_normal]);
$sql_filters[] = sprintf(
' AND criticity != %d',
EVENT_CRIT_NORMAL
);
} else {
$critical_warning = array_search(EVENT_CRIT_WARNING_OR_CRITICAL, $filter['severity']);
if ($critical_warning !== false) {
unset($filter['severity'][$critical_warning]);
$filter['severity'][] = EVENT_CRIT_WARNING;
$filter['severity'][] = EVENT_CRIT_CRITICAL;
}
case EVENT_CRIT_WARNING_OR_CRITICAL:
$sql_filters[] = sprintf(
' AND (criticity = %d OR criticity = %d)',
EVENT_CRIT_WARNING,
EVENT_CRIT_CRITICAL
);
break;
$critical_normal = array_search(EVENT_CRIT_OR_NORMAL, $filter['severity']);
if ($critical_normal !== false) {
unset($filter['severity'][$critical_normal]);
$filter['severity'][] = EVENT_CRIT_NORMAL;
$filter['severity'][] = EVENT_CRIT_CRITICAL;
}
case EVENT_CRIT_NOT_NORMAL:
$sql_filters[] = sprintf(
' AND criticity != %d',
EVENT_CRIT_NORMAL
);
break;
if (!empty($filter['severity'])) {
$filter['severity'] = implode(',', $filter['severity']);
$sql_filters[] = sprintf(
' AND criticity IN (%s)',
$filter['severity']
);
}
}
}
} else {
switch ($filter['severity']) {
case EVENT_CRIT_MAINTENANCE:
case EVENT_CRIT_INFORMATIONAL:
case EVENT_CRIT_NORMAL:
case EVENT_CRIT_MINOR:
case EVENT_CRIT_WARNING:
case EVENT_CRIT_MAJOR:
case EVENT_CRIT_CRITICAL:
default:
$sql_filters[] = sprintf(
' AND criticity = %d ',
$filter['severity']
);
break;
case EVENT_CRIT_OR_NORMAL:
$sql_filters[] = sprintf(
' AND (criticity = %d OR criticity = %d)',
EVENT_CRIT_NORMAL,
EVENT_CRIT_CRITICAL
);
break;
case EVENT_CRIT_WARNING_OR_CRITICAL:
$sql_filters[] = sprintf(
' AND (criticity = %d OR criticity = %d)',
EVENT_CRIT_WARNING,
EVENT_CRIT_CRITICAL
);
break;
case EVENT_CRIT_NOT_NORMAL:
$sql_filters[] = sprintf(
' AND criticity != %d',
EVENT_CRIT_NORMAL
);
break;
case EVENT_CRIT_OR_NORMAL:
$sql_filters[] = sprintf(
' AND (criticity = %d OR criticity = %d)',
EVENT_CRIT_NORMAL,
EVENT_CRIT_CRITICAL
);
break;
}
}
}
@ -4116,7 +4181,6 @@ function events_page_details($event, $server='')
'type' => $graph_type,
'period' => SECONDS_1DAY,
'id' => $module['id_agente_modulo'],
'label' => base64_encode($module['nombre']),
'refresh' => SECONDS_10MINUTES,
];

View File

@ -106,12 +106,8 @@ if (!function_exists('mime_content_type')) {
finfo_close($finfo);
return $mimetype;
} else {
$temp = exec('file '.$filename);
if (isset($temp) && $temp != '') {
return $temp;
} else {
return 'application/octet-stream';
}
error_log('Warning: Cannot find finfo_open function. Fileinfo extension is not enabled. Please add "extension=fileinfo.so" or "extension=fileinfo.dll" in your php.ini');
return 'unknown';
}
}
@ -694,8 +690,9 @@ function filemanager_file_explorer(
$data[1] = '<a href="'.$url_file_clean.'">'.$fileinfo['name'].'</a>';
} else {
$hash = md5($relative_path.$config['dbpass']);
$data[1] = '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode(base64_encode($relative_path)).'&hash='.$hash.'">'.$fileinfo['name'].'</a>';
$filename = base64_encode($relative_directory.'/'.$fileinfo['name']);
$hash = md5($filename.$config['dbpass']);
$data[1] = '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'">'.$fileinfo['name'].'</a>';
}
// Notice that uploaded php files could be dangerous
@ -755,8 +752,9 @@ function filemanager_file_explorer(
}
if ((!$fileinfo['is_dir']) && ($download_button)) {
$hash = md5($fileinfo['realpath'].$config['dbpass']);
$data[4] .= '<a href="include/get_file.php?file='.urlencode(base64_encode($fileinfo['realpath'])).'&hash='.$hash.'" style="vertical-align: 25%;">';
$filename = base64_encode($fileinfo['name']);
$hash = md5($filename.$config['dbpass']);
$data[4] .= '<a href="include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'" style="vertical-align: 25%;">';
$data[4] .= html_print_image('images/file.png', true);
$data[4] .= '</a>';
}

View File

@ -1450,9 +1450,20 @@ function graphic_combined_module(
$data_module_graph['agent_name'] = modules_get_agentmodule_agent_name(
$agent_module_id
);
$data_module_graph['agent_alias'] = modules_get_agentmodule_agent_alias(
$agent_module_id
);
if (is_metaconsole()) {
$data_module_graph['agent_alias'] = db_get_value(
'alias',
'tagente',
'id_agente',
(int) $module_data['id_agente']
);
} else {
$data_module_graph['agent_alias'] = modules_get_agentmodule_agent_alias(
$agent_module_id
);
}
$data_module_graph['agent_id'] = $module_data['id_agente'];
$data_module_graph['module_name'] = $module_data['nombre'];
$data_module_graph['id_module_type'] = $module_data['id_tipo_modulo'];

View File

@ -1182,8 +1182,13 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*',
}
// Minutes
for ($i = 0; $i < 60; $i += 5) {
for ($i = 0; $i < 60; $i++) {
$minutes[$i] = $i;
// If minute is not a multiple of 5, then add style to option in order to hide it from minute select but still is a valid value that input can adopt. We want this in case a value that is not a multiple of 5 is entered in module's data configuration.
if (($i % 5) != 0) {
$minutes_hidden_options[$i] = 'display: none;';
}
}
// Month days
@ -1220,13 +1225,13 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*',
if ($to) {
$table->data[0][0] = html_print_select($hours, 'hour_to', $hour, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][1] = html_print_select($minutes, 'minute_to', $minute, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][1] = html_print_select($minutes, 'minute_to', $minute, '', __('Any'), '*', true, false, false, '', $disabled, false, $minutes_hidden_options);
$table->data[0][2] = html_print_select($mdays, 'mday_to', $mday, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][3] = html_print_select($months, 'month_to', $month, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][4] = html_print_select($wdays, 'wday_to', $wday, '', __('Any'), '*', true, false, false, '', $disabled);
} else {
$table->data[0][0] = html_print_select($hours, 'hour_from', $hour, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][1] = html_print_select($minutes, 'minute_from', $minute, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][1] = html_print_select($minutes, 'minute_from', $minute, '', __('Any'), '*', true, false, false, '', $disabled, false, $minutes_hidden_options);
$table->data[0][2] = html_print_select($mdays, 'mday_from', $mday, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][3] = html_print_select($months, 'month_from', $month, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][4] = html_print_select($wdays, 'wday_from', $wday, '', __('Any'), '*', true, false, false, '', $disabled);

View File

@ -190,6 +190,8 @@ function reporting_make_reporting_data(
$metaconsole_on = is_metaconsole();
$index_content = 0;
foreach ($contents as $content) {
$content['name'] = io_safe_input($content['name']);
$content['description'] = io_safe_input($content['description']);
if (!empty($content['id_agent_module']) && !empty($content['id_agent'])
&& tags_has_user_acl_tags($config['id_user'])
) {
@ -325,6 +327,17 @@ function reporting_make_reporting_data(
$content['id_agent']
);
// This is for metaconsole. It is an array with modules and server (id node).
if (is_array($content['id_agent_module'])) {
$modules_server_array = $content['id_agent_module'];
$modules_array = [];
foreach ($modules_server_array as $value) {
$modules_array[] = $value['module'];
}
$content['id_agent_module'] = $modules_array;
}
$modules = agents_get_modules(
$agent_value,
[
@ -4282,14 +4295,7 @@ function reporting_sql_graph(
case 'data':
$data = [];
foreach ($modules as $key => $value) {
$data[$value] = modules_get_agentmodule_data(
$value,
$content['period'],
$report['datetime']
);
}
$data = db_get_all_rows_sql($content['external_source']);
$return['chart'] = $data;
break;
}
@ -7614,16 +7620,18 @@ function reporting_custom_graph(
$content['name'] = __('Simple graph');
}
$module_source = db_get_all_rows_sql(
'SELECT id_agent_module
FROM tgraph_source
WHERE id_graph = '.$content['id_gs']
);
if ($type_report != 'automatic_graph') {
$module_source = db_get_all_rows_sql(
'SELECT id_agent_module
FROM tgraph_source
WHERE id_graph = '.$content['id_gs']
);
if (isset($module_source) && is_array($module_source)) {
$modules = [];
foreach ($module_source as $key => $value) {
$modules[$key] = $value['id_agent_module'];
if (isset($module_source) && is_array($module_source)) {
$modules = [];
foreach ($module_source as $key => $value) {
$modules[$key] = $value['id_agent_module'];
}
}
}
@ -7642,7 +7650,7 @@ function reporting_custom_graph(
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = io_safe_output($graph['name']);
$return['subtitle'] = $graph['name'];
$return['agent_name'] = $agent_alias;
$return['module_name'] = $module_name;
$return['description'] = $content['description'];

View File

@ -130,7 +130,7 @@ function html_do_report_info($report)
$html .= '</tr>
<tr>
<td valign="top"><b>'.__('Description').': </b></td><td>'.io_safe_output($report['description']).'</td>
<td valign="top"><b>'.__('Description').': </b></td><td>'.htmlspecialchars($report['description']).'</td>
</tr>
</table>'.'</div>';

View File

@ -321,7 +321,7 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t
$output = '<table cellspacing="0" cellpadding="0" id="'.$id.'" '.$attributes.'
class="info_box '.$id.' '.$class.' textodialogo" style="'.$force_style.'">
<tr>
<td class="icon" rowspan="2" style="padding-right: 10px; padding-top: 3px;">'.html_print_image($icon_image, true, false, false, false, true).'</td>
<td class="icon" rowspan="2" style="padding-right: 10px; padding-top: 3px;">'.html_print_image($icon_image, true, false, false, false, false).'</td>
<td class="title" style="text-transform: uppercase; padding-top: 10px;"><b>'.$text_title.'</b></td>
<td class="icon" style="text-align: right; padding-right: 3px;">';
if (!$no_close_bool) {

View File

@ -1593,6 +1593,7 @@ function visual_map_print_item(
case CLOCK:
if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
$image_prefix = (is_metaconsole()) ? '../../' : '';
if ($width == 0) {
if ($layoutData['id_metaconsole'] != 0) {
if ($layoutData['clock_animation'] == 'analogic_1') {
@ -1606,17 +1607,16 @@ function visual_map_print_item(
}
} else {
if ($layoutData['clock_animation'] == 'analogic_1') {
$img = '<img src="images/console/signes/clock.png" style="width:200px;height:240px;">';
$img = '<img src="'.$image_prefix.'images/console/signes/clock.png" style="width:200px;height:240px;">';
} else {
if ($layoutData['time_format'] == 'time') {
$img = '<img src="images/console/signes/digital-clock.png" style="width:200px;height:71px">';
$img = '<img src="'.$image_prefix.'images/console/signes/digital-clock.png" style="width:200px;height:71px">';
} else {
$img = '<img src="images/console/signes/digital-clock.png" style="width:200px;height:91px">';
$img = '<img src="'.$image_prefix.'images/console/signes/digital-clock.png" style="width:200px;height:91px">';
}
}
}
} else {
$image_prefix = ($layoutData['id_metaconsole'] != 0) ? '../../' : '';
if ($layoutData['clock_animation'] == 'analogic_1') {
$img = '<img src="'.$image_prefix.'images/console/signes/clock.png" style="width:'.$width.'px;height:'.($width + 40).'px;">';
} else {
@ -1901,7 +1901,7 @@ function visual_map_print_item(
}
} else {
$is_meta = is_metaconsole();
$agents_critical = agents_get_agents(
[
'disabled' => 0,

View File

@ -29,29 +29,42 @@ if ($auth_method != 'ad' && $auth_method != 'ldap') {
$styleError = 'background:url("../images/err.png") no-repeat scroll 0 0 transparent; padding:4px 1px 6px 30px; color:#CC0000;';
$file = get_parameter('file', null);
$file_raw = get_parameter('file', null);
$file = base64_decode($file);
$file = base64_decode(urldecode($file_raw));
$hash = get_parameter('hash', null);
$testHash = md5($file.$config['dbpass']);
if ($hash != $testHash) {
if ($file === '' || $hash === '' || $hash !== md5($file_raw.$config['dbpass']) || !isset($_SERVER['HTTP_REFERER'])) {
echo "<h3 style='".$styleError."'>".__('Security error. Please contact the administrator.').'</h3>';
} else if (!empty($file) && !empty($hash)) {
// echo $file;
if (!file_exists($file)) {
$file = $_SERVER['DOCUMENT_ROOT'].$file;
} else {
$downloadable_file = '';
$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
$parse_sec2_query = explode('=', $parse_all_queries[1]);
if ($parse_sec2_query[0] === 'sec2') {
switch ($parse_sec2_query[1]) {
case 'godmode/setup/file_manager':
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/'.$file;
break;
case 'extensions/files_repo':
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/files_repo/'.$file;
break;
default:
$downloadable_file = '';
// Do nothing
break;
}
}
if (!file_exists($file)) {
if ($downloadable_file === '' || !file_exists($downloadable_file)) {
echo "<h3 style='".$styleError."'>".__('File is missing in disk storage. Please contact the administrator.').'</h3>';
} else {
header('Content-type: aplication/octet-stream;');
header('Content-type: '.mime_content_type($file).';');
header('Content-Length: '.filesize($file));
header('Content-Disposition: attachment; filename="'.basename($file).'"');
readfile($file);
header('Content-type: '.mime_content_type($downloadable_file).';');
header('Content-Length: '.filesize($downloadable_file));
header('Content-Disposition: attachment; filename="'.basename($downloadable_file).'"');
readfile($downloadable_file);
}
}

View File

@ -214,8 +214,8 @@ function show_massive_response_dialog(
$("#button-submit_event_response").show();
},
close: function() {
$("#checkbox-all_validate_box").prop("checked", false);
$(".chk_val").prop("checked", false);
$("#event_response_command_window").dialog("close");
},
width: response["modal_width"],
height: response["modal_height"]

View File

@ -30,7 +30,6 @@ div.mini-criticity.h100p {
form.flex-row div.filter_input,
form.flex-row ul {
width: 30%;
min-width: 300px;
display: flex;
flex-direction: row;
align-items: baseline;
@ -47,12 +46,13 @@ div.filter_input_little {
flex-direction: row;
align-items: baseline;
flex-wrap: nowrap;
margin: 0.5em 0 0.5em 1em;
margin: 0.5em 0 0.5em 0em;
}
form.flex-row div.filter_input.large {
flex: 1;
min-width: 470px;
min-width: 700px;
max-width: 100%;
}
div.filter_input > label,
@ -120,6 +120,8 @@ table.dataTable tbody td {
.filter_input {
align-items: center;
min-width: 400px;
max-width: 450px;
}
.filter_input_little > select,

View File

@ -913,15 +913,15 @@ div#head {
min-width: 882px;
background-color: #fff;
color: #000;
z-index: 2;
z-index: 11;
}
.fixed_header {
z-index: 9999;
position: fixed;
left: 0;
top: 0;
width: 100%;
z-index: 11;
}
#ver {

View File

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

View File

@ -317,7 +317,7 @@ $data[1] = ui_progress(
1.8,
'#BBB',
true,
floor(($agent['intervalo'] * (100 - $progress) / 100)).' s',
($agent['intervalo'] - (strtotime('now') - strtotime($agent['ultimo_contacto']))).' s',
[
'page' => 'operation/agentes/ver_agente',
'interval' => (100 / $agent['intervalo']),

View File

@ -49,11 +49,10 @@ if (file_exists('../../include/languages/'.$user_language.'.mo')) {
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css"/>';
$label = get_parameter('label');
$label = base64_decode($label);
$id = get_parameter('id');
$id_agent = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $id);
$alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
$id = get_parameter('id');
$id_agent = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $id);
$alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
$label = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id);
// $agent = agents_get_agent_with_ip ("192.168.50.31");
// $label = rawurldecode(urldecode(base64_decode(get_parameter('label', ''))));
?>
@ -117,8 +116,6 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
$period = get_parameter('period');
$id = get_parameter('id', 0);
$label = get_parameter('label', '');
$label_graph = base64_decode(get_parameter('label', ''));
$start_date = get_parameter('start_date', date('Y/m/d'));
$start_time = get_parameter('start_time', date('H:i:s'));
$draw_events = get_parameter('draw_events', 0);
@ -190,7 +187,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
'agent_module_id' => $id,
'period' => $period,
'show_events' => $draw_events,
'title' => $label_graph,
'title' => $label,
'unit_name' => $unit,
'show_alerts' => $draw_alerts,
'date' => $date,

View File

@ -1502,7 +1502,6 @@ if (!empty($result)) {
'type' => $graph_type,
'period' => SECONDS_1DAY,
'id' => $row['id_agente_modulo'],
'label' => base64_encode($row['module_name']),
'refresh' => SECONDS_10MINUTES,
];

View File

@ -135,6 +135,10 @@ $id_agent = get_parameter(
'filter[id_agent]',
$filter['id_agent']
);
$text_module = get_parameter(
'filter[text_module]',
$filter['text_module']
);
$id_agent_module = get_parameter(
'filter[id_agent_module]',
$filter['id_agent_module']
@ -210,10 +214,38 @@ $id_source_event = get_parameter(
$filter['id_source_event']
);
$server_id = get_parameter(
'filter[server_id]',
$filter['id_server_meta']
);
if (is_metaconsole()) {
// Connect to node database.
$id_node = $server_id;
if ($id_node != 0) {
if (metaconsole_connect(null, $id_node) != NOERR) {
return false;
}
}
}
if (empty($text_agent) && !empty($id_agent)) {
$text_agent = agents_get_alias($id_agent);
}
if (empty($text_module) && !empty($id_agent_module)) {
$text_module = modules_get_agentmodule_name($id_agent_module);
$text_agent = agents_get_alias(modules_get_agentmodule_agent($id_agent_module));
}
if (is_metaconsole()) {
// Return to metaconsole database.
if ($id_node != 0) {
metaconsole_restore_db();
}
}
// Ajax responses.
if (is_ajax()) {
$get_events = get_parameter('get_events', 0);
@ -862,22 +894,6 @@ $in = '<div class="filter_input"><label>'.__('Event type').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
// Criticity - severity.
$severity_select .= html_print_select(
get_priorities(),
'severity',
$severity,
'',
__('All'),
'-1',
true,
false,
false
);
$in = '<div class="filter_input"><label>'.__('Severity').'</label>';
$in .= $severity_select.'</div>';
$inputs[] = $in;
// Event status.
$data = html_print_select(
events_get_all_status(),
@ -929,6 +945,28 @@ $in = '<div class="filter_input"><label>'.__('Free search').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
if (empty($severity) && $severity !== '0') {
$severity = -1;
}
// Criticity - severity.
$data = html_print_select(
get_priorities(),
'severity',
$severity,
'',
__('All'),
-1,
true,
true,
true,
'',
false
);
$in = '<div class="filter_input"><label>'.__('Severity').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
$buttons = [];
$buttons[] = [
@ -1083,8 +1121,6 @@ if (is_metaconsole()) {
$adv_inputs[] = $in;
}
// Gap.
$adv_inputs[] = '<div class="filter_input"></div>';
// Date from.
$data = html_print_input_text(
@ -1634,6 +1670,10 @@ function process_datatables_callback(table, settings) {
}
// Uncheck checkbox to select all.
if ($('#checkbox-all_validate_box').length) {
$('#checkbox-all_validate_box').uncheck();
}
}
function process_datatables_item(item) {

View File

@ -152,11 +152,7 @@ if (!$modules || !$searchModules) {
$url = 'include/procesos.php?agente='.$module['id_agente_modulo'];
$win_handle = dechex(crc32($module['id_agente_modulo'].$module['module_name']));
$link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module['id_agente_modulo'].'&'.'label='.rawurlencode(
urlencode(
base64_encode($module['module_name'])
)
).'&'.'refresh='.SECONDS_10MINUTES."', "."'day_".$win_handle."')";
$link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module['id_agente_modulo'].'&'.'refresh='.SECONDS_10MINUTES."', "."'day_".$win_handle."')";
$graphCell = '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => 0, 'alt' => '']).'</a>';
$graphCell .= '&nbsp;'."<a href='index.php?".'sec=estado&amp;'.'sec2=operation/agentes/ver_agente&amp;'.'id_agente='.$module['id_agente'].'&amp;'.'tab=data_view&'.'period='.SECONDS_1DAY.'&amp;'.'id='.$module['id_agente_modulo']."'>".html_print_image(

View File

@ -87,8 +87,8 @@ if ($layout) {
$id_layout,
true,
true,
$width,
$height,
$bwidth,
$bheight,
'../../',
true,
true,
@ -196,7 +196,6 @@ $ignored_params['refr'] = '';
$('body').css('background-color','<?php echo $layout['background_color']; ?>');
$('body').css('margin','0');
$('body').css('height','100%');
$('body').css('overflow','hidden');
$(".module_graph .menu_graph").css('display','none');

View File

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

View File

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

View File

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

View File

@ -1098,7 +1098,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` (
`id_name` varchar(600) NOT NULL,
`id_group` int(10) NOT NULL default 0,
`event_type` text NOT NULL,
`severity` int(10) NOT NULL default -1,
`severity` text NOT NULL,
`status` int(10) NOT NULL default -1,
`search` TEXT,
`text_agent` TEXT,

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.742-200107
Version: 7.0NG.742-200114
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.742 PS200107";
my $version = "7.0NG.742 PS200114";
# Pandora server configuration
my %conf;

View File

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