Merge remote-tracking branch 'origin/develop' into ent-7786-agentes-asignados-a-politicas-en-metaconsola

This commit is contained in:
fbsanchez 2021-08-23 15:40:23 +02:00
commit 9bdbad17db
71 changed files with 345 additions and 197 deletions

View File

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

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.756"
PI_BUILD="210811"
PI_BUILD="210823"
OS_NAME=`uname -s`
FORCE=0

View File

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

View File

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

View File

@ -1,5 +1,7 @@
START TRANSACTION;
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
ALTER TABLE `tmetaconsole_setup` ADD COLUMN `unified` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tlayout` ADD COLUMN `auto_adjust` INTEGER UNSIGNED NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `title` TEXT default '';

View File

@ -1028,6 +1028,7 @@ ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`);
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
-- ---------------------------------------------------------------------
-- Table `tmetaconsole_event_history`
@ -2350,6 +2351,8 @@ ALTER TABLE `tevento` ADD COLUMN `data` double(50,5) default NULL;
ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
-- ---------------------------------------------------------------------
-- Table `tevent_extended`
-- ---------------------------------------------------------------------

View File

@ -23,13 +23,8 @@ ui_require_css_file('order_interpreter');
// Global errors/warnings checking.
config_check();
echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
if ($config['menu_type'] == 'classic') {
echo '<div id="header_table" class="header_table_classic">';
} else {
echo '<div id="header_table" class="header_table_collapsed">';
}
?>
<div id="header_table_inner">
<?php

View File

@ -1,17 +1,33 @@
<?php
/**
* Lateral Main Menu.
*
* @category Main Menu.
* @package Pandora FMS.
* @subpackage OpenSource.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 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.
if (! isset($config['id_user'])) {
// Begin.
if (isset($config['id_user']) === false) {
include 'general/login_page.php';
exit();
}
@ -20,9 +36,9 @@ if (! isset($config['id_user'])) {
<script type="text/javascript" language="javascript">
$(document).ready(function(){
var menuType_value = "<?php echo $config['menu_type']; ?>";
var menuType_value = "<?php echo $_SESSION['menu_type']; ?>";
if (menuType_value == 'classic') {
if (menuType_value === '' || menuType_value === 'classic') {
$('ul.submenu').css('left', '214px');
}
else{
@ -34,26 +50,22 @@ $(document).ready(function(){
<?php
$autohidden_menu = 0;
if (isset($config['autohidden_menu']) && $config['autohidden_menu']) {
if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_menu'] === true) {
$autohidden_menu = 1;
}
// Menu container prepared to autohide menu
if ($config['menu_type'] == 'classic') {
echo '<div id="menu_full" class="menu_full_classic">';
} else {
echo '<div id="menu_full" class="menu_full_collapsed">';
}
// Start of full lateral menu.
echo sprintf('<div id="menu_full" class="menu_full_%s">', $menuTypeClass);
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
if (!defined('PANDORA_ENTERPRISE')) {
if (defined('PANDORA_ENTERPRISE') === false) {
$logo_title = get_product_name().' Opensource';
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
} else {
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) {
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo) === true) {
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
}
@ -61,54 +73,48 @@ if (!defined('PANDORA_ENTERPRISE')) {
}
echo '<div class="logo_green"><a href="index.php?sec=main">';
if (isset($config['custom_logo'])) {
if ($config['menu_type'] == 'classic') {
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:block']);
} else {
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:none']);
}
if (isset($config['custom_logo']) === true) {
echo html_print_image(
$custom_logo,
true,
[
'border' => '0',
'width' => '215',
'alt' => $logo_title,
'class' => 'logo_full',
'style' => ($menuCollapsed === true) ? 'display:none' : 'display:block',
]
);
}
if (isset($config['custom_logo_collapsed'])) {
if ($config['menu_type'] == 'classic') {
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:none']);
} else {
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:block']);
}
if (isset($config['custom_logo_collapsed']) === true) {
echo html_print_image(
$custom_logo_collapsed,
true,
[
'border' => '0',
'width' => '60',
'alt' => $logo_title,
'class' => 'logo_icon',
'style' => ($menuCollapsed === true) ? 'display:block' : 'display:none',
]
);
}
echo '</a></div>';
// echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
require 'operation/menu.php';
// Check all enterprise ACL used in godmenu items to print menu headers
if (check_acl($config['id_user'], 0, 'AW')
|| check_acl($config['id_user'], 0, 'PM')
|| check_acl($config['id_user'], 0, 'LM')
|| check_acl($config['id_user'], 0, 'UM')
|| check_acl($config['id_user'], 0, 'LW')
|| check_acl($config['id_user'], 0, 'EW')
|| check_acl($config['id_user'], 0, 'DW')
) {
// echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
}
require 'godmode/menu.php';
if ($config['menu_type'] == 'classic') {
echo '<div id="button_collapse" class="button_classic button_collapse"></div>';
} else {
echo '<div id="button_collapse" class="button_collapsed button_collapse"></div>';
}
echo sprintf('<div id="button_collapse" class="button_%s button_collapse"></div>', $menuTypeClass);
// require ("links_menu.php");
echo '</div>';
// menu_container
// Menu_container.
ui_require_jquery_file('cookie');
$config_fixed_header = false;
if (isset($config['fixed_header'])) {
if (isset($config['fixed_header']) === true) {
$config_fixed_header = $config['fixed_header'];
}
?>

View File

@ -1120,6 +1120,12 @@ function show_add_action(id_alert) {
opacity: 0.5,
background: "black"
},
open: function() {
$("#action_select, #action_select").select2({
tags: true,
dropdownParent: $("#add_action-div-" + id_alert)
});
},
width: 500,
height: 300
})
@ -1150,6 +1156,12 @@ function show_display_update_action(id_module_action, alert_id, alert_id_agent_m
opacity: 0.5,
background: "black"
},
open: function() {
$("#action_select_ajax, #action_select_ajax").select2({
tags: true,
dropdownParent: $("#update_action-div")
});
},
width: 500,
height: 300
})

View File

@ -525,10 +525,8 @@ if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager'])
$menu_godmode['messages']['id'] = 'god-um_messages';
$sub = [];
if ($config['enterprise_installed']) {
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
$sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline';
}
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
$sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline';
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update Manager online');
$sub['godmode/update_manager/update_manager&tab=online']['id'] = 'Online';

View File

@ -5159,7 +5159,6 @@ function addSLARow() {
$("input[name=id_agent_failover]").val('');
$("input[name=id_server]").val('');
$("input[name=agent_sla]").val('');
$("input[name=agent_sla]").css("background","url('<?php echo $autocompleteImage; ?>') right center no-repeat")
$("input[name=agent_failover]").val('');
$("#id_agent_module_sla").empty();
$("#id_agent_module_sla").attr('disabled', 'true');

View File

@ -327,6 +327,12 @@ if (is_array($config) === true) {
) {
ui_print_error_message(__('Update manager online requires registration.'));
}
if ($mode === Manager::MODE_OFFLINE) {
ui_print_warning_message(
__('Applying offline patches may make your console unusable, we recommend to completely backup your files before applying any patch.')
);
}
}
$url_update_manager = $config['url_update_manager'];
@ -381,6 +387,20 @@ if (is_array($config) === true) {
}
}
$proxy = null;
if (empty($config['update_manager_proxy_server']) === false
|| empty($config['update_manager_proxy_port']) === false
|| empty($config['update_manager_proxy_user']) === false
|| empty($config['update_manager_proxy_password']) === false
) {
$proxy = [
'host' => $config['update_manager_proxy_server'],
'port' => $config['update_manager_proxy_port'],
'user' => $config['update_manager_proxy_user'],
'password' => $config['update_manager_proxy_password'],
];
}
$ui = new Manager(
((is_array($config) === true) ? $pandora_url : 'http://'.$_SERVER['SERVER_ADDR'].'/'),
((is_array($config) === true) ? ui_get_full_url('ajax.php') : ''),
@ -400,6 +420,7 @@ $ui = new Manager(
'registration_code' => $puid,
'remote_config' => $remote_config,
'propagate_updates' => $is_metaconsole,
'proxy' => $proxy,
'set_maintenance_mode' => function () {
if (function_exists('config_update_value') === true) {
config_update_value('maintenance_mode', 1);

View File

@ -1673,7 +1673,7 @@ class Client
);
$this->updateMR(
$this->productPath.'/extras/mr/'.$mr,
$this->extract_to.'/extras/mr/'.$mr,
$this->dbhHistory,
$historical_MR
);

View File

@ -34,7 +34,7 @@
<script type="text/javascript">
if (typeof $ != "function") {
// Dynamically include jquery if not added to this page.
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery-3.3.1.min.js'); ?>"></'+'script>');
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery.current.js'); ?>"></'+'script>');
}
</script>
<script src="<?php $asset('resources/javascript/umc.js'); ?>" type="text/javascript"></script>

View File

@ -34,7 +34,7 @@ $product_name = get_product_name(); ?>
<script type="text/javascript">
if (typeof $ != "function") {
// Dynamically include jquery if not added to this page.
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery-3.3.1.min.js'); ?>"></'+'script>');
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery.current.js'); ?>"></'+'script>');
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery-ui.min.js'); ?>"></'+'script>');
}
</script>

View File

@ -37,12 +37,10 @@ $buttons['setup'] = [
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup">'.html_print_image('images/gm_setup.png', true, ['title' => __('Options'), 'class' => 'invert_filter']).'</a>',
];
if (enterprise_installed()) {
$buttons['offline'] = [
'active' => ($tab == 'offline') ? true : false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offline">'.html_print_image('images/box.png', true, ['title' => __('Offline update manager'), 'class' => 'invert_filter']).'</a>',
];
}
$buttons['offline'] = [
'active' => ($tab == 'offline') ? true : false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offline">'.html_print_image('images/box.png', true, ['title' => __('Offline update manager'), 'class' => 'invert_filter']).'</a>',
];
$buttons['online'] = [
'active' => ($tab == 'online') ? true : false,
@ -60,6 +58,7 @@ switch ($tab) {
break;
case 'online':
default:
$title = __('Update manager » Online');
break;
}

View File

@ -30,6 +30,7 @@
global $config;
require_once __DIR__.'/../../include/functions_users.php';
require_once __DIR__.'/../../include/functions_update_manager.php';
check_login();

View File

@ -129,7 +129,7 @@ switch ($sortField) {
break;
default:
// Not possible.
// Nothing to do.
break;
}
break;
@ -153,7 +153,7 @@ switch ($sortField) {
break;
default:
// Not possible.
// Nothing to do.
break;
}
break;
@ -177,7 +177,7 @@ switch ($sortField) {
break;
default:
// Not possible.
// Nothing to do.
break;
}
break;
@ -585,11 +585,11 @@ foreach ($info as $user_id => $user_info) {
$cont++;
// Manual pagination due the complicated process of the ACL data.
if ($cont <= $offset) {
if ($cont <= $offset && $search !== true) {
continue;
}
if ($cont > ($limit + $offset)) {
if ($cont > ($limit + $offset) && $search !== true) {
break;
}
@ -820,6 +820,9 @@ foreach ($info as $user_id => $user_info) {
$data[6] .= '';
// Delete button not in this mode.
}
} else {
$data[6] .= '';
// Delete button not in this mode.
}
}

View File

@ -95,7 +95,7 @@ if (check_login(false) === false) {
<link rel="stylesheet" href="styles/js/jquery-ui_custom.css" type="text/css" />
<script language="javascript" type='text/javascript' src='javascript/pandora.js'></script>
<script language="javascript" type='text/javascript' src='javascript/pandora_ui.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery-3.3.1.min.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery.current.js'></script>
</head>
<body>
<h1>Access is not granted</h1>
@ -153,7 +153,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
<link rel="stylesheet" href="styles/js/jquery-ui_custom.css" type="text/css" />
<script language="javascript" type='text/javascript' src='javascript/pandora.js'></script>
<script language="javascript" type='text/javascript' src='javascript/pandora_ui.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery-3.3.1.min.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery.current.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery.pandora.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery-ui.min.js'></script>
<script language="javascript" type="text/javascript" src="graphs/flot/jquery.flot.js"></script>

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC210811';
$build_version = 'PC210823';
$pandora_version = 'v7.0NG.756';
// Do not overwrite default timezone set if defined.
@ -306,7 +306,7 @@ switch ($config['dbtype']) {
// ======================================================================
// Menu display mode.
if (isset($_SESSION['meny_type']) === true && $_SESSION['menu_type']) {
if (isset($_SESSION['meny_type']) === true && empty($_SESSION['menu_type']) === false) {
$config['menu_type'] = $_SESSION['menu_type'];
} else {
$config['menu_type'] = 'classic';

View File

@ -1585,7 +1585,7 @@ function enterprise_include($filename, $variables=[])
extract($variables);
}
include $filepath;
include_once $filepath;
return true;
}

View File

@ -30,7 +30,7 @@
global $config;
// Set variable to store menu type (classic or collapsed).
if (!empty(get_parameter('menuType'))) {
if (is_ajax() === true && empty(get_parameter('menuType')) === false) {
$_SESSION['menu_type'] = get_parameter('menuType', 'classic');
return;
}
@ -39,11 +39,14 @@ if (!empty(get_parameter('menuType'))) {
/**
* Prints a complete menu structure.
*
* @param array Menu structure to print.
* @param array $menu Menu structure to print.
*
* @return void
*/
function menu_print_menu(&$menu)
{
global $config;
global $menuTypeClass;
static $idcounter = 0;
echo '<div class="menu">';
@ -108,7 +111,7 @@ function menu_print_menu(&$menu)
$submenu = false;
if ($config['menu_type'] == 'classic') {
if ($menuTypeClass === 'classic') {
$classes = [
'menu_icon',
'no_hidden_menu',
@ -120,12 +123,12 @@ function menu_print_menu(&$menu)
];
}
if (isset($main['sub'])) {
if (isset($main['sub']) === true) {
$classes[] = '';
$submenu = true;
}
if (!isset($main['refr'])) {
if (isset($main['refr']) === false) {
$main['refr'] = 0;
}
@ -409,23 +412,14 @@ function menu_print_menu(&$menu)
// Print out the first level.
$output .= '<li title="'.$main['text'].'" class="'.implode(' ', $classes).' '.$seleccionado.'" id="icon_'.$id.'">';
// onclick="location.href=\'index.php?sec='.$mainsec.'&amp;sec2='.$main["sec2"].($main["refr"] ? '&amp;refr='.$main["refr"] : '').'\'">';
$length = strlen(__($main['text']));
$padding_top = ( $length >= 18) ? 6 : 12;
if ($config['menu_type'] == 'classic') {
$output .= '<div id="title_menu" class="title_menu_classic">'.$main['text'].'</div>';
} else {
$output .= '<div id="title_menu" class="title_menu_collapsed">'.$main['text'].'</div>';
}
$output .= sprintf('<div id="title_menu" class="title_menu_%s">%s</div>', $menuTypeClass, $main['text']);
// Add the notification ball if defined
if (isset($main['notification'])) {
// Add the notification ball if defined.
if (isset($main['notification']) === true) {
$output .= '<div class="notification_ball">'.$main['notification'].'</div>';
}
$padding_top = 0;
$length = 0;
if ($submenu_output != '') {
// WARNING: IN ORDER TO MODIFY THE VISIBILITY OF MENU'S AND SUBMENU'S (eg. with cookies) YOU HAVE TO ADD TO THIS ELSEIF. DON'T MODIFY THE CSS.
if ($visible || in_array('selected', $classes)) {
@ -436,10 +430,7 @@ function menu_print_menu(&$menu)
$visible = false;
}
// $output .= '<ul id="subicon_'.$id.'" class="submenu'.($visible ? '' : ' invisible').'">';
$output .= '<ul id="subicon_'.$id.'" class="submenu">';
$output .= $submenu_output;
$output .= '</ul>';
$output .= sprintf('<ul id="subicon_%s" class="submenu">%s</ul>', $id, $submenu_output);
}
$config['count_main_menu']++;

View File

@ -2295,17 +2295,19 @@ function modules_get_agentmodule_data(
$search_in_history_db = db_search_in_history_db($datelimit);
switch ($module['id_tipo_modulo']) {
// generic_data_string
// Generic_data_string.
case 3:
// remote_tcp_string
// Remote_tcp_string.
case 10:
// remote_snmp_string
// Remote_snmp_string.
case 17:
// async_string
// Async_string.
case 36:
// remote_cmd_string
// Remote_cmd_string.
case 23:
// Free search is a json with value and exact modifier
// Web content string.
case 33:
// Free search is a json with value and exact modifier.
$freesearch = json_decode($freesearch, true);
$freesearch_sql = '';
if (isset($freesearch['value']) && !empty($freesearch['value'])) {

View File

@ -2559,12 +2559,19 @@ function reporting_html_last_value($table, $item, $pdf=0)
'Y-m-d H:i:s',
$item['data']['utimestamp']
);
$table_data->data[1][2] = remove_right_zeros(
number_format(
$item['data']['datos'],
$config['graph_precision']
)
);
if (is_numeric($item['data']['datos']) === true) {
$dataDatos = remove_right_zeros(
number_format(
$item['data']['datos'],
$config['graph_precision']
)
);
} else {
$dataDatos = trim($item['data']['datos']);
}
$table_data->data[1][2] = $dataDatos;
switch ($item['data']['estado']) {
case AGENT_MODULE_STATUS_CRITICAL_BAD:

View File

@ -817,7 +817,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$events_graph .= graph_graphic_agentevents(
$id_agente,
'340px;margin:0',
45,
'130px',
SECONDS_1DAY,
'',
true,

View File

@ -1869,7 +1869,7 @@ function ui_process_page_head($string, $bitfield)
} else {
$config['jquery'] = array_merge(
[
'jquery' => 'include/javascript/jquery-3.3.1.min.js',
'jquery' => 'include/javascript/jquery.current.js',
'pandora' => 'include/javascript/jquery.pandora.js',
'jquery-ui' => 'include/javascript/jquery-ui.min.js',
],

View File

@ -118,6 +118,7 @@ function flot_area_graph(
$array_events_alerts
) {
global $config;
global $is_mobile;
// Get a unique identifier to graph.
$graph_id = uniqid('graph_');
@ -145,7 +146,7 @@ function flot_area_graph(
break;
}
if ($config['style'] === 'pandora_black' && ($params['pdf'] === false || $params['pdf'] === null )
if ($config['style'] === 'pandora_black' && ($params['pdf'] === false || $params['pdf'] === null) && (isset($is_mobile) === false || $is_mobile === false)
) {
$background_style = '#222';
$params['grid_color'] = '#fff';
@ -760,11 +761,23 @@ function flot_slicesbar_graph(
$graph_id = uniqid('graph_');
// Set some containers to legend, graph, timestamp tooltip, etc.
$height = ((int) $height + 15);
if (is_numeric($height) === true) {
$height = ((int) $height + 15);
}
$style = 'width:'.$width.'%;';
// Fixed height size.
$style .= 'height: 100%;';
if (empty($height) === true) {
$style .= 'height: 100%;';
} else {
if (is_numeric($height) === true) {
$style .= 'height: '.$height.'px;';
} else {
$style .= 'height: '.$height.';';
}
}
$return = "<div id='".$graph_id."' class='noresizevc graph ".$adapt_key."' style='".$style."'></div>";
$return .= "<div id='value_".$graph_id."' class='flot_container'></div>";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -721,6 +721,7 @@ final class DBMaintainer
$umc->updateMR($path);
} catch (\Exception $e) {
// TODO: Send an event to notify errors.
$this->lastError = $e->getMessage();
$return = false;
}
} else {

View File

@ -413,7 +413,7 @@ class AgentModuleWidget extends Widget
array $visualData,
array $allModules
):string {
$style = 'display:flex; width:100%; height:100%; margin: 10px;';
$style = 'display:flex; width:100%; margin: 10px;';
$table_data = '<div style="'.$style.'">';
$table_data .= '<table class="widget_agent_module transparent mrgn_0px" cellpadding="1" cellspacing="0" border="0">';
@ -645,9 +645,18 @@ class AgentModuleWidget extends Widget
$all_modules = $target_modules;
} else {
$all_modules = Module::search(
['id_agente_modulo' => $target_modules]
);
if (is_array($target_modules) === true
|| is_numeric($target_modules) === true
) {
$all_modules = Module::search(
['id_agente_modulo' => $target_modules]
);
} else {
// From previous definitions.
$all_modules = Module::search(
['id_agente_modulo' => explode(',', $target_modules)]
);
}
}
if ($all_modules !== null) {

View File

@ -396,9 +396,20 @@ class ModuleValueWidget extends Widget
$output .= '<div class="container-icon">';
// Div value.
$output .= '<div style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
$output .= remove_right_zeros(
number_format($data_module, $config['graph_precision'])
);
if (is_numeric($data_module) === true) {
$dataDatos = remove_right_zeros(
number_format(
$data_module,
$config['graph_precision']
)
);
} else {
$dataDatos = trim($data_module);
}
$output .= $dataDatos;
$output .= '</div>';
if (empty($label) === false) {

View File

@ -134,8 +134,7 @@ final class EventsHistory extends Item
}
}
$data['height'] = ($data['height'] - 20);
// $data['height'] = ($data['height'] - 20);
if ((int) $data['width'] < 11) {
$data['width'] = 11;
}

View File

@ -401,6 +401,12 @@ table.group_modules_status_box tr td span a {
text-align: center;
}
table.widget_agent_module,
table.widget_agent_module img {
width: auto;
height: auto;
}
table.widget_agent_module tbody tr td {
padding: 5px;
}

View File

@ -416,11 +416,14 @@ ul li {
}
.menu_full_classic .title_menu_classic {
display: flex;
display: flex !important;
}
.menu_icon_collapsed {
background-position: 50% 50%;
}
.menu_full_collapsed .title_menu_collapsed {
display: none;
display: none !important;
}
.button_classic {
@ -474,15 +477,3 @@ ul li {
.header_table_collapsed {
padding-left: 80px; /* 60 + 35 */
}
.title_menu_classic {
display: flex;
}
.title_menu_collapsed {
display: none;
}
.menu_icon_collapsed {
background-position: 50% 50%;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1112,17 +1112,36 @@ if (get_parameter('login', 0) !== 0) {
}
}
// Header.
if ($config['pure'] == 0) {
echo '<div id="container"><div id="head">';
include 'general/header.php';
if ($config['menu_type'] == 'classic') {
echo '</div><div id="page" class="page_classic"><div id="menu">';
} else {
echo '</div><div id="page" class="page_collapsed"><div id="menu">';
if ((bool) $config['maintenance_mode'] === true
&& (bool) users_is_admin() === false
) {
// Show maintenance web-page. For non-admin users only.
include 'general/maintenance.php';
while (ob_get_length() > 0) {
ob_end_flush();
}
exit('</html>');
}
// Pure.
if ($config['pure'] == 0) {
// Menu container prepared to autohide menu.
$menuCollapsed = (isset($_SESSION['menu_type']) === true && $_SESSION['menu_type'] !== 'classic');
$menuTypeClass = ($menuCollapsed === true) ? 'collapsed' : 'classic';
// Container.
echo '<div id="container">';
// Header.
echo '<div id="head">';
include 'general/header.php';
echo '</div>';
// Main menu.
echo sprintf('<div id="page" class="page_%s">', $menuTypeClass);
echo '<div id="menu">';
include 'general/main_menu.php';
echo '</div>';
echo '<button onclick="topFunction()" id="top_btn" title="Go to top"></button>';
@ -1330,11 +1349,15 @@ if ($config['pure'] == 0) {
// Main pure.
}
echo '<div id="wiz_container">';
echo '</div>';
html_print_div(
['id' => 'wiz_container'],
true
);
echo '<div id="um_msg_receiver">';
echo '</div>';
html_print_div(
['id' => 'um_msg_receiver'],
true
);
// Connection lost alert.
ui_require_javascript_file('connection_check');

View File

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

View File

@ -1,3 +1,37 @@
/**
*
* Default mobile theme
*
* @category Stylesheet
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
@font-face {
font-family: "lato";
src: url("../../../fonts/lato.woff2") format("woff");
font-weight: 400;
}
* {
text-decoration: none !important;
font-size: 12px;
@ -11,6 +45,8 @@ body {
margin: 0;
text-align: left;
vertical-align: top;
font-weight: 400;
font-family: "Lato";
}
.small {

View File

@ -96,7 +96,7 @@ if ($refresh > 0) {
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
<link rel="stylesheet" href="../../include/styles/js/jquery-ui.min.css" type="text/css" />
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-3.3.1.min.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-ui.min.js'></script>
<?php

View File

@ -87,7 +87,7 @@ echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/
<link rel="stylesheet" href="../../include/styles/js/jquery-ui.min.css" type="text/css" />
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/pandora_ui.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-3.3.1.min.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-ui.min.js'></script>
<?php

View File

@ -86,7 +86,7 @@ if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AR')) {
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo __('%s Snapshot data view for module (%s)', get_product_name(), $label); ?></title>
<script type='text/javascript' src='../../include/javascript/jquery-3.3.1.min.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
</head>
<body class=''>
<?php

View File

@ -119,7 +119,7 @@ ui_print_message_dialog(
<link rel="stylesheet" href="../../include/styles/js/jquery-ui_custom.css" type="text/css" />
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/pandora_ui.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-3.3.1.min.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-ui.min.js'></script>
<?php

View File

@ -391,10 +391,14 @@ if (is_ajax()) {
true
);
$tmp->data = format_numeric(
$tmp->data,
$config['graph_precision']
);
if (is_numeric($tmp->data) === true) {
$tmp->data = format_numeric(
$tmp->data,
$config['graph_precision']
);
} else {
$tmp->data = ui_print_truncate_text($tmp->data, 10);
}
$tmp->instructions = events_get_instructions($item);

View File

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

View File

@ -694,7 +694,7 @@ CREATE TABLE IF NOT EXISTS `tevento` (
`owner_user` VARCHAR(100) NOT NULL DEFAULT '',
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
`custom_data` TEXT NOT NULL,
`data` double(50,5) default NULL,
`data` tinytext default NULL,
`module_status` int(4) NOT NULL default '0',
PRIMARY KEY (`id_evento`),
KEY `idx_agente` (`id_agente`),
@ -3291,7 +3291,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
`server_id` int(10) NOT NULL,
`custom_data` TEXT NOT NULL DEFAULT '',
`data` double(50,5) default NULL,
`data` tinytext default NULL,
`module_status` int(4) NOT NULL default '0',
PRIMARY KEY (`id_evento`),
KEY `idx_agente` (`id_agente`),

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.756-210811
Version: 7.0NG.756-210823
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.756-210811"
pandora_version="7.0NG.756-210823"
package_cpan=0
package_pandora=1

View File

@ -17,6 +17,8 @@
. "/etc/rc.subr"
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
name="pandora_ha"
rcvar=pandora_server_enable

View File

@ -26,6 +26,8 @@ load_rc_config $name
: ${tentacle_server_config="/usr/local/etc/tentacle/${name}.conf"}
: ${tentacle_server_pidfile="/var/run/${name}.pid"}
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
command=/usr/local/bin/${name}
command_interpreter=/usr/local/bin/perl
tentacle_server_user=${tentacle_server_user:-"pandora"}

View File

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

View File

@ -3683,7 +3683,7 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$) {
# Create the event
logger($pa_config, "Generating event '$evento' for agent ID $id_agente module ID $id_agentmodule.", 10);
my $event_id = db_insert ($dbh, 'id_evento','INSERT INTO ' . $event_table . ' (id_agente, id_grupo, evento, timestamp, estado, utimestamp, event_type, id_agentmodule, id_alert_am, criticity, user_comment, tags, source, id_extra, id_usuario, critical_instructions, warning_instructions, unknown_instructions, ack_utimestamp, custom_data, data, module_status)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $comment, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions, $ack_utimestamp, $custom_data, $module_data, $module_status);
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $comment, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions, $ack_utimestamp, $custom_data, safe_input($module_data), $module_status);
# Do not write to the event file
return $event_id if ($pa_config->{'event_file'} eq '');

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.756";
my $pandora_build = "210811";
my $pandora_build = "210823";
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.756
%define release 210811
%define release 210823
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.756 Build 210811";
my $version = "7.0NG.756 Build 210823";
# 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.756 Build 210811";
my $version = "7.0NG.756 Build 210823";
# save program name for logging
my $progname = basename($0);

View File

@ -339,6 +339,10 @@ export default class Line extends Item<LineProps> {
}
protected updateDomElement(element: HTMLElement): void {
if (element.parentElement != null) {
element.parentElement.style.cursor = "default";
}
let {
x, // Box x
y, // Box y
@ -419,6 +423,7 @@ export default class Line extends Item<LineProps> {
startCircle.style.position = "absolute";
startCircle.style.left = `${x1 - this.circleRadius}px`;
startCircle.style.top = `${y1 - this.circleRadius}px`;
startCircle.style.cursor = `move`;
endCircle.classList.add(
"visual-console-item-line-circle",
@ -431,6 +436,7 @@ export default class Line extends Item<LineProps> {
endCircle.style.position = "absolute";
endCircle.style.left = `${x2 - this.circleRadius}px`;
endCircle.style.top = `${y2 - this.circleRadius}px`;
endCircle.style.cursor = `move`;
if (element.parentElement !== null) {
const circles = element.parentElement.getElementsByClassName(