Merge remote-tracking branch 'origin/develop' into ent-3997-anadir-posicionamiento-a-los-elementos-de-la-consola-visual

This commit is contained in:
Alejandro Gallardo Escobar 2019-06-19 15:19:38 +02:00
commit 08f100d608
55 changed files with 398 additions and 270 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.735-190612
Version: 7.0NG.735-190619
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.735-190612"
pandora_version="7.0NG.735-190619"
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

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.735';
use constant AGENT_BUILD => '190612';
use constant AGENT_BUILD => '190619';
# 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.735
%define release 190612
%define release 190619
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.735"
PI_BUILD="190612"
PI_BUILD="190619"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190612}
{190619}
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.735(Build 190612)")
#define PANDORA_VERSION ("7.0NG.735(Build 190619)")
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.735(Build 190612))"
VALUE "ProductVersion", "(7.0NG.735(Build 190619))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.735-190612
Version: 7.0NG.735-190619
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.735-190612"
pandora_version="7.0NG.735-190619"
package_pear=0
package_pandora=1

View File

@ -1,23 +1,24 @@
<?php
/**
* Pandora FMS - http://pandorafms.com
* ==================================================
* Copyright (c) 2005-2011 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; 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.
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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; 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.
$refr = (int) get_parameter('refresh', 0);
// By default 30 seconds
function mainAgentsModules()
{
global $config;
// Load global vars
// Load global vars.
include_once 'include/config.php';
include_once 'include/functions_reporting.php';
include_once $config['homedir'].'/include/functions_agents.php';
@ -25,7 +26,7 @@ function mainAgentsModules()
include_once $config['homedir'].'/include/functions_users.php';
check_login();
// ACL Check
// ACL Check.
if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit(
'ACL Violation',
@ -37,7 +38,7 @@ function mainAgentsModules()
// Update network modules for this group
// Check for Network FLAG change request
// Made it a subquery, much faster on both the database and server side
// Made it a subquery, much faster on both the database and server side.
if (isset($_GET['update_netgroup'])) {
$group = get_parameter_get('update_netgroup', 0);
if (check_acl($config['id_user'], $group, 'AW')) {
@ -62,7 +63,7 @@ function mainAgentsModules()
$modulegroup = get_parameter('modulegroup', 0);
$refr = (int) get_parameter('refresh', 0);
// By default 30 seconds
// By default 30 seconds.
$recursion = get_parameter('recursion', 0);
$group_id = (int) get_parameter('group_id', 0);
$offset = (int) get_parameter('offset', 0);
@ -79,7 +80,8 @@ function mainAgentsModules()
$full_modules_selected = explode(';', get_parameter('full_modules_selected', 0));
$full_agents_id = explode(';', get_parameter('full_agents_id', 0));
if ($save_serialize && $update_item == '') {
// In full screen there is no pagination neither filters.
if (( ($config['pure'] == 0 && $save_serialize) && $update_item == '' ) || ( ($config['pure'] == 1 && $save_serialize == 0) && $update_item == '' )) {
$unserialize_modules_selected = unserialize_in_temp($config['id_user'].'_agent_module', true, 1);
$unserialize_agents_id = unserialize_in_temp($config['id_user'].'_agents', true, 1);
if ($unserialize_modules_selected) {
@ -102,7 +104,6 @@ function mainAgentsModules()
serialize_in_temp($agents_id, $config['id_user'].'_agents', 1);
}
// if($agents_id != -1) $agents_id = null;
if ($config['pure'] == 0) {
if ($modules_selected[0] && $agents_id[0]) {
$full_modules = urlencode(implode(';', $modules_selected));
@ -124,13 +125,13 @@ function mainAgentsModules()
}
}
// groups
// Groups.
$filter_groups_label = '<b>'.__('Group').'</b>';
$filter_groups = html_print_select_groups(false, 'AR', true, 'group_id', $group_id, '', '', '', true, false, true, '', false, 'width: auto;');
$filter_recursion_label = '<b>'.__('Recursion').'</b>';
$filter_recursion = html_print_checkbox('recursion', 1, 0, true);
// groups module
// Groups module.
$filter_module_groups_label = '<b>'.__('Module group').'</b>';
$filter_module_groups = html_print_select_from_sql(
'SELECT * FROM tmodule_group ORDER BY name',
@ -146,7 +147,7 @@ function mainAgentsModules()
'width: auto;'
);
// agent
// Agent.
$agents = agents_get_group_agents($group_id);
if ((empty($agents)) || $agents == -1) {
$agents = [];
@ -155,7 +156,7 @@ function mainAgentsModules()
$filter_agents_label = '<b>'.__('Agents').'</b>';
$filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, 'min-width: 180px; max-width: 200px;');
// type show
// Type show.
$selection = [
0 => __('Show common modules'),
1 => __('Show all modules'),
@ -163,12 +164,12 @@ function mainAgentsModules()
$filter_type_show_label = '<b>'.__('Show common modules').'</b>';
$filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', '', 0, true, false, true, '', false, 'min-width: 180px;');
// modules
// Modules.
$all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false);
$filter_modules_label = '<b>'.__('Module').'</b>';
$filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, false, '', false, 'min-width: 180px; max-width: 200px;');
// update
// Update.
$filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true);
$onheader = [
@ -178,8 +179,11 @@ function mainAgentsModules()
'combo_groups' => $filter_groups,
];
// Old style table, we need a lot of special formatting,don't use table function
// Prepare old-style table
/*
* Old style table, we need a lot of special formatting,don't use table function.
* Prepare old-style table.
*/
if ($config['pure'] == 0) {
// Header.
ui_print_page_header(
@ -200,38 +204,51 @@ function mainAgentsModules()
$full_modules = urlencode(implode(';', $full_modules_selected));
$full_agents = urlencode(implode(';', $full_agents_id));
$url = " index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset
$url = 'index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset
&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr&full_modules_selected=$full_modules
&full_agents_id=$full_agents&selection_agent_module=$selection_a_m";
&full_agents_id=$full_agents&selection_agent_module=$selection_a_m';
} else {
$url = " index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr";
$url = 'index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr';
}
// Floating menu - Start
// Floating menu - Start.
echo '<div id="vc-controls" style="z-index: 999">';
echo '<div id="menu_tab">';
echo '<ul class="mn">';
// Quit fullscreen
// Quit fullscreen.
echo '<li class="nomn">';
echo '<a target="_top" href="'.$url.'">';
echo html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]);
echo '</a>';
echo '</li>';
// Countdown
// Countdown.
echo '<li class="nomn">';
echo '<div class="vc-refr">';
echo '<div class="vc-countdown"></div>';
echo '<div class="vc-countdown style="display: inline;"></div>';
echo '<div id="vc-refr-form">';
echo __('Refresh').':';
echo html_print_select(get_refresh_time_array(), 'refresh', $refr, '', '', 0, true, false, false);
echo html_print_select(
get_refresh_time_array(),
'refresh',
$refr,
'',
'',
0,
true,
false,
false,
'',
false,
'margin-top: 3px;'
);
echo '</div>';
echo '</div>';
echo '</li>';
// Console name
// Console name.
echo '<li class="nomn">';
echo '<div class="vc-title">'.__('Agent/module view').'</div>';
echo '</li>';
@ -240,35 +257,35 @@ function mainAgentsModules()
echo '</div>';
echo '</div>';
// Floating menu - End
// Floating menu - End.
ui_require_jquery_file('countdown');
}
if ($config['pure'] != 1) {
echo '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'">';
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
echo '<tr>';
echo '<td>'.$filter_groups_label.'</td>';
echo '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>';
echo '<td></td>';
echo '<td></td>';
echo '<td>'.$filter_module_groups_label.'</td>';
echo '<td>'.$filter_module_groups.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.$filter_agents_label.'</td>';
echo '<td>'.$filter_agents.'</td>';
echo '<td>'.$filter_type_show_label.'</td>';
echo '<td>'.$filter_type_show.'</td>';
echo '<td>'.$filter_modules_label.'</td>';
echo '<td>'.$filter_modules.'</td>';
echo '</tr>';
echo '<tr>';
echo "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</sapn></td>';
echo '</tr>';
echo '</table>';
echo '</form>';
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" style="width:100%;">';
$show_filters .= '<table class="white_table" cellpadding="0" cellspacing="0" border="0" style="width:100%; border:none;">';
$show_filters .= '<tr>';
$show_filters .= '<td>'.$filter_groups_label.'</td>';
$show_filters .= '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>';
$show_filters .= '<td></td>';
$show_filters .= '<td></td>';
$show_filters .= '<td>'.$filter_module_groups_label.'</td>';
$show_filters .= '<td>'.$filter_module_groups.'</td>';
$show_filters .= '</tr>';
$show_filters .= '<tr>';
$show_filters .= '<td>'.$filter_agents_label.'</td>';
$show_filters .= '<td>'.$filter_agents.'</td>';
$show_filters .= '<td>'.$filter_type_show_label.'</td>';
$show_filters .= '<td>'.$filter_type_show.'</td>';
$show_filters .= '<td>'.$filter_modules_label.'</td>';
$show_filters .= '<td>'.$filter_modules.'</td>';
$show_filters .= '</tr>';
$show_filters .= '<tr>';
$show_filters .= "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</sapn></td>';
$show_filters .= '</tr>';
$show_filters .= '</table>';
$show_filters .= '</form>';
ui_toggle($show_filters, __('Filters'));
}
if ($agents_id[0] != -1) {
@ -291,7 +308,7 @@ function mainAgentsModules()
$count = 0;
foreach ($agents as $agent) {
// TODO TAGS agents_get_modules
// TODO TAGS agents_get_modules.
$module = agents_get_modules(
$agent,
false,
@ -339,7 +356,7 @@ function mainAgentsModules()
}
}
} else {
// TODO TAGS agents_get_modules
// TODO TAGS agents_get_modules.
$all_modules = agents_get_modules(
$agents,
false,
@ -414,11 +431,11 @@ function mainAgentsModules()
if ($hor_offset > 0) {
$new_hor_offset = ($hor_offset - $block);
echo "<th width='20px' "."style='vertical-align:top; padding-top: 35px;' "."rowspan='".($nagents + 1)."'>"."<a href='index.php?".'extension_in_menu=estado&'.'sec=extensions&'.'sec2=extensions/agents_modules&'.'refr=0&'.'save_serialize=1&'.'selection_a_m='.$selection_a_m.'&'.'hor_offset='.$new_hor_offset.'&'.'offset='.$offset."'>".html_print_image(
'images/arrow_left.png',
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&refr=0&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
'images/arrow_left_green.png',
true,
['title' => __('Previous modules')]
).'</a>'.'</th>';
).'</a></th>';
}
$nmodules = 0;
@ -440,11 +457,11 @@ function mainAgentsModules()
if (($hor_offset + $block) < $nmodules) {
$new_hor_offset = ($hor_offset + $block);
echo "<th width='20px' "."style='vertical-align:top; padding-top: 35px;' "."rowspan='".($nagents + 1)."'>"."<a href='index.php?".'extension_in_menu=estado&'.'sec=extensions&'.'sec2=extensions/agents_modules&'.'save_serialize=1&'.'selection_a_m='.$selection_a_m.'&'.'hor_offset='.$new_hor_offset.'&'.'offset='.$offset."'>".html_print_image(
'images/arrow.png',
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
'images/arrow_right_green.png',
true,
['title' => __('More modules')]
).'</a>'.'</th>';
).'</a></th>';
}
echo '</tr>';
@ -457,12 +474,12 @@ function mainAgentsModules()
$filter_agents['id_grupo'] = $group_id;
}
// Prepare pagination
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&'.'hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m;
// Prepare pagination.
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m;
ui_pagination($total_pagination, $url);
foreach ($agents as $agent) {
// Get stats for this group
// Get stats for this group.
$agent_status = agents_get_status($agent['id_agente']);
$alias = db_get_row('tagente', 'id_agente', $agent['id_agente']);
if (empty($alias['alias'])) {
@ -471,29 +488,29 @@ function mainAgentsModules()
switch ($agent_status) {
case 4:
// Alert fired status
// Alert fired status.
$rowcolor = 'group_view_alrm';
break;
case 1:
// Critical status
// Critical status.
$rowcolor = 'group_view_crit';
break;
case 2:
// Warning status
// Warning status.
$rowcolor = 'group_view_warn';
break;
case 0:
// Normal status
// Normal status.
$rowcolor = 'group_view_ok';
break;
case 3:
case -1:
default:
// Unknown status
// Unknown status.
$rowcolor = 'group_view_unk';
break;
}
@ -502,7 +519,7 @@ function mainAgentsModules()
echo "<td class='$rowcolor'>
<a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>".$alias['alias'].'</a></td>';
// TODO TAGS agents_get_modules
// TODO TAGS agents_get_modules.
$agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, true);
$nmodules = 0;
@ -572,18 +589,23 @@ function mainAgentsModules()
echo '</table>';
echo "<div class='legend_basic' style='width: 96%'>";
$show_legend = "<div class='legend_white'>";
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></div>".__('Orange cell when the module has fired alerts').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></div>".__('Red cell when the module has a critical status').'
</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></div>".__('Yellow cell when the module has a warning status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></div>".__('Green cell when the module has a normal status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></div>".__('Grey cell when the module has an unknown status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></div>".__("Cell turns blue when the module is in 'not initialize' status").'</div>';
$show_legend .= '</div>';
ui_toggle($show_legend, __('Legend'));
echo '<table>';
echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>".__('Legend').'</b></td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></td><td>".__('Orange cell when the module has fired alerts').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Red cell when the module has a critical status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module has a warning status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></td><td>".__('Green cell when the module has a normal status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></td><td>".__('Grey cell when the module has an unknown status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></td><td>".__("Cell turns blue when the module is in 'not initialize' status").'</td></tr>';
echo '</table>';
echo '</div>';
$pure_var = $config['pure'];
if ($pure_var) {
$pure_var = 1;
@ -627,15 +649,13 @@ $ignored_params['refresh'] = '';
$.each($('.th_class_module_r'), function (i, elem) {
id = $(elem).attr('id').replace('th_module_r_', '');
$("#th_module_r_" + id).height(($("#div_module_r_" + id).width() + 10) + 'px');
//$("#div_module_r_" + id).css('margin-top', (max_width - $("#div_module_r_" + id).width()) + 'px');
$("#div_module_r_" + id).css('margin-top', (max_width - 20) + 'px');
$("#div_module_r_" + id).show();
});
var refr =" . $refr . ";
var pure =" . $pure_var . ";
var href ='" . ui_get_url_refresh ($ignored_params) . "';
var refr = '<?php echo get_parameter('refresh', 0); ?>';
var pure = '<?php echo get_parameter('pure', 0); ?>';
var href =' <?php echo ui_get_url_refresh($ignored_params); ?>';
if (pure) {
var startCountDown = function (duration, cb) {
@ -646,7 +666,7 @@ $ignored_params['refresh'] = '';
$('div.vc-countdown').countdown({
until: t,
format: 'MS',
layout: '(%M%nn%M:%S%nn%S Until refresh)',
layout: '(%M%nn%M:%S%nn%S <?php echo __('Until next'); ?>) ',
alwaysExpire: true,
onExpiry: function () {
$('div.vc-countdown').countdown('destroy');
@ -656,7 +676,10 @@ $ignored_params['refresh'] = '';
});
}
if(refr>0){
startCountDown(refr, false);
}
var controls = document.getElementById('vc-controls');
autoHideElement(controls, 1000);

View File

@ -1,3 +0,0 @@
/general/login_identification_wizard.php
/general/login_required.php
/godmode/update_manager/update_manager.messages.php

View File

@ -19,8 +19,8 @@ if (isset($config['homedir'])) {
ui_require_css_file('login');
require_once $homedir.'include/functions_ui.php';
require_once $homedir.'include/functions.php';
require_once __DIR__.'/../include/functions_ui.php';
require_once __DIR__.'/../include/functions.php';
require_once __DIR__.'/../include/functions_html.php';

View File

@ -322,7 +322,7 @@ if ($create_modules) {
} else if (preg_match('/ifAdminStatus/', $name_array[1])) {
$module_type = 2;
} else if (preg_match('/ifOperStatus/', $name_array[1])) {
$module_type = 18;
$module_type = 2;
} else {
$module_type = 4;
}
@ -684,4 +684,3 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
/* ]]> */
</script>

View File

@ -83,8 +83,8 @@ $data[3] = html_print_input_password(
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
$classdisabledBecauseInPolicy,
'new-password'
);
push_table_simple($data, 'user_pass');

View File

@ -725,7 +725,6 @@ echo '</form>';
}
});
$modulesSelect.change();
}
var processGet = function (params, callback) {

View File

@ -221,7 +221,7 @@ switch ($action) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && $server_name != '') {
if ($meta && !empty($server_name)) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
continue;
@ -547,8 +547,43 @@ switch ($action) {
break;
case 'event_report_agent':
case 'event_report_group':
$description = $item['description'];
$period = $item['period'];
$group = $item['id_group'];
$recursion = $item['recursion'];
$idAgent = $item['id_agent'];
$idAgentModule = $item['id_agent_module'];
$show_summary_group = $style['show_summary_group'];
$filter_event_severity = json_decode($style['filter_event_severity'], true);
$filter_event_status = json_decode($style['filter_event_status'], true);
$filter_event_type = json_decode($style['filter_event_type'], true);
$event_graph_by_user_validator = $style['event_graph_by_user_validator'];
$event_graph_by_criticity = $style['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
$include_extended_events = $item['show_extended_events'];
$filter_search = $style['event_filter_search'];
break;
case 'event_report_group':
$description = $item['description'];
$period = $item['period'];
$group = $item['id_group'];
$recursion = $item['recursion'];
$event_graph_by_agent = $style['event_graph_by_agent'];
$event_graph_by_user_validator = $style['event_graph_by_user_validator'];
$event_graph_by_criticity = $style['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
$filter_search = $style['event_filter_search'];
$include_extended_events = $item['show_extended_events'];
break;
@ -2805,7 +2840,7 @@ function print_SLA_list($width, $action, $idItem=null)
foreach ($itemsSLA as $item) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && $server_name != '') {
if ($meta && !empty($server_name)) {
$connection = metaconsole_get_connection(
$server_name
);
@ -3133,7 +3168,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
foreach ($itemsGeneral as $item) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && $server_name != '') {
if ($meta && !empty($server_name)) {
$connection = metaconsole_get_connection(
$server_name
);
@ -3491,6 +3526,7 @@ $(document).ready (function () {
$("#submit-create_item").click(function () {
var type = $('#type').val();
var name = $('#text-name').val();
switch (type){
case 'alert_report_module':
case 'alert_report_agent':
@ -3521,6 +3557,13 @@ $(document).ready (function () {
default:
break;
}
if($('#text-name').val() == ''){
alert( <?php echo "'".__('Please insert a name')."'"; ?> );
return false;
}
});
$("#submit-edit_item").click(function () {

View File

@ -1348,6 +1348,8 @@ switch ($action) {
$values['description'] = get_parameter('description');
$values['type'] = get_parameter('type', null);
$values['recursion'] = get_parameter('recursion', null);
$values['show_extended_events'] = get_parameter('include_extended_events', null);
$label = get_parameter('label', '');
// Add macros name.
@ -1903,8 +1905,8 @@ switch ($action) {
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
$style['event_filter_search'] = $event_filter_search;
if ($label != '') {
$style['label'] = $label;
} else {
@ -2010,6 +2012,7 @@ switch ($action) {
);
$name_it = (string) get_parameter('name');
$values['recursion'] = get_parameter('recursion', null);
$values['show_extended_events'] = get_parameter('include_extended_events', null);
$values['name'] = reporting_label_macro(
$items_label,
$name_it
@ -2421,6 +2424,7 @@ switch ($action) {
case 'event_report_agent':
case 'event_report_group':
case 'event_report_module':
$show_summary_group = get_parameter(
'show_summary_group',
0
@ -2476,11 +2480,6 @@ switch ($action) {
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
switch ($values['type']) {
case 'event_report_group':
case 'event_report_agent':
$style['event_filter_search'] = $event_filter_search;
if ($label != '') {
$style['label'] = $label;
@ -2489,12 +2488,6 @@ switch ($action) {
}
break;
default:
// Default.
break;
}
break;
case 'simple_graph':
// Warning. We are using this column to hold
// this value to avoid the modification

View File

@ -254,7 +254,12 @@ function update_button_palette_callback() {
var values = {};
values = readFields();
if (values["map_linked"] == 0) {
if (values["agent"] == "" || values["agent"] == "none") {
dialog_message("#message_alert_no_agent");
return false;
}
}
// TODO VALIDATE DATA
switch (selectedItem) {
case "background":
@ -1260,6 +1265,7 @@ function create_button_palette_callback() {
dialog_message("#message_alert_max_height");
validate = false;
}
break;
case "group_item":
if (values["height"] == "") {
@ -1323,6 +1329,12 @@ function create_button_palette_callback() {
dialog_message("#message_alert_no_image");
validate = false;
}
if (values["map_linked"] == 0) {
if (values["agent"] == "" || values["agent"] == "none") {
dialog_message("#message_alert_no_agent");
validate = false;
}
}
break;
case "auto_sla_graph":

View File

@ -135,7 +135,9 @@ $table->data[9][0] = '<strong>'.__('Licensed to').'</strong>';
$table->data[9][1] = html_print_input_text('licensed_to', $license['licensed_to'], '', 64, 255, true, true);
html_print_table($table);
if (enterprise_installed()) {
// If DESTDIR is defined the enterprise license is expired.
if (enterprise_installed() || defined('DESTDIR')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('update_settings', 1);
html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"');

View File

@ -659,18 +659,18 @@ class Wizard
if ($input['arguments']['inline'] != 'true') {
$output .= '<div class="edit_discovery_input">';
} else {
$output .= '<div style="display: flex; margin-bottom: 25px;">';
$output .= '<div style="display: flex; margin-bottom: 25px; flex-wrap: wrap;">';
if (!isset($input['extra'])) {
$output .= '<div style="width: 50%;">';
}
if (isset($input['extra'])) {
$output .= '<div style="width: 50%; display: flex;">';
$output .= '<div style="display: flex; margin-right:10px;">';
}
}
if ($input['arguments']['inline'] == 'true' && isset($input['extra'])) {
$output .= '<div style="width: 50%">';
$output .= '<div style="margin-right:10px;">';
}
$output .= '<div class="label_select">';
@ -690,11 +690,11 @@ class Wizard
$output .= $this->printInput($input['arguments']);
$output .= '</div>';
} else if ($input['arguments']['inline'] == 'true') {
$output .= '<div style="width: 50%;">';
if (isset($input['extra'])) {
$output .= '<div style="float: center;">';
$output .= '<div style="">';
$output .= '<div style="float: left;">';
} else {
$output .= '<div style="width:50%;">';
$output .= '<div style="float: right;">';
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

View File

@ -392,11 +392,16 @@ if (check_login()) {
switch ($row['module_type']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id);
// System Uptime:
// In case of System Uptime module, shows data in format "Days hours minutes seconds" if and only if
// selected module unit is "_timeticks_"
// Take notice that selected unit may not be postrocess unit
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') {
if ($post_process > 0) {
$data[] = human_milliseconds_to_string(($row['data'] / $post_process));
$data_macro = modules_get_unit_macro($row[$attr[0]], $unit);
if ($data_macro) {
$data[] = $data_macro;
} else {
$data[] = human_milliseconds_to_string($row['data']);
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
}
} else {
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));

View File

@ -72,6 +72,8 @@ class TreeService extends Tree
protected function getFirstLevel()
{
global $config;
$processed_items = $this->getProcessedServices();
$ids = array_keys($processed_items);

View File

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

View File

@ -65,7 +65,7 @@ define('ERR_NODATA', -70000);
define('ERR_CONNECTION', -80000);
define('ERR_DISABLED', -90000);
define('ERR_WRONG', -100000);
define('ERR_WRONG_NAME', -100001);
define('ERR_WRONG_MR', -100001);
define('ERR_WRONG_PARAMETERS', -100002);
define('ERR_ACL', -110000);
define('ERR_AUTH', -120000);

View File

@ -1392,6 +1392,11 @@ function enterprise_installed()
{
$return = false;
// Load enterprise extensions.
if (defined('DESTDIR')) {
return $return;
}
if (defined('PANDORA_ENTERPRISE')) {
if (PANDORA_ENTERPRISE) {
$return = true;
@ -1444,7 +1449,7 @@ function enterprise_include($filename)
{
global $config;
// Load enterprise extensions
// Load enterprise extensions.
if (defined('DESTDIR')) {
$destdir = DESTDIR;
} else {
@ -1470,11 +1475,24 @@ function enterprise_include($filename)
}
/**
* Includes a file from enterprise section.
*
* @param string $filename Target file.
*
* @return mixed Result code.
*/
function enterprise_include_once($filename)
{
global $config;
// Load enterprise extensions
// Load enterprise extensions.
if (defined('DESTDIR')) {
$destdir = DESTDIR;
} else {
$destdir = '';
}
$filepath = realpath($config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename);
if ($filepath === false) {
@ -1574,6 +1592,11 @@ function safe_sql_string($string)
}
/**
* Verifies if current Pandora FMS installation is a Metaconsole.
*
* @return boolean True metaconsole installation, false if not.
*/
function is_metaconsole()
{
global $config;
@ -1581,6 +1604,18 @@ function is_metaconsole()
}
/**
* Check if current Pandora FMS installation has joined a Metaconsole env.
*
* @return boolean True joined, false if not.
*/
function has_metaconsole()
{
global $config;
return (bool) $config['node_metaconsole'] && (bool) $config['metaconsole_node_id'];
}
/**
* @brief Check if there is management operations are allowed in current context
* (node // meta)

View File

@ -11519,7 +11519,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
if ($other['data'][18] != '') {
$values['id_extra'] = $other['data'][18];
$sql_validation = 'SELECT id_evento FROM tevento where estado=0 and id_extra ="'.$other['data'][18].'";';
$sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
$validation = db_get_all_rows_sql($sql_validation);
if ($validation) {
foreach ($validation as $val) {

View File

@ -180,7 +180,7 @@ function config_update_config()
$error_update[] = __('Automatic check for updates');
}
if (!config_update_value('cert_path', (bool) get_parameter('cert_path'))) {
if (!config_update_value('cert_path', get_parameter('cert_path'))) {
$error_update[] = __('SSL cert path');
}

View File

@ -4551,7 +4551,7 @@ function events_list_events_grouped_agents($sql)
$sql = sprintf(
'SELECT * FROM %s
LEFT JOIN tagent_secondary_group
ON tagent_secondary_group.id_agent = tevento.id_agente
ON tagent_secondary_group.id_agent = id_agente
WHERE %s',
$table,
$sql

View File

@ -2235,6 +2235,7 @@ function combined_graph_summatory_average(
$data_array_pop[$key_reverse] = array_pop(
$data_array_reverse[$key_reverse]
);
$count_data_array_reverse--;
}
}

View File

@ -1233,7 +1233,7 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*',
*
* @return string HTML code if return parameter is true.
*/
function html_print_input_text_extended($name, $value, $id, $alt, $size, $maxlength, $disabled, $script, $attributes, $return=false, $password=false, $function='')
function html_print_input_text_extended($name, $value, $id, $alt, $size, $maxlength, $disabled, $script, $attributes, $return=false, $password=false, $function='', $autocomplete='off')
{
static $idcounter = 0;
@ -1283,7 +1283,7 @@ function html_print_input_text_extended($name, $value, $id, $alt, $size, $maxlen
'autocomplete',
];
$output = '<input '.($password ? 'type="password" autocomplete="off" ' : 'type="text" ');
$output = '<input '.($password ? 'type="password" autocomplete="'.$autocomplete.'" ' : 'type="text" ');
if ($disabled && (!is_array($attributes) || !array_key_exists('disabled', $attributes))) {
$output .= 'readonly="readonly" ';
@ -1435,7 +1435,8 @@ function html_print_input_password(
$return=false,
$disabled=false,
$required=false,
$class=''
$class='',
$autocomplete='off'
) {
if ($maxlength == 0) {
$maxlength = 255;
@ -1454,7 +1455,7 @@ function html_print_input_password(
$attr['class'] = $class;
}
return html_print_input_text_extended($name, $value, 'password-'.$name, $alt, $size, $maxlength, $disabled, '', $attr, $return, true);
return html_print_input_text_extended($name, $value, 'password-'.$name, $alt, $size, $maxlength, $disabled, '', $attr, $return, true, '', $autocomplete);
}

View File

@ -2230,6 +2230,7 @@ function modules_get_agentmodule_data(
'module_name' => $values[$key]['module_name'],
'agent_id' => $values[$key]['agent_id'],
'agent_name' => $values[$key]['agent_name'],
'module_type' => $values[$key]['module_type'],
];
}

View File

@ -151,11 +151,13 @@ function reporting_make_reporting_data(
$contents = $report['contents'];
} else {
$report = io_safe_output(db_get_row('treport', 'id_report', $id_report));
$contents = db_get_all_rows_field_filter(
$contents = io_safe_output(
db_get_all_rows_field_filter(
'treport_content',
'id_report',
$id_report,
db_escape_key_identifier('order')
)
);
}
@ -326,26 +328,32 @@ function reporting_make_reporting_data(
break;
case 'general':
$report['contents'][] = reporting_general(
$report['contents'][] = io_safe_output(
reporting_general(
$report,
$content
)
);
break;
case 'availability':
$report['contents'][] = reporting_availability(
$report['contents'][] = io_safe_output(
reporting_availability(
$report,
$content,
$date,
$time
)
);
break;
case 'availability_graph':
$report['contents'][] = reporting_availability_graph(
$report['contents'][] = io_safe_output(
reporting_availability_graph(
$report,
$content,
$pdf
)
);
break;
@ -475,9 +483,11 @@ function reporting_make_reporting_data(
break;
case 'agent_configuration':
$report['contents'][] = reporting_agent_configuration(
$report['contents'][] = io_safe_output(
reporting_agent_configuration(
$report,
$content
)
);
break;
@ -673,12 +683,14 @@ function reporting_make_reporting_data(
case 'agent_detailed_event':
case 'event_report_agent':
$report_control = reporting_event_report_agent(
$report_control = io_safe_output(
reporting_event_report_agent(
$report,
$content,
$type,
$force_width_chart,
$force_height_chart
)
);
if ($report_control['total_events'] == 0 && $content['hide_no_data'] == 1) {
continue;
@ -1383,7 +1395,7 @@ function reporting_event_top_n(
foreach ($tops as $key => $row) {
// Metaconsole connection.
$server_name = $row['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -1426,7 +1438,7 @@ function reporting_event_top_n(
}
// Restore dbconnection.
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
}
@ -2176,7 +2188,7 @@ function reporting_agent_module($report, $content)
foreach ($agents as $agent) {
$row = [];
$row['agent_status'][$agent] = agents_get_status($agent);
$row['agent_name'] = agents_get_alias($agent);
$row['agent_name'] = io_safe_output(agents_get_alias($agent));
$agent_modules = agents_get_modules($agent);
$row['modules'] = [];
@ -2330,7 +2342,7 @@ function reporting_exception(
do {
// Metaconsole connection.
$server_name = $exceptions[$i]['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -2372,7 +2384,7 @@ function reporting_exception(
$i++;
// Restore dbconnection.
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
} while ($min === false && $i < count($exceptions));
@ -2385,7 +2397,7 @@ function reporting_exception(
foreach ($exceptions as $exc) {
// Metaconsole connection.
$server_name = $exc['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -2499,7 +2511,7 @@ function reporting_exception(
}
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
}
@ -2693,7 +2705,7 @@ function reporting_group_report($report, $content)
{
global $config;
$metaconsole_on = ($config['metaconsole'] == 1) && defined('METACONSOLE');
$metaconsole_on = ($config['metaconsole'] == 1) && is_metaconsole();
$return['type'] = 'group_report';
@ -2777,7 +2789,7 @@ function reporting_event_report_agent(
}
$return['title'] = $content['name'];
$return['subtitle'] = agents_get_alias($content['id_agent']);
$return['subtitle'] = io_safe_output(agents_get_alias($content['id_agent']));
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -6073,7 +6085,7 @@ function reporting_advanced_sla(
// SLA.
$return['SLA'] = reporting_sla_get_compliance_from_array($return);
$return['SLA_fixed'] = sla_truncate(
$return['sla_fixed'] = sla_truncate(
$return['SLA'],
$config['graph_precision']
);
@ -6173,7 +6185,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
foreach ($items as $item) {
// aaMetaconsole connection
$server_name = $item['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -6185,7 +6197,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
|| modules_is_not_init($item['id_agent_module'])
) {
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
@ -6242,7 +6254,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
$text = $row['data']['agent'].' ('.$text.')';
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
@ -6396,10 +6408,12 @@ function reporting_availability_graph($report, $content, $pdf=false)
$edge_interval = 10;
if (empty($content['subitems'])) {
$slas = db_get_all_rows_field_filter(
$slas = io_safe_output(
db_get_all_rows_field_filter(
'treport_content_sla_combined',
'id_report_content',
$content['id_rc']
)
);
} else {
$slas = $content['subitems'];
@ -6807,7 +6821,7 @@ function reporting_increment($report, $content)
$return['data'] = [];
if (defined('METACONSOLE')) {
if (is_metaconsole()) {
$sql1 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.'
AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC';
$sql2 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC';
@ -6845,7 +6859,7 @@ function reporting_increment($report, $content)
$last_data = db_get_value_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC');
}
if (!defined('METACONSOLE')) {
if (!is_metaconsole()) {
}
if ($old_data === false || $last_data === false) {
@ -6934,7 +6948,7 @@ function reporting_general($report, $content)
foreach ($generals as $row) {
// Metaconsole connection
$server_name = $row['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -7085,7 +7099,7 @@ function reporting_general($report, $content)
$i++;
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
}

View File

@ -319,7 +319,7 @@ final class Container extends Model
// Default filter.
$filter = ['id_layout' => $layoutId];
$fields = [
'id',
'DISTINCT(id) AS id',
'type',
'cache_expiration',
'id_layout',
@ -340,6 +340,7 @@ final class Container extends Model
// Only true condition if type is GROUP_ITEM.
$filter[] = '('.\db_format_array_where_clause_sql(
[
'id_layout' => $layoutId,
'type' => GROUP_ITEM,
'id_group' => $groupsFilter,
]

View File

@ -3108,6 +3108,15 @@ div.nodata_container {
border-radius: 3px;
}
.legend_white {
width: 100%;
background-color: #fff;
padding: 20px 50px;
display: grid;
grid-gap: 12px;
grid-template-columns: repeat(3, 1fr);
}
.legend_basic {
background: #f4f4f4;
margin-top: 10px;
@ -3116,12 +3125,13 @@ div.nodata_container {
}
.agents_modules_table th {
background: #3f3f3f;
border: 1px solid #e2e2e2;
background-color: #fff !important;
border-right: 1px solid #e2e2e2;
color: #000;
}
.agents_modules_table th * {
color: #ffffff;
color: #000;
}
/*
@ -3425,9 +3435,12 @@ div.div_groups_status {
.agents_modules_table {
border: 1px solid #e2e2e2;
border-spacing: 0px;
margin-bottom: 30px;
background-color: #fff;
}
.agents_modules_table td {
border: 1px solid #e2e2e2;
border-right: 1px solid #e2e2e2;
border-top: 1px solid #e2e2e2;
}
.databox.filters,

View File

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

View File

@ -263,7 +263,7 @@ if ($date > $now) {
echo '<div class="module_graph_menu_dropdown">
<div id="module_graph_menu_header" class="module_graph_menu_header">
'.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
<span>'.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).'</span>
<span>'.__('Graph configuration menu').'</span>
'.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
</div>
<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>

View File

@ -402,7 +402,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
echo '<div class="module_graph_menu_dropdown">
<div id="module_graph_menu_header" class="module_graph_menu_header">
'.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
<span>'.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).'</span>
<span>'.__('Graph configuration menu').'</span>
'.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
</div>
<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>

View File

@ -66,7 +66,7 @@ if (check_acl($config['id_user'], 0, 'AR')) {
enterprise_hook('inventory_menu');
if ($config['activate_netflow'] || $config['activate_nta']) {
$sub['network'] = [
$sub['network_traffic'] = [
'text' => __('Network'),
'id' => 'Network',
'type' => 'direct',
@ -117,7 +117,7 @@ if (check_acl($config['id_user'], 0, 'AR')) {
);
}
$sub['network']['sub2'] = $netflow_sub;
$sub['network_traffic']['sub2'] = $netflow_sub;
}
if ($config['log_collector'] == 1) {

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.735
%define release 190612
%define release 190619
# 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.735
%define release 190612
%define release 190619
# 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.735
%define release 190612
%define release 190619
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.735-190612
Version: 7.0NG.735-190619
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.735-190612"
pandora_version="7.0NG.735-190619"
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.735";
my $pandora_build = "190612";
my $pandora_build = "190619";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -3352,7 +3352,7 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$) {
# Validate events with the same event id
if (defined ($id_extra) && $id_extra ne '') {
logger($pa_config, "Updating events with extended id '$id_extra'.", 10);
db_do ($dbh, 'UPDATE ' . $event_table . ' SET estado = 1, ack_utimestamp = ? WHERE estado = 0 AND id_extra=?', $utimestamp, $id_extra);
db_do ($dbh, 'UPDATE ' . $event_table . ' SET estado = 1, ack_utimestamp = ? WHERE estado IN (0,2) AND id_extra=?', $utimestamp, $id_extra);
}
# Create the event
@ -4810,7 +4810,7 @@ sub pandora_process_event_replication ($) {
}
# Get server id on metaconsole
my $metaconsole_server_id = enterprise_hook('get_metaconsole_setup_server_id', [$dbh_metaconsole, safe_input($pa_config->{'servername'})]);
my $metaconsole_server_id = enterprise_hook('get_metaconsole_setup_server_id', [$dbh]);
# If the server name is not found in metaconsole setup: abort
if($metaconsole_server_id == -1) {

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.735";
my $pandora_build = "190612";
my $pandora_build = "190619";
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.735
%define release 190612
%define release 190619
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.735"
PI_BUILD="190612"
PI_BUILD="190619"
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.735 PS190612";
my $version = "7.0NG.735 PS190619";
# 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.735 PS190612";
my $version = "7.0NG.735 PS190619";
# save program name for logging
my $progname = basename($0);
@ -3801,9 +3801,8 @@ sub cli_get_agent_group() {
else {
my $id_group = get_agent_group ($dbh_metaconsole, $id_agent);
my $group_name = get_group_name ($dbh_metaconsole, $id_group);
my $metaconsole_name = enterprise_hook('get_metaconsole_setup_server_name',[$dbh, $server]);
$agent_name = safe_output($agent_name);
print "[INFO] Server: $metaconsole_name Agent: $agent_name Name Group: $group_name\n\n";
print "[INFO] Agent: $agent_name Name Group: $group_name\n\n";
}
}
}
@ -3843,7 +3842,6 @@ sub cli_get_agent_group_id() {
foreach my $server (@servers_id) {
my $dbh_metaconsole = enterprise_hook('get_node_dbh',[$conf, $server, $dbh]);
my $metaconsole_name = enterprise_hook('get_metaconsole_setup_server_name',[$dbh, $server]);
my $id_agent = get_agent_id($dbh_metaconsole,$agent_name);
if ($id_agent == -1) {
@ -3852,7 +3850,7 @@ sub cli_get_agent_group_id() {
else {
my $id_group = get_agent_group ($dbh_metaconsole, $id_agent);
$agent_name = safe_output($agent_name);
print "Server: $metaconsole_name Agent: $agent_name ID Group: $id_group\n\n";
print "Agent: $agent_name ID Group: $id_group\n\n";
}
}
}

View File

@ -68,27 +68,16 @@ then
help
fi
TMPFILE=/tmp/dns_$DNS_CHECK.tmp
dig @$DNS_CHECK $DOMAIN_CHECK > $TMPFILE
RETURN_IP=`cat $TMPFILE | grep "^$DOMAIN_CHECK" | awk '{print $5}'`
RETURN_TIMEOUT=`cat $TMPFILE | grep "Query time" | grep -o "[0-9]*"`
results=`dig @$DNS_CHECK +nocmd $DOMAIN_CHECK +multiline +noall +answer A`
targets=`echo "$results"| awk '{print $5}'`
rm $TMPFILE 2> /dev/null
if [ $TIMEOUT_CHECK == 1 ]
then
echo $RETURN_TIMEOUT
exit 0
fi
if [ "$RETURN_IP" != "$IP_CHECK" ]
then
echo 0
exit 1
else
for x in $targets; do
if [ "$x" == "$IP_CHECK" ]; then
echo 1
exit 0
fi
fi
done
echo 0
exit 0