mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Merge remote-tracking branch 'origin/develop' into ent-11114-Gestion-de-versiones-Obsolescencia-planeada
This commit is contained in:
commit
6f8212ed40
@ -78,16 +78,16 @@ cd unix && ./pandora_agent_installer --install
|
||||
}
|
||||
|
||||
|
||||
install_autodiscover () {
|
||||
local arch=$1
|
||||
wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip
|
||||
unzip autodiscover-linux.zip
|
||||
chmod +x $arch/autodiscover
|
||||
mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover
|
||||
}
|
||||
# install_autodiscover () {
|
||||
# local arch=$1
|
||||
# wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip
|
||||
# unzip autodiscover-linux.zip
|
||||
# chmod +x $arch/autodiscover
|
||||
# mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover
|
||||
# }
|
||||
|
||||
## Main
|
||||
echo "Starting PandoraFMS Agent deployment ver. $S_VERSION"
|
||||
echo "Starting PandoraFMS Agent binary deployment ver. $S_VERSION"
|
||||
|
||||
execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define env variable PANDORA_SERVER_IP'
|
||||
|
||||
@ -104,8 +104,6 @@ OS=$([[ $(grep '^ID_LIKE=' /etc/os-release) ]] && grep ^ID_LIKE= /etc/os-release
|
||||
[[ $OS =~ 'rhel' ]] && OS_RELEASE=$OS
|
||||
[[ $OS =~ 'fedora' ]] && OS_RELEASE=$OS
|
||||
[[ $OS =~ 'debian' ]] && OS_RELEASE=$OS
|
||||
#[[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS
|
||||
#[[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS
|
||||
|
||||
# initialice logfile
|
||||
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
|
||||
@ -126,6 +124,30 @@ check_repo_connection
|
||||
execute_cmd "grep --version" 'Checking needed tools: grep'
|
||||
execute_cmd "sed --version" 'Checking needed tools: sed'
|
||||
|
||||
# Arch check
|
||||
arch=$(uname -m)
|
||||
case $arch in
|
||||
|
||||
x86_64)
|
||||
echo -e "${cyan}Arch: $arch ${reset} "
|
||||
;;
|
||||
|
||||
x86)
|
||||
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
|
||||
exit -1
|
||||
;;
|
||||
|
||||
armv7l)
|
||||
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
|
||||
exit -1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
|
||||
exit -1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Creating working directory
|
||||
rm -rf $HOME/pandora_deploy_tmp/ &>> $LOGFILE
|
||||
mkdir $HOME/pandora_deploy_tmp &>> $LOGFILE
|
||||
@ -148,6 +170,10 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
|
||||
# Check rh version
|
||||
if [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ] ; then
|
||||
package_manager_cmd=dnf
|
||||
execute_cmd "$package_manager_cmd install -y libnsl" "Installing dependencies"
|
||||
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '9' ] ; then
|
||||
package_manager_cmd=dnf
|
||||
execute_cmd "$package_manager_cmd install -y libnsl libxcrypt-compat" "Installing dependencies"
|
||||
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '7' ] ; then
|
||||
package_manager_cmd=yum
|
||||
|
||||
@ -158,24 +184,23 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
|
||||
echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset}
|
||||
|
||||
# Insatall pandora agent
|
||||
$package_manager_cmd install -y http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm &>> $LOGFILE
|
||||
echo -en "${cyan}Installing Pandora FMS agent...${reset}"
|
||||
check_cmd_status 'Error installing Pandora FMS agent'
|
||||
[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
|
||||
[ "$PANDORA_AGENT_PACKAGE_EL" ] || PANDORA_AGENT_PACKAGE_EL="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm "
|
||||
execute_cmd "$package_manager_cmd install -y ${PANDORA_AGENT_PACKAGE_EL}" 'Installing Pandora FMS agent package'
|
||||
#[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
|
||||
|
||||
fi
|
||||
|
||||
if [[ $OS_RELEASE == 'debian' ]]; then
|
||||
[ "$PANDORA_AGENT_PACKAGE_UBUNTU" ] || PANDORA_AGENT_PACKAGE_UBUNTU='https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG_x86_64.tar.gz'
|
||||
execute_cmd "apt update" 'Updating repos'
|
||||
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
|
||||
execute_cmd 'wget http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz' 'Downloading Pandora FMS agent package'
|
||||
execute_cmd "curl --output pandorafms_agent_linux-7.0NG.tar.gz ${PANDORA_AGENT_PACKAGE_UBUNTU}" 'Downloading Pandora FMS agent package'
|
||||
execute_cmd 'install_tarball pandorafms_agent_linux-7.0NG.tar.gz' 'Installing Pandora FMS agent'
|
||||
[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
|
||||
#[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
|
||||
cd $HOME/pandora_deploy_tmp
|
||||
fi
|
||||
|
||||
# Configuring Agente
|
||||
|
||||
[[ $PANDORA_SERVER_IP ]] && sed -i "s/^server_ip.*$/server_ip $PANDORA_SERVER_IP/g" $PANDORA_AGENT_CONF
|
||||
[[ $PANDORA_REMOTE_CONFIG ]] && sed -i "s/^remote_config.*$/remote_config $PANDORA_REMOTE_CONFIG/g" $PANDORA_AGENT_CONF
|
||||
[[ $PANDORA_GROUP ]] && sed -i "s/^group.*$/group $PANDORA_GROUP/g" $PANDORA_AGENT_CONF
|
||||
@ -187,27 +212,6 @@ fi
|
||||
[[ $PANDORA_AGENT_SSL ]] && sed -i "s/^#server_ssl.*$/server_ssl $PANDORA_AGENT_SSL/g" $PANDORA_AGENT_CONF
|
||||
|
||||
|
||||
#installing autodiscover
|
||||
|
||||
arch=$(uname -m)
|
||||
case $arch in
|
||||
|
||||
x86_64)
|
||||
execute_cmd 'install_autodiscover x86_64' "installing service autodiscover on $arch" 'Error unable to install autodiscovery'
|
||||
;;
|
||||
|
||||
x86)
|
||||
execute_cmd 'install_autodiscover x84' "installing service autodiscover on $arch" 'Error unable to install autodiscovery'
|
||||
;;
|
||||
|
||||
armv7l)
|
||||
echo -e "${cyan}Skiping autodiscover installation arch $arch not suported${reset}"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo -e "${yellow}Skiping autodiscover installation arch $arch not suported${reset}"
|
||||
;;
|
||||
esac
|
||||
|
||||
#Starting pandora agent daemon.
|
||||
execute_cmd '/etc/init.d/pandora_agent_daemon restart' 'Starting Pandora Agent'
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.773.3-230906
|
||||
Version: 7.0NG.773.3-230915
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.773.3-230906"
|
||||
pandora_version="7.0NG.773.3-230915"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -1031,7 +1031,7 @@ my $Sem = undef;
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.773.3';
|
||||
use constant AGENT_BUILD => '230906';
|
||||
use constant AGENT_BUILD => '230915';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -4,7 +4,7 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230906
|
||||
%define release 230915
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -5,7 +5,7 @@
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230906
|
||||
%define release 230915
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
Name: %{name}
|
||||
|
@ -4,7 +4,7 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230906
|
||||
%define release 230915
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -10,7 +10,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773.3"
|
||||
PI_BUILD="230906"
|
||||
PI_BUILD="230915"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{230906}
|
||||
{230915}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.773.3 Build 230906")
|
||||
#define PANDORA_VERSION ("7.0NG.773.3 Build 230915")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -11,7 +11,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "Pandora FMS"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.773.3(Build 230906))"
|
||||
VALUE "ProductVersion", "(7.0NG.773.3(Build 230915))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.773.3-230906
|
||||
Version: 7.0NG.773.3-230915
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.773.3-230906"
|
||||
pandora_version="7.0NG.773.3-230915"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -811,7 +811,7 @@ foreach ($simple_alerts as $alert) {
|
||||
$data[3] .= '<tr class="datos2">';
|
||||
$data[3] .= '<td class="w50p">'.html_print_label_input_block(
|
||||
__('Agent'),
|
||||
ui_print_truncate_text($alias, 'agent_small', false, true, true, '[…]')
|
||||
ui_print_truncate_text($alias, 'agent_medium', false, true, true, '[…]')
|
||||
).'</td>';
|
||||
$data[3] .= '<td class="w50p">'.html_print_label_input_block(
|
||||
__('Module'),
|
||||
|
@ -1370,36 +1370,58 @@ $class = 'databox filters';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (is_metaconsole() === true) {
|
||||
?>
|
||||
<tr id="row_servers_all" class="datos">
|
||||
<td class="bolder"><?php echo __('Server'); ?></td>
|
||||
<td >
|
||||
<?php
|
||||
if ($meta) {
|
||||
?>
|
||||
html_print_select(
|
||||
$servers,
|
||||
'combo_server_all',
|
||||
$server_name,
|
||||
'',
|
||||
__('All nodes'),
|
||||
'all'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ($meta) {
|
||||
?>
|
||||
<tr id="row_multiple_servers" class="datos">
|
||||
<td class="bolder"><?php echo __('Server'); ?></td>
|
||||
<td >
|
||||
<?php
|
||||
$server_ids = [];
|
||||
$server_ids[0] = __('Local metaconsole');
|
||||
$get_servers = metaconsole_get_servers();
|
||||
foreach ($get_servers as $key => $server) {
|
||||
$server_ids[$server['id']] = $server['server_name'];
|
||||
}
|
||||
<?php
|
||||
$server_ids = [];
|
||||
$server_ids[0] = __('Local metaconsole');
|
||||
$get_servers = metaconsole_get_servers();
|
||||
foreach ($get_servers as $key => $server) {
|
||||
$server_ids[$server['id']] = $server['server_name'];
|
||||
}
|
||||
|
||||
html_print_select(
|
||||
$server_ids,
|
||||
'server_multiple[]',
|
||||
$server_multiple,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
true
|
||||
);
|
||||
?>
|
||||
html_print_select(
|
||||
$server_ids,
|
||||
'server_multiple[]',
|
||||
$server_multiple,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
true
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
<tr id="row_label" class="datos">
|
||||
<td class="bolder">
|
||||
@ -6651,6 +6673,7 @@ function chooseType() {
|
||||
$("#row_alert_actions").hide();
|
||||
$("#row_servers").hide();
|
||||
$("#row_servers_all_opt").hide();
|
||||
$("#row_servers_all").hide();
|
||||
$("#row_multiple_servers").hide();
|
||||
$("#row_sort").hide();
|
||||
$("#row_date").hide();
|
||||
@ -7218,7 +7241,7 @@ function chooseType() {
|
||||
|
||||
case 'group_report':
|
||||
$("#row_group").show();
|
||||
$("#row_servers_all_opt").show();
|
||||
$("#row_servers_all").show();
|
||||
$("#row_description").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
@ -1997,7 +1997,7 @@ switch ($action) {
|
||||
break;
|
||||
|
||||
case 'group_report':
|
||||
$values['server_name'] = get_parameter('combo_server');
|
||||
$values['server_name'] = get_parameter('combo_server_all');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
@ -2884,7 +2884,7 @@ switch ($action) {
|
||||
break;
|
||||
|
||||
case 'group_report':
|
||||
$values['server_name'] = get_parameter('combo_server');
|
||||
$values['server_name'] = get_parameter('combo_server_all');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
|
@ -1025,6 +1025,27 @@ $table_font->data[$row][] = html_print_label_input_block(
|
||||
);
|
||||
$row++;
|
||||
|
||||
$table_font->data[$row][] = html_print_label_input_block(
|
||||
__('Truncate agent text at end'),
|
||||
html_print_checkbox_switch(
|
||||
'truncate_agent_at_end',
|
||||
1,
|
||||
$config['truncate_agent_at_end'],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table_font->data[$row][] = html_print_label_input_block(
|
||||
__('Truncate module text at end'),
|
||||
html_print_checkbox_switch(
|
||||
'truncate_module_at_end',
|
||||
1,
|
||||
$config['truncate_module_at_end'],
|
||||
true
|
||||
)
|
||||
);
|
||||
$row++;
|
||||
|
||||
$table_font->data[$row][] = html_print_label_input_block(
|
||||
__('Agent size text'),
|
||||
html_print_div(
|
||||
|
@ -501,7 +501,7 @@ if ($show_update_action_menu) {
|
||||
$data .= '<td class="datos">';
|
||||
$data .= ui_print_truncate_text(
|
||||
$agent_alias,
|
||||
'agent_small',
|
||||
'agent_medium',
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
|
57
pandora_console/include/ajax/notifications.ajax.php
Normal file
57
pandora_console/include/ajax/notifications.ajax.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Users
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
// Includes.
|
||||
require_once $config['homedir'].'/include/functions_notifications.php';
|
||||
|
||||
$change_label = get_parameter('change_label', 0);
|
||||
if ($change_label === '1') {
|
||||
$label = get_parameter('label', '');
|
||||
$source = get_parameter('source', 0);
|
||||
$user = get_parameter('user', '');
|
||||
$value = get_parameter('value', 0) ? 1 : 0;
|
||||
|
||||
// Update the label value.
|
||||
ob_clean();
|
||||
$json = json_encode(
|
||||
[
|
||||
'result' => notifications_set_user_label_status(
|
||||
$source,
|
||||
$user,
|
||||
$label,
|
||||
$value
|
||||
),
|
||||
]
|
||||
);
|
||||
|
||||
echo $json;
|
||||
return;
|
||||
}
|
@ -703,7 +703,7 @@ class ConsoleSupervisor
|
||||
$total_agents = db_get_value('count(*)', 'tagente');
|
||||
|
||||
if ($total_agents >= 200) {
|
||||
if ($config['agentaccess'] !== 0) {
|
||||
if ((int) $config['agentaccess'] !== 0) {
|
||||
db_process_sql_update('tconfig', ['value' => 0], ['token' => 'agentaccess']);
|
||||
$this->notify(
|
||||
[
|
||||
|
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230906';
|
||||
$build_version = 'PC230915';
|
||||
$pandora_version = 'v7.0NG.773.3';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -1288,6 +1288,10 @@ function config_update_config()
|
||||
$error_update[] = __('Default line menu items for the Services');
|
||||
}
|
||||
|
||||
if (config_update_value('truncate_agent_at_end', get_parameter('truncate_agent_at_end'), true) === false) {
|
||||
$error_update[] = __('Truncate agent text at end');
|
||||
}
|
||||
|
||||
if (config_update_value('agent_size_text_small', get_parameter('agent_size_text_small'), true) === false) {
|
||||
$error_update[] = __('Agent size text');
|
||||
}
|
||||
@ -1296,6 +1300,10 @@ function config_update_config()
|
||||
$error_update[] = __('Agent size text');
|
||||
}
|
||||
|
||||
if (config_update_value('truncate_module_at_end', get_parameter('truncate_module_at_end'), true) === false) {
|
||||
$error_update[] = __('Truncate module text at end');
|
||||
}
|
||||
|
||||
if (config_update_value('module_size_text_small', get_parameter('module_size_text_small'), true) === false) {
|
||||
$error_update[] = __('Module size text');
|
||||
}
|
||||
@ -3526,6 +3534,10 @@ function config_process_config()
|
||||
config_update_value('display_item_frame', 1);
|
||||
}
|
||||
|
||||
if (!isset($config['truncate_agent_at_end'])) {
|
||||
config_update_value('truncate_agent_at_end', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['agent_size_text_small'])) {
|
||||
config_update_value('agent_size_text_small', 18);
|
||||
}
|
||||
@ -3534,6 +3546,10 @@ function config_process_config()
|
||||
config_update_value('agent_size_text_medium', 50);
|
||||
}
|
||||
|
||||
if (!isset($config['truncate_module_at_end'])) {
|
||||
config_update_value('truncate_module_at_end', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['module_size_text_small'])) {
|
||||
config_update_value('module_size_text_small', 25);
|
||||
}
|
||||
|
@ -1577,10 +1577,16 @@ function graphic_combined_module(
|
||||
$server_name = metaconsole_get_server_by_id($modules[0]['server']);
|
||||
}
|
||||
|
||||
if (isset($params_combined['custom_period']) !== false && $params_combined['custom_period'] !== false) {
|
||||
$period = $params_combined['custom_period'];
|
||||
} else {
|
||||
$period = $params['period'];
|
||||
}
|
||||
|
||||
if ($params_combined['projection']) {
|
||||
$output_projection = forecast_projection_graph(
|
||||
$module_list[0],
|
||||
$params['period'],
|
||||
$period,
|
||||
$params_combined['projection'],
|
||||
false,
|
||||
false,
|
||||
@ -5376,9 +5382,11 @@ function graph_so_by_group($id_group, $width=300, $height=200, $recursive=true,
|
||||
'SELECT COUNT(id_agente) AS count,
|
||||
os.name
|
||||
FROM tagente a
|
||||
LEFT JOIN tagent_secondary_group g ON g.id_agent = a.id_agente
|
||||
LEFT JOIN tconfig_os os ON a.id_os = os.id_os
|
||||
WHERE a.id_grupo IN (%s)
|
||||
WHERE a.id_grupo IN (%s) OR g.id_group IN (%s)
|
||||
GROUP BY os.id_os',
|
||||
implode(',', $id_groups),
|
||||
implode(',', $id_groups)
|
||||
);
|
||||
|
||||
@ -5460,7 +5468,7 @@ function graph_events_agent_by_group($id_group, $width=300, $height=200, $noWate
|
||||
}
|
||||
}
|
||||
|
||||
$filter_groups = ' AND te.id_grupo IN ('.implode(',', $id_groups).') ';
|
||||
$filter_groups = ' AND (te.id_grupo IN ('.implode(',', $id_groups).') OR g.id_group IN ('.implode(',', $id_groups).'))';
|
||||
|
||||
// This will give the distinct id_agente, give the id_grupo that goes
|
||||
// with it and then the number of times it occured. GROUP BY statement
|
||||
@ -5469,7 +5477,8 @@ function graph_events_agent_by_group($id_group, $width=300, $height=200, $noWate
|
||||
'SELECT DISTINCT(id_agente) AS id_agente,
|
||||
COUNT(id_agente) AS count
|
||||
FROM tevento te
|
||||
WHERE 1=1 AND estado = 0
|
||||
LEFT JOIN tagent_secondary_group g ON g.id_agent = te.id_agente
|
||||
WHERE 1=1 AND estado = 0
|
||||
%s %s
|
||||
GROUP BY id_agente
|
||||
ORDER BY count DESC LIMIT 8',
|
||||
|
@ -2501,7 +2501,9 @@ function groups_get_heat_map_agents(array $id_group, float $width=0, float $heig
|
||||
$id_group = [$id_group];
|
||||
}
|
||||
|
||||
$sql = 'SELECT * FROM tagente WHERE id_grupo IN('.implode(',', $id_group).')';
|
||||
$sql = 'SELECT * FROM tagente a
|
||||
LEFT JOIN tagent_secondary_group g ON g.id_agent = a.id_agente
|
||||
WHERE a.id_grupo IN ('.implode(',', $id_group).') OR g.id_group IN ('.implode(',', $id_group).')';
|
||||
|
||||
$all_agents = db_get_all_rows_sql($sql);
|
||||
if (empty($all_agents)) {
|
||||
@ -2654,8 +2656,8 @@ function tactical_groups_get_agents_and_monitoring($id_groups, $data='')
|
||||
|
||||
if ($data === '') {
|
||||
$data = [
|
||||
'total_agents' => groups_agents_total_counters($id_groups, false)['total'],
|
||||
'monitor_total' => groups_get_total_monitors($id_groups, [], [], false, false, false, false),
|
||||
'total_agents' => groups_agents_total_counters($id_groups, true)['total'],
|
||||
'monitor_total' => groups_get_total_monitors($id_groups, [], [], false, false, false, true),
|
||||
];
|
||||
}
|
||||
|
||||
@ -2719,7 +2721,7 @@ function tactical_groups_get_stats_alerts($id_groups, $data='')
|
||||
}
|
||||
|
||||
$urls = [];
|
||||
$urls['monitor_alerts'] = $config['homeurl'].'index.php?sec=estado&sec2=operation/agentes/alerts_status&refr=60&ag_group='.$id_groups[0];
|
||||
$urls['monitor_alerts'] = $config['homeurl'].'index.php?sec=estado&sec2=operation/agentes/alerts_status&refr=60&disabled=all&ag_group='.$id_groups[0];
|
||||
$urls['monitor_alerts_fired'] = $config['homeurl'].'index.php?sec=estado&sec2=operation/agentes/alerts_status&refr=60&disabled=fired&ag_group='.$id_groups[0];
|
||||
|
||||
// Alerts table.
|
||||
@ -2790,11 +2792,11 @@ function groups_get_stats_modules_status($id_groups, $graph_width=250, $graph_he
|
||||
|
||||
if ($data === '') {
|
||||
$data = [
|
||||
'monitor_critical' => groups_get_critical_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_warning' => groups_get_warning_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_ok' => groups_get_normal_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_unknown' => groups_get_unknown_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_not_init' => groups_get_not_init_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_critical' => groups_get_critical_monitors($id_groups, [], [], false, false, false, true),
|
||||
'monitor_warning' => groups_get_warning_monitors($id_groups, [], [], false, false, false, true),
|
||||
'monitor_ok' => groups_get_normal_monitors($id_groups, [], [], false, false, false, true),
|
||||
'monitor_unknown' => groups_get_unknown_monitors($id_groups, [], [], false, false, false, true),
|
||||
'monitor_not_init' => groups_get_not_init_monitors($id_groups, [], [], false, false, false, true),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -3303,7 +3303,7 @@ function html_print_input_image($name, $src, $value, $style='', $return=false, $
|
||||
|
||||
// If metaconsole is activated and image doesn't exists try to search on normal console.
|
||||
if (is_metaconsole() === true) {
|
||||
if (false === @file_get_contents($src, 0, null, 0, 1)) {
|
||||
if ($src !== null && false === @file_get_contents($src, 0, null, 0, 1)) {
|
||||
$src = '../../'.$src;
|
||||
}
|
||||
}
|
||||
@ -7302,6 +7302,8 @@ function html_print_select_date_range(
|
||||
$date_init = date('Y/m/d', strtotime($date_end.' -1 days'));
|
||||
}
|
||||
|
||||
$date_init = date('Y/m/d', strtotime($date_init));
|
||||
|
||||
if ($time_init === '') {
|
||||
$time_init = date('H:i:s');
|
||||
}
|
||||
|
@ -701,6 +701,7 @@ function modules_update_agent_module(
|
||||
}
|
||||
|
||||
// Disable action requires a special function
|
||||
$result = false;
|
||||
if (isset($values['disabled'])) {
|
||||
$result_disable = modules_change_disabled($id, $values['disabled']);
|
||||
|
||||
@ -709,7 +710,9 @@ function modules_update_agent_module(
|
||||
$result_disable = true;
|
||||
}
|
||||
|
||||
$result = @db_process_sql_update('tagente_modulo', $values, $where);
|
||||
if (empty($values) === false) {
|
||||
$result = @db_process_sql_update('tagente_modulo', $values, $where);
|
||||
}
|
||||
|
||||
if ($result == false) {
|
||||
if ($result_disable === ERR_GENERIC) {
|
||||
|
@ -635,6 +635,12 @@ function notifications_get_user_label_status($source, $user, $label)
|
||||
array_keys(users_get_groups($user)),
|
||||
array_keys(notifications_get_group_sources_for_select($source['id']))
|
||||
);
|
||||
|
||||
// Clean default common groups error for mesagges.
|
||||
if ($common_groups[0] === 0) {
|
||||
unset($common_groups[0]);
|
||||
}
|
||||
|
||||
// No group found, return no permissions.
|
||||
$value = empty($common_groups) ? false : $source[$label];
|
||||
return notifications_build_user_enable_return($value, false);
|
||||
@ -760,9 +766,10 @@ function notifications_print_global_source_configuration($source)
|
||||
}
|
||||
|
||||
// Generate the title.
|
||||
$html_title = "<div class='global-config-notification-title'>";
|
||||
$html_title = '<h2 style="margin-bottom: auto;">'.$source['description'].'</h2>';
|
||||
$html_title .= "<div class='global-config-notification-title'>";
|
||||
$html_title .= html_print_switch($switch_values);
|
||||
$html_title .= '<h2>'.$source['description'].'</h2>';
|
||||
$html_title .= '<h2>'.__('Enable user configuration').'</h2>';
|
||||
$html_title .= '</div>';
|
||||
|
||||
// Generate the html for title.
|
||||
|
@ -159,7 +159,10 @@ function reporting_make_reporting_data(
|
||||
$force_width_chart=null,
|
||||
$force_height_chart=null,
|
||||
$pdf=false,
|
||||
$from_template=false
|
||||
$from_template=false,
|
||||
$filter_type='',
|
||||
$custom_date_end='',
|
||||
$custom_period=false
|
||||
) {
|
||||
global $config;
|
||||
|
||||
@ -194,8 +197,7 @@ function reporting_make_reporting_data(
|
||||
|
||||
if (empty($contents)) {
|
||||
return reporting_check_structure_report($report);
|
||||
}
|
||||
|
||||
};
|
||||
$metaconsole_on = is_metaconsole();
|
||||
$index_content = 0;
|
||||
|
||||
@ -562,7 +564,10 @@ function reporting_make_reporting_data(
|
||||
$type,
|
||||
$force_width_chart,
|
||||
$force_height_chart,
|
||||
$pdf
|
||||
$pdf,
|
||||
$filter_type,
|
||||
$custom_date_end,
|
||||
$custom_period
|
||||
);
|
||||
break;
|
||||
|
||||
@ -6917,7 +6922,10 @@ function reporting_projection_graph(
|
||||
$type='dinamic',
|
||||
$force_width_chart=null,
|
||||
$force_height_chart=null,
|
||||
$pdf=false
|
||||
$pdf=false,
|
||||
$filter_type='',
|
||||
$custom_date_end='',
|
||||
$custom_period=false
|
||||
) {
|
||||
global $config;
|
||||
|
||||
@ -6983,6 +6991,7 @@ function reporting_projection_graph(
|
||||
$return['agent_name_db'] = $agent_name_db;
|
||||
$return['agent_name'] = $agent_name;
|
||||
$return['module_name'] = $module_name;
|
||||
$return['datetime'] = $report['datetime'];
|
||||
|
||||
set_time_limit(500);
|
||||
|
||||
@ -7003,8 +7012,24 @@ function reporting_projection_graph(
|
||||
'return_img_base_64' => true,
|
||||
];
|
||||
|
||||
$top_n_value = $content['top_n_value'];
|
||||
if ($filter_type === 'this_week') {
|
||||
$current_date = date('Y/m/d H:i:s');
|
||||
$monday = date('Y/m/d H:i:s', strtotime('last monday'));
|
||||
$sunday = date('Y/m/d H:i:s', strtotime($monday.' +6 days'));
|
||||
$top_n_value = (strtotime($sunday) - strtotime($current_date));
|
||||
} else if ($filter_type === 'this_month') {
|
||||
$current_date = date('Y/m/d H:i:s');
|
||||
$last_of_month = date('Y/m/d', strtotime('last day of this month'));
|
||||
$top_n_value = (strtotime($last_of_month) - strtotime($current_date));
|
||||
} else if ($filter_type === 'chose_range') {
|
||||
$current_date = date('Y/m/d H:i:s');
|
||||
$top_n_value = (strtotime($custom_date_end) - strtotime($current_date));
|
||||
}
|
||||
|
||||
$params_combined = [
|
||||
'projection' => $content['top_n_value'],
|
||||
'projection' => $top_n_value,
|
||||
'custom_period' => $custom_period,
|
||||
];
|
||||
|
||||
if ($pdf === true) {
|
||||
|
@ -26,6 +26,7 @@
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
require_once $config['homedir'].'/include/functions.php';
|
||||
require_once $config['homedir'].'/include/functions_db.php';
|
||||
@ -119,10 +120,15 @@ function reporting_html_header(
|
||||
}
|
||||
|
||||
|
||||
function html_do_report_info($report)
|
||||
function html_do_report_info($report, $custom_date_end=false, $custom_period=false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if ($custom_period !== false && $custom_date_end !== false) {
|
||||
$report['datetime'] = strtotime($custom_date_end);
|
||||
$report['period'] = $custom_period;
|
||||
}
|
||||
|
||||
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
|
||||
$background_color = '#222';
|
||||
} else {
|
||||
@ -170,10 +176,10 @@ function html_do_report_info($report)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function reporting_html_print_report($report, $mini=false, $report_info=1)
|
||||
function reporting_html_print_report($report, $mini=false, $report_info=1, $custom_date_end=false, $custom_period=false)
|
||||
{
|
||||
if ($report_info == 1) {
|
||||
html_do_report_info($report);
|
||||
html_do_report_info($report, $custom_date_end, $custom_period);
|
||||
}
|
||||
|
||||
foreach ($report['contents'] as $key => $item) {
|
||||
@ -226,6 +232,12 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
||||
$label = '';
|
||||
}
|
||||
|
||||
if ($custom_date_end !== false) {
|
||||
$to = strtotime($custom_date_end);
|
||||
} else {
|
||||
$to = $item['date']['to'];
|
||||
}
|
||||
|
||||
reporting_html_header(
|
||||
$table,
|
||||
$mini,
|
||||
@ -234,7 +246,7 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
||||
$item['date']['period'],
|
||||
$item['date']['date'],
|
||||
$item['date']['from'],
|
||||
$item['date']['to'],
|
||||
$to,
|
||||
$label
|
||||
);
|
||||
|
||||
@ -2703,16 +2715,66 @@ function reporting_html_group_report($table, $item, $pdf=0)
|
||||
$table->colspan['group_report']['cell'] = 3;
|
||||
$table->cellstyle['group_report']['cell'] = 'text-align: center;';
|
||||
$metaconsole_connected = false;
|
||||
if (is_metaconsole() === true) {
|
||||
if (is_metaconsole() === true && $item['server_name'] != '0') {
|
||||
$connection = metaconsole_get_connection($item['server_name']);
|
||||
if (metaconsole_connect($connection) == NOERR) {
|
||||
$metaconsole_connected = true;
|
||||
}
|
||||
}
|
||||
|
||||
$all_group_id = [];
|
||||
$group_events = [];
|
||||
$group_os = [];
|
||||
|
||||
if ($item['subtitle'] === 'All') {
|
||||
if (is_metaconsole() === true && $item['server_name'] === 'all' || $item['server_name'] === '0') {
|
||||
$nodes = metaconsole_get_connections();
|
||||
foreach ($nodes as $node) {
|
||||
try {
|
||||
$nd = new Node($node['id']);
|
||||
$nd->connect();
|
||||
|
||||
$all_group_id_node = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo');
|
||||
|
||||
$group_events_node = db_get_all_rows_sql(
|
||||
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||
FROM tevento as te
|
||||
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente
|
||||
GROUP BY te.id_agente'
|
||||
);
|
||||
$group_os_node = db_get_all_rows_sql(
|
||||
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||
FROM tconfig_os as os
|
||||
INNER JOIN tagente as ta ON ta.id_os = os.id_os GROUP by os.name'
|
||||
);
|
||||
|
||||
$all_group_id = array_merge($all_group_id, $all_group_id_node);
|
||||
$group_events = array_merge($group_events, $group_events_node);
|
||||
$group_os = array_merge($group_os, $group_os_node);
|
||||
} catch (\Exception $e) {
|
||||
$nd->disconnect();
|
||||
$modules_regex_node = [];
|
||||
} finally {
|
||||
$nd->disconnect();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$all_group_id = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo');
|
||||
|
||||
$group_events = db_get_all_rows_sql(
|
||||
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||
FROM tevento as te
|
||||
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente
|
||||
GROUP BY te.id_agente'
|
||||
);
|
||||
$group_os = db_get_all_rows_sql(
|
||||
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||
FROM tconfig_os as os
|
||||
INNER JOIN tagente as ta ON ta.id_os = os.id_os GROUP by os.name'
|
||||
);
|
||||
}
|
||||
|
||||
$group_id = [];
|
||||
$all_group_id = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo');
|
||||
|
||||
foreach ($all_group_id as $group) {
|
||||
$group_id[] = $group['id_grupo'];
|
||||
@ -2720,61 +2782,113 @@ function reporting_html_group_report($table, $item, $pdf=0)
|
||||
|
||||
$description = __('Data view of all groups');
|
||||
$icon = '';
|
||||
|
||||
$group_events = db_get_all_rows_sql(
|
||||
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||
FROM tevento as te
|
||||
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente
|
||||
GROUP BY te.id_agente'
|
||||
);
|
||||
|
||||
$group_os = db_get_all_rows_sql(
|
||||
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||
FROM tconfig_os as os
|
||||
INNER JOIN tagente as ta ON ta.id_os = os.id_os GROUP by os.name'
|
||||
);
|
||||
} else {
|
||||
$group_id = db_get_value('id_grupo', 'tgrupo', 'nombre', $item['subtitle']);
|
||||
$description = db_get_value('description', 'tgrupo', 'id_grupo', $group_id);
|
||||
$icon_url = db_get_value('icon', 'tgrupo', 'id_grupo', $group_id);
|
||||
$icon = html_print_image(
|
||||
'images/'.$icon_url,
|
||||
true,
|
||||
[
|
||||
'title' => $item['subtitle'],
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
|
||||
$childrens = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo WHERE parent = '.$group_id);
|
||||
$total_agents = db_get_all_rows_sql('SELECT COUNT(id_agente) as total FROM tagente where id_grupo = '.$group_id);
|
||||
if (is_metaconsole() === true && $item['server_name'] === 'all' || $item['server_name'] === '0') {
|
||||
$nodes = metaconsole_get_connections();
|
||||
foreach ($nodes as $node) {
|
||||
try {
|
||||
$nd = new Node($node['id']);
|
||||
$nd->connect();
|
||||
|
||||
if ($childrens !== false && (int) $total_agents[0]['total'] !== $item['data']['group_stats']['total_agents']) {
|
||||
$array_group_id = [];
|
||||
$array_group_id[] = $group_id;
|
||||
foreach ($childrens as $group) {
|
||||
$array_group_id[] = $group['id_grupo'];
|
||||
$group_id_node = db_get_value('id_grupo', 'tgrupo', 'nombre', $item['subtitle']);
|
||||
$description = db_get_value('description', 'tgrupo', 'id_grupo', $group_id_node);
|
||||
$icon_url = db_get_value('icon', 'tgrupo', 'id_grupo', $group_id_node);
|
||||
$icon = html_print_image(
|
||||
'images/'.$icon_url,
|
||||
true,
|
||||
[
|
||||
'title' => $item['subtitle'],
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
|
||||
$childrens = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo WHERE parent = '.$group_id_node);
|
||||
$total_agents = db_get_all_rows_sql('SELECT COUNT(id_agente) as total FROM tagente where id_grupo = '.$group_id_node);
|
||||
|
||||
if ($childrens !== false && (int) $total_agents[0]['total'] !== $item['data']['group_stats']['total_agents']) {
|
||||
$array_group_id = [];
|
||||
$array_group_id[] = $group_id_node;
|
||||
foreach ($childrens as $group) {
|
||||
$array_group_id[] = $group['id_grupo'];
|
||||
}
|
||||
|
||||
$group_id_node = $array_group_id;
|
||||
$explode_group_id = implode(',', $group_id_node);
|
||||
} else {
|
||||
$explode_group_id = $group_id_node;
|
||||
}
|
||||
|
||||
$group_events_node = db_get_all_rows_sql(
|
||||
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||
FROM tevento as te
|
||||
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo IN ('.$explode_group_id.')
|
||||
GROUP BY te.id_agente'
|
||||
);
|
||||
|
||||
$group_os_node = db_get_all_rows_sql(
|
||||
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||
FROM tconfig_os as os
|
||||
INNER JOIN tagente as ta ON ta.id_os = os.id_os
|
||||
WHERE ta.id_grupo IN ('.$explode_group_id.') GROUP by os.name'
|
||||
);
|
||||
|
||||
if (is_array($group_events_node) === true) {
|
||||
$group_events = array_merge($group_events, $group_events_node);
|
||||
}
|
||||
|
||||
if (is_array($group_os_node) === true) {
|
||||
$group_os = array_merge($group_os, $group_os_node);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$nd->disconnect();
|
||||
} finally {
|
||||
$nd->disconnect();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$description = db_get_value('description', 'tgrupo', 'id_grupo', $group_id);
|
||||
$icon_url = db_get_value('icon', 'tgrupo', 'id_grupo', $group_id);
|
||||
$icon = html_print_image(
|
||||
'images/'.$icon_url,
|
||||
true,
|
||||
[
|
||||
'title' => $item['subtitle'],
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
|
||||
$childrens = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo WHERE parent = '.$group_id);
|
||||
$total_agents = db_get_all_rows_sql('SELECT COUNT(id_agente) as total FROM tagente where id_grupo = '.$group_id);
|
||||
|
||||
if ($childrens !== false && (int) $total_agents[0]['total'] !== $item['data']['group_stats']['total_agents']) {
|
||||
$array_group_id = [];
|
||||
$array_group_id[] = $group_id;
|
||||
foreach ($childrens as $group) {
|
||||
$array_group_id[] = $group['id_grupo'];
|
||||
}
|
||||
|
||||
$group_id = $array_group_id;
|
||||
$explode_group_id = implode(',', $group_id);
|
||||
} else {
|
||||
$explode_group_id = $group_id;
|
||||
}
|
||||
|
||||
$group_id = $array_group_id;
|
||||
$explode_group_id = implode(',', $group_id);
|
||||
} else {
|
||||
$explode_group_id = $group_id;
|
||||
$group_events = db_get_all_rows_sql(
|
||||
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||
FROM tevento as te
|
||||
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo IN ('.$explode_group_id.')
|
||||
GROUP BY te.id_agente'
|
||||
);
|
||||
|
||||
$group_os = db_get_all_rows_sql(
|
||||
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||
FROM tconfig_os as os
|
||||
INNER JOIN tagente as ta ON ta.id_os = os.id_os
|
||||
WHERE ta.id_grupo IN ('.$explode_group_id.') GROUP by os.name'
|
||||
);
|
||||
}
|
||||
|
||||
$group_events = db_get_all_rows_sql(
|
||||
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||
FROM tevento as te
|
||||
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo IN ('.$explode_group_id.')
|
||||
GROUP BY te.id_agente'
|
||||
);
|
||||
|
||||
$group_os = db_get_all_rows_sql(
|
||||
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||
FROM tconfig_os as os
|
||||
INNER JOIN tagente as ta ON ta.id_os = os.id_os
|
||||
WHERE ta.id_grupo IN ('.$explode_group_id.') GROUP by os.name'
|
||||
);
|
||||
}
|
||||
|
||||
if ($metaconsole_connected === true) {
|
||||
@ -2885,8 +2999,10 @@ function reporting_html_group_report($table, $item, $pdf=0)
|
||||
$options = [];
|
||||
$labels = [];
|
||||
foreach ($group_os as $value) {
|
||||
$data[$value['name_os']] = $value['count_os'];
|
||||
$labels[] = io_safe_output($value['name_os']);
|
||||
$data[$value['name_os']] += $value['count_os'];
|
||||
if (array_search($value['name_os'], $labels) === false) {
|
||||
$labels[] = io_safe_output($value['name_os']);
|
||||
}
|
||||
}
|
||||
|
||||
$options = [
|
||||
|
@ -283,6 +283,10 @@ function servers_get_performance($filter=[])
|
||||
}
|
||||
|
||||
foreach ($counts as $c) {
|
||||
if (empty($c['modules']) === true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch ($c['server_type']) {
|
||||
case SERVER_TYPE_DATA:
|
||||
$data['total_local_modules'] = $c['modules'];
|
||||
@ -292,7 +296,7 @@ function servers_get_performance($filter=[])
|
||||
case SERVER_TYPE_SNMP:
|
||||
case SERVER_TYPE_ENTERPRISE_ICMP:
|
||||
case SERVER_TYPE_ENTERPRISE_SNMP:
|
||||
$data['total_network_modules'] = $c['modules'];
|
||||
$data['total_network_modules'] += $c['modules'];
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_PLUGIN:
|
||||
|
@ -99,23 +99,27 @@ function ui_print_truncate_text(
|
||||
$forced_title=false
|
||||
) {
|
||||
global $config;
|
||||
|
||||
$truncate_at_end = false;
|
||||
if (is_string($numChars)) {
|
||||
switch ($numChars) {
|
||||
case 'agent_small':
|
||||
$numChars = $config['agent_size_text_small'];
|
||||
$truncate_at_end = (bool) $config['truncate_agent_at_end'];
|
||||
break;
|
||||
|
||||
case 'agent_medium':
|
||||
$numChars = $config['agent_size_text_medium'];
|
||||
$truncate_at_end = (bool) $config['truncate_agent_at_end'];
|
||||
break;
|
||||
|
||||
case 'module_small':
|
||||
$numChars = $config['module_size_text_small'];
|
||||
$truncate_at_end = (bool) $config['truncate_module_at_end'];
|
||||
break;
|
||||
|
||||
case 'module_medium':
|
||||
$numChars = $config['module_size_text_medium'];
|
||||
$truncate_at_end = (bool) $config['truncate_module_at_end'];
|
||||
break;
|
||||
|
||||
case 'description':
|
||||
@ -147,27 +151,35 @@ function ui_print_truncate_text(
|
||||
// '/2' because [...] is in the middle of the word.
|
||||
$half_length = intval(($numChars - 3) / 2);
|
||||
|
||||
// Depending on the strange behavior of mb_strimwidth() itself,
|
||||
// the 3rd parameter is not to be $numChars but the length of
|
||||
// original text (just means 'large enough').
|
||||
$truncateText2 = mb_strimwidth(
|
||||
$text_html_decoded,
|
||||
(mb_strlen($text_html_decoded, 'UTF-8') - $half_length),
|
||||
mb_strlen($text_html_decoded, 'UTF-8'),
|
||||
'',
|
||||
'UTF-8'
|
||||
);
|
||||
if ($truncate_at_end === true) {
|
||||
// Recover the html entities to avoid XSS attacks.
|
||||
$truncateText = ($text_has_entities) ? io_safe_input(substr($text_html_decoded, 0, $numChars)) : substr($text_html_decoded, 0, $numChars);
|
||||
if (strlen($text_html_decoded) > $numChars) {
|
||||
$truncateText .= '...';
|
||||
}
|
||||
} else {
|
||||
// Depending on the strange behavior of mb_strimwidth() itself,
|
||||
// the 3rd parameter is not to be $numChars but the length of
|
||||
// original text (just means 'large enough').
|
||||
$truncateText2 = mb_strimwidth(
|
||||
$text_html_decoded,
|
||||
(mb_strlen($text_html_decoded, 'UTF-8') - $half_length),
|
||||
mb_strlen($text_html_decoded, 'UTF-8'),
|
||||
'',
|
||||
'UTF-8'
|
||||
);
|
||||
|
||||
$truncateText = mb_strimwidth(
|
||||
$text_html_decoded,
|
||||
0,
|
||||
($numChars - $half_length),
|
||||
'',
|
||||
'UTF-8'
|
||||
);
|
||||
$truncateText = mb_strimwidth(
|
||||
$text_html_decoded,
|
||||
0,
|
||||
($numChars - $half_length),
|
||||
'',
|
||||
'UTF-8'
|
||||
);
|
||||
|
||||
// Recover the html entities to avoid XSS attacks.
|
||||
$truncateText = ($text_has_entities) ? io_safe_input($truncateText).$suffix.io_safe_input($truncateText2) : $truncateText.$suffix.$truncateText2;
|
||||
// Recover the html entities to avoid XSS attacks.
|
||||
$truncateText = ($text_has_entities) ? io_safe_input($truncateText).$suffix.io_safe_input($truncateText2) : $truncateText.$suffix.$truncateText2;
|
||||
}
|
||||
|
||||
if ($showTextInTitle) {
|
||||
if ($style === null) {
|
||||
@ -1634,7 +1646,7 @@ function ui_format_alert_row(
|
||||
$data[$index['actions']] .= '<tr class="datos2">';
|
||||
$data[$index['actions']] .= '<td class="w50p">'.html_print_label_input_block(
|
||||
__('Agent'),
|
||||
ui_print_truncate_text($agente['alias'], 'agent_small', false, true, true, '[…]')
|
||||
ui_print_truncate_text($agente['alias'], 'agent_medium', false, true, true, '[…]')
|
||||
).'</td>';
|
||||
$data[$index['actions']] .= '<td class="w50p">'.html_print_label_input_block(
|
||||
__('Module'),
|
||||
@ -3913,6 +3925,11 @@ function ui_print_datatable(array $parameters)
|
||||
$parameters['toggle_collapsed'] = true;
|
||||
}
|
||||
|
||||
$parameters['startDisabled'] = false;
|
||||
if (isset($parameters['start_disabled']) && $parameters['start_disabled'] === true) {
|
||||
$parameters['startDisabled'] = true;
|
||||
}
|
||||
|
||||
$columns_tmp = [];
|
||||
foreach ($parameters['columns'] as $k_column => $v_column) {
|
||||
if (isset($parameters['columns'][$k_column]['text']) === true) {
|
||||
@ -4126,7 +4143,7 @@ function ui_print_datatable(array $parameters)
|
||||
|
||||
// Base table.
|
||||
$table = '<table id="'.$table_id.'" ';
|
||||
$table .= 'class="'.$parameters['class'].'"';
|
||||
$table .= 'class="invisible '.$parameters['class'].'"';
|
||||
$table .= 'style="box-sizing: border-box;'.$parameters['style'].'">';
|
||||
$table .= '<thead><tr class="datatables_thead_tr">';
|
||||
|
||||
@ -4200,13 +4217,19 @@ function ui_print_datatable(array $parameters)
|
||||
$info_msg_arr['message'] = $emptyTable;
|
||||
$info_msg_arr['div_class'] = 'info_box_container invisible_important datatable-msg-info-'.$table_id;
|
||||
|
||||
$spinner = '<div id="'.$table_id.'-spinner" class="spinner-fixed"><span></span><span></span><span></span><span></span></div>';
|
||||
$info_msg_arr_filter = [];
|
||||
$info_msg_arr_filter['message'] = __('Please apply a filter to display the data.');
|
||||
$info_msg_arr_filter['div_class'] = 'info_box_container invisible_important datatable-msg-info-filter-'.$table_id;
|
||||
|
||||
$spinner = '<div id="'.$table_id.'-spinner" class="invisible spinner-fixed"><span></span><span></span><span></span><span></span></div>';
|
||||
|
||||
// TODO This widget should take a return: ui_print_info_message($info_msg_arr, '', true)
|
||||
$info_msg = '<div>'.ui_print_info_message($info_msg_arr).'</div>';
|
||||
|
||||
$info_msg_filter = '<div>'.ui_print_info_message($info_msg_arr_filter, true).'</div>';
|
||||
|
||||
$err_msg = '<div id="error-'.$table_id.'"></div>';
|
||||
$output = $info_msg.$err_msg.$filter.$extra.$spinner.$table.$js;
|
||||
$output = $info_msg.$info_msg_filter.$err_msg.$filter.$extra.$spinner.$table.$js;
|
||||
if (is_ajax() === false) {
|
||||
ui_require_css_file('datatables.min', 'include/styles/js/');
|
||||
ui_require_css_file('tables');
|
||||
|
@ -126,6 +126,11 @@ if (typeof dt.ajax_data !== "undefined") {
|
||||
ajaxData = dt.ajax_data;
|
||||
}
|
||||
|
||||
var startDisabled = false;
|
||||
if (dt.startDisabled === true) {
|
||||
startDisabled = true;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
function checkPages() {
|
||||
if (dt_table.page.info().pages > 1) {
|
||||
@ -335,7 +340,25 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
$.extend(settings_datatable, ajaxOrData);
|
||||
var dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable);
|
||||
|
||||
var dt_table;
|
||||
|
||||
if (startDisabled === true) {
|
||||
$(`.datatable-msg-info-filter-${dt.id}`)
|
||||
.removeClass("invisible_important")
|
||||
.show();
|
||||
|
||||
$(`div#${dt.id}-spinner`).hide();
|
||||
$(`#${dt.table_id}`).hide();
|
||||
|
||||
$(`#button-form_${dt.table_id}_search_bt`).click(function() {
|
||||
$(`.datatable-msg-info-filter-${dt.id}`).hide();
|
||||
$(`#${dt.table_id}`).show();
|
||||
dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable);
|
||||
});
|
||||
} else {
|
||||
dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable);
|
||||
}
|
||||
|
||||
$(`#button-${dt.form_id}_search_bt`).click(function() {
|
||||
dt_table.draw().page(0);
|
||||
|
@ -663,11 +663,14 @@ class Group extends Entity
|
||||
ultimo_contacto_remoto,
|
||||
fired_count
|
||||
FROM tagente t
|
||||
LEFT JOIN tagent_secondary_group g ON g.id_agent = t.id_agente
|
||||
WHERE disabled = 0 AND
|
||||
total_count <> notinit_count AND
|
||||
id_grupo IN (%s)
|
||||
(id_grupo IN (%s) OR id_group IN (%s))
|
||||
|
||||
%s %s',
|
||||
implode(',', $id_groups),
|
||||
implode(',', $id_groups),
|
||||
$order,
|
||||
$pagination
|
||||
);
|
||||
@ -686,11 +689,13 @@ class Group extends Entity
|
||||
ultimo_contacto_remoto,
|
||||
fired_count
|
||||
FROM tagente t
|
||||
LEFT JOIN tagent_secondary_group g ON g.id_agent = t.id_agente
|
||||
WHERE disabled = 0 AND
|
||||
total_count <> notinit_count AND
|
||||
id_grupo IN (%s)
|
||||
(id_grupo IN (%s) OR id_group IN (%s))
|
||||
%s',
|
||||
implode(',', $id_groups),
|
||||
implode(',', $id_groups),
|
||||
$order,
|
||||
);
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
.ui-dialog .ui-corner-all .ui-widget {
|
||||
border-radius: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
@ -217,7 +216,7 @@ a.ui-state-default > span:hover {
|
||||
color: #000;
|
||||
}
|
||||
.ui-widget-header {
|
||||
height: 20px !important;
|
||||
height: fit-content !important;
|
||||
}
|
||||
.ui-dialog .ui-widget-header {
|
||||
margin: 3px 3px 0px 3px;
|
||||
|
@ -131,7 +131,7 @@
|
||||
<div style='padding-bottom: 50px'>
|
||||
<?php
|
||||
$version = '7.0NG.773.3';
|
||||
$build = '230906';
|
||||
$build = '230915';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
@ -407,7 +407,7 @@ if ($agent_view_page === true) {
|
||||
[
|
||||
'id' => 'alerts_status_datatable',
|
||||
'class' => 'info_table',
|
||||
'style' => 'width: 99%;',
|
||||
'style' => 'width: 100%;',
|
||||
'columns' => $columns,
|
||||
'column_names' => $column_names,
|
||||
'no_sortable_columns' => $no_sortable_columns,
|
||||
@ -439,6 +439,7 @@ if ($agent_view_page === true) {
|
||||
$strict_user
|
||||
),
|
||||
],
|
||||
'start_disabled' => true,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
|
||||
|
||||
// The execution has not been done manually.
|
||||
$userRequest = (bool) get_parameter('uptbutton');
|
||||
if ($userRequest === false) {
|
||||
if ($userRequest === true) {
|
||||
$autosearch = true;
|
||||
}
|
||||
|
||||
@ -2354,7 +2354,7 @@ if (empty($result) === false) {
|
||||
$tablePagination = ui_pagination($count_modules, false, $offset, 0, true, 'offset', false);
|
||||
}
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('Sorry no search parameters')]);
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('Please apply a filter to display the data')]);
|
||||
}
|
||||
|
||||
if (is_metaconsole() !== true) {
|
||||
|
@ -509,10 +509,22 @@ if (is_ajax() === true) {
|
||||
|
||||
$tmp->evento = str_replace('"', '', io_safe_output($tmp->evento));
|
||||
$event_text = $tmp->evento;
|
||||
if (strlen($tmp->evento) >= 40) {
|
||||
$tmp->evento = ui_print_truncate_text(
|
||||
$tmp->evento,
|
||||
40,
|
||||
|
||||
$tmp->evento = ui_print_truncate_text(
|
||||
$tmp->evento,
|
||||
$config['item_title_size_text'],
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'…',
|
||||
true,
|
||||
true,
|
||||
);
|
||||
|
||||
if (empty($tmp->module_name) === false) {
|
||||
$tmp->module_name = ui_print_truncate_text(
|
||||
$tmp->module_name,
|
||||
'module_medium',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
@ -523,19 +535,16 @@ if (is_ajax() === true) {
|
||||
}
|
||||
|
||||
if (empty($tmp->module_name) === false) {
|
||||
$tmp->module_name = io_safe_output($tmp->module_name);
|
||||
if (strlen($tmp->module_name) >= 20) {
|
||||
$tmp->module_name = ui_print_truncate_text(
|
||||
$tmp->module_name,
|
||||
20,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'…',
|
||||
true,
|
||||
true,
|
||||
);
|
||||
}
|
||||
$tmp->module_name = ui_print_truncate_text(
|
||||
$tmp->module_name,
|
||||
'module_medium',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'…',
|
||||
true,
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($tmp->comments) === false) {
|
||||
@ -564,19 +573,16 @@ if (is_ajax() === true) {
|
||||
}
|
||||
}
|
||||
|
||||
$tmp->agent_name = io_safe_output($tmp->agent_name);
|
||||
if (strlen($tmp->agent_name) >= 10) {
|
||||
$tmp->agent_name = ui_print_truncate_text(
|
||||
$tmp->agent_name,
|
||||
10,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'…',
|
||||
true,
|
||||
true,
|
||||
);
|
||||
}
|
||||
$tmp->agent_name = ui_print_truncate_text(
|
||||
$tmp->agent_name,
|
||||
'agent_medium',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'…',
|
||||
true,
|
||||
true,
|
||||
);
|
||||
|
||||
$tmp->id_extra = io_safe_output($tmp->id_extra);
|
||||
if (strlen($tmp->id_extra) >= 10) {
|
||||
@ -944,10 +950,11 @@ if (is_ajax() === true) {
|
||||
|
||||
// Module name.
|
||||
$tmp->id_agentmodule = $tmp->module_name;
|
||||
if (strlen($tmp->id_agentmodule) >= 10) {
|
||||
/*
|
||||
if (strlen($tmp->id_agentmodule) >= 10) {
|
||||
$tmp->id_agentmodule = ui_print_truncate_text(
|
||||
$tmp->id_agentmodule,
|
||||
10,
|
||||
'module_small',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
@ -955,7 +962,7 @@ if (is_ajax() === true) {
|
||||
true,
|
||||
true,
|
||||
);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Options.
|
||||
// Show more.
|
||||
|
@ -60,12 +60,29 @@ $datetime_end = strtotime($date_end.' '.$time_end);
|
||||
$custom_date = get_parameter('custom_date', 0);
|
||||
$date = get_parameter('date', SECONDS_1DAY);
|
||||
$date_text = get_parameter('date_text', SECONDS_1DAY);
|
||||
if ($custom_date === '1') {
|
||||
if ($datetime_init >= $datetime_end) {
|
||||
$datetime_init = $date_init_less;
|
||||
}
|
||||
|
||||
$period = ($datetime_end - $datetime_init);
|
||||
$custom_date_end = '';
|
||||
$filter_type = '';
|
||||
$custom_period = false;
|
||||
if ($custom_date === '1') {
|
||||
if ($date === 'chose_range') {
|
||||
$date_init = get_parameter('date_init', 0);
|
||||
$date_init = explode(' ', $date_init);
|
||||
$date_init = $date_init[0];
|
||||
$date_init .= ' '.get_parameter('time_init', '00:00:00');
|
||||
$custom_date_end = get_parameter('date_end', 0);
|
||||
$custom_date_end .= ' '.get_parameter('time_end', '00:00:00');
|
||||
$date_end = date('Y/m/d H:i:s');
|
||||
$period = (strtotime($date_end) - strtotime($date_init));
|
||||
$custom_period = (strtotime($custom_date_end) - strtotime($date_init));
|
||||
$filter_type = 'chose_range';
|
||||
} else {
|
||||
if ($datetime_init >= $datetime_end) {
|
||||
$datetime_init = $date_init_less;
|
||||
}
|
||||
|
||||
$period = ($datetime_end - $datetime_init);
|
||||
}
|
||||
} else if ($custom_date === '2') {
|
||||
$date_units = get_parameter('date_units');
|
||||
$date_end = date('Y/m/d H:i:s');
|
||||
@ -73,16 +90,18 @@ if ($custom_date === '1') {
|
||||
$period = (strtotime($date_end) - strtotime($date_start));
|
||||
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||
if ($date === 'this_week') {
|
||||
$monday = date('Y/m/d', strtotime('last monday'));
|
||||
|
||||
$sunday = date('Y/m/d', strtotime($monday.' +6 days'));
|
||||
$period = (strtotime($sunday) - strtotime($monday));
|
||||
$date_init = $monday;
|
||||
$date_end = $sunday;
|
||||
// Last monday.
|
||||
$date_init = date('Y/m/d H:i:s', strtotime('last monday'));
|
||||
// $date_end = date('Y/m/d H:i:s', strtotime($date_init.' +6 days'));
|
||||
$date_end = date('Y/m/d H:i:s');
|
||||
$period = (strtotime($date_end) - strtotime($date_init));
|
||||
$filter_type = 'this_week';
|
||||
} else if ($date === 'this_month') {
|
||||
$date_end = date('Y/m/d', strtotime('last day of this month'));
|
||||
// $date_end = date('Y/m/d', strtotime('last day of this month'));
|
||||
$date_end = date('Y/m/d H:i:s');
|
||||
$first_of_month = date('Y/m/d', strtotime('first day of this month'));
|
||||
$period = (strtotime($date_end) - strtotime($first_of_month));
|
||||
$filter_type = 'this_month';
|
||||
} else if ($date === 'past_month') {
|
||||
$date_end = date('Y/m/d', strtotime('last day of previous month'));
|
||||
$first_of_month = date('Y/m/d', strtotime('first day of previous month'));
|
||||
@ -197,7 +216,7 @@ if (check_acl_restricted_all($config['id_user'], $report_group, 'RW')) {
|
||||
$options['view'] = [
|
||||
'active' => true,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$id_report.'&pure='.$pure.'">'.html_print_image(
|
||||
'images/eye.png',
|
||||
'images/see-details@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('View report'),
|
||||
@ -265,10 +284,8 @@ ui_print_standard_header(
|
||||
// ------------------------ INIT FORM -----------------------------------
|
||||
$table2 = new stdClass();
|
||||
$table2->id = 'controls_table';
|
||||
$table2->size[2] = '50%';
|
||||
$table2->size[3] = '50%';
|
||||
$table2->style[0] = 'text-align:center';
|
||||
$table2->style[1] = 'text-align:center';
|
||||
$table2->size[2] = '20%';
|
||||
$table2->style[3] = 'position:absolute; left: auto';
|
||||
$table2->styleTable = 'border:none';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
@ -353,13 +370,20 @@ $report = reporting_make_reporting_data(
|
||||
$date_end,
|
||||
$time,
|
||||
$period,
|
||||
'dinamic'
|
||||
'dinamic',
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
$filter_type,
|
||||
$custom_date_end,
|
||||
$custom_period
|
||||
);
|
||||
for ($i = 0; $i < count($report['contents']); $i++) {
|
||||
$report['contents'][$i]['description'] = str_replace('
', '<br/>', $report['contents'][$i]['description']);
|
||||
}
|
||||
|
||||
reporting_html_print_report($report, false, $config['custom_report_info']);
|
||||
reporting_html_print_report($report, false, $config['custom_report_info'], $custom_date_end, $custom_period);
|
||||
|
||||
|
||||
echo '<div id="loading" class="center">';
|
||||
|
@ -15,6 +15,7 @@ global $config;
|
||||
|
||||
enterprise_include_once('include/functions_policies.php');
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
require_once $config['homedir'].'/include/functions_reporting.php';
|
||||
|
||||
$searchAgents = get_parameter('search_agents', 0);
|
||||
$stringSearchSQL = get_parameter('stringSearchSQL');
|
||||
|
@ -73,9 +73,10 @@ if ($config['pure']) {
|
||||
}
|
||||
|
||||
// Control from managent polices.
|
||||
$type = get_parameter('type', false);
|
||||
$type = get_parameter('moduletype', false);
|
||||
$page = get_parameter('page', false);
|
||||
if (empty($page) && $type !== 'networkserver') {
|
||||
|
||||
if (empty($page) && $type !== 'networkserver' && $moduletype !== 2) {
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
__('SNMP Browser'),
|
||||
|
@ -36,33 +36,11 @@ require_once $config['homedir'].'/include/functions_notifications.php';
|
||||
$headerTitle = __('User notifications');
|
||||
require $config['homedir'].'/operation/users/user_edit_header.php';
|
||||
|
||||
if (get_parameter('change_label', 0)) {
|
||||
$label = get_parameter('label', '');
|
||||
$source = get_parameter('source', 0);
|
||||
$user = get_parameter('user', '');
|
||||
$value = get_parameter('value', 0) ? 1 : 0;
|
||||
|
||||
// Update the label value.
|
||||
ob_clean();
|
||||
echo json_encode(
|
||||
[
|
||||
'result' => notifications_set_user_label_status(
|
||||
$source,
|
||||
$user,
|
||||
$label,
|
||||
$value
|
||||
),
|
||||
]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
echo '<div id="user-notifications-wrapper" class="white_box table_div table_three_columns padding-2">
|
||||
<div class="table_thead">
|
||||
<div class="table_th"></div>
|
||||
<div class="table_th">'.__('Enable').'</div>
|
||||
<div class="table_th">'.__('Also receive an email').'</div>
|
||||
<div class="table_th">'.__('Console notifications').'</div>
|
||||
<div class="table_th">'.__('E-mail notifications').'</div>
|
||||
</div>';
|
||||
|
||||
$sources = notifications_get_all_sources();
|
||||
@ -109,13 +87,12 @@ html_print_input_hidden('id_user', $id);
|
||||
event.preventDefault();
|
||||
var check = document.getElementById(event.target.id);
|
||||
if (check === null) return;
|
||||
|
||||
var match = /notifications-user-([0-9]+)-label-(.*)/
|
||||
.exec(event.target.id);
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{
|
||||
"page" : "operation/users/user_edit_notifications",
|
||||
//"page" : "operation/users/user_edit_notifications",
|
||||
"page" : 'include/ajax/notifications.ajax',
|
||||
"change_label" : 1,
|
||||
"label" : match[2],
|
||||
"source" : match[1],
|
||||
@ -148,4 +125,5 @@ html_print_input_hidden('id_user', $id);
|
||||
);
|
||||
}
|
||||
}());
|
||||
|
||||
</script>
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230906
|
||||
%define release 230915
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230906
|
||||
%define release 230915
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230906
|
||||
%define release 230915
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
@ -16,7 +16,32 @@ if ($issues) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
||||
} elseif (!headers_sent()) {
|
||||
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
||||
require_once __DIR__.'/../../include/functions_ui.php';
|
||||
|
||||
$url = str_replace('/var/www/html/', '', __DIR__);
|
||||
$url = str_replace('/vendor/composer', '', $url);
|
||||
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/styles/pandora.css">';
|
||||
?>
|
||||
|
||||
<style>
|
||||
body {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
|
||||
echo '<div style="height:100%;min-height: 100%;display:flex;align-items:center;justify-content:center;background: linear-gradient(74deg, #02020255 36%, transparent 36%), url('.$url.'/../images/backgrounds/background_pandora_console_keys.jpg);">';
|
||||
echo '<center><div align="middle" class="license_databox w600px pdd_10px" style="background-color: white;">';
|
||||
echo '<img style="width: 600px" src="images/custom_logo/logo-default-pandorafms.png"><h2> Composer detected issues in your platform:</h2>';
|
||||
echo '<div class="w90p height_100px" style="text-align:left;font-size: larger">';
|
||||
echo sprintf(
|
||||
'PandoraFMS requires PHP 8.0 to work properly and the version %s has been detected. Please update the PHP version of the system. More info %s. The latest version with PHP 7.4 support is PandoraFMS 767 hope LTS.',
|
||||
PHP_VERSION,
|
||||
'<a style="font-size: initial;" target="_blank" href="https://pandorafms.com/manual/en/documentation/07_technical_annexes/18_php_8">here</a>'
|
||||
);
|
||||
echo '</div></div></center></div>';
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-server
|
||||
Version: 7.0NG.773.3-230906
|
||||
Version: 7.0NG.773.3-230915
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.773.3-230906"
|
||||
pandora_version="7.0NG.773.3-230915"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.773.3";
|
||||
my $pandora_build = "230906";
|
||||
my $pandora_build = "230915";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
@ -5692,7 +5692,7 @@ sub pandora_server_statistics ($$) {
|
||||
$server->{"modules_total"} = get_db_value ($dbh, "SELECT COUNT(tagent_module_inventory.id_agent_module_inventory) FROM tagente, tagent_module_inventory WHERE tagente.disabled=0 AND tagent_module_inventory.id_agente = tagente.id_agente");
|
||||
|
||||
# Calculate lag
|
||||
$lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagent_module_inventory.id_agent_module_inventory) AS module_lag, AVG(UNIX_TIMESTAMP() - utimestamp - tagent_module_inventory.interval) AS lag
|
||||
$lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagent_module_inventory.id_agent_module_inventory) AS `module_lag`, AVG(UNIX_TIMESTAMP() - utimestamp - tagent_module_inventory.interval) AS `lag`
|
||||
FROM tagente, tagent_module_inventory
|
||||
WHERE utimestamp > 0
|
||||
AND tagent_module_inventory.id_agente = tagente.id_agente
|
||||
@ -5741,8 +5741,8 @@ sub pandora_server_statistics ($$) {
|
||||
if ($server->{"server_type"} != DATASERVER){
|
||||
$lag_row = get_db_single_row (
|
||||
$dbh,
|
||||
"SELECT COUNT(tam.id_agente_modulo) AS module_lag,
|
||||
AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS lag
|
||||
"SELECT COUNT(tam.id_agente_modulo) AS `module_lag`,
|
||||
AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS `lag`
|
||||
FROM (
|
||||
SELECT tagente_estado.last_execution_try, tagente_estado.current_interval, tagente_estado.id_agente_modulo
|
||||
FROM tagente_estado
|
||||
@ -5767,8 +5767,8 @@ sub pandora_server_statistics ($$) {
|
||||
else {
|
||||
$lag_row = get_db_single_row (
|
||||
$dbh,
|
||||
"SELECT COUNT(tam.id_agente_modulo) AS module_lag,
|
||||
AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS lag
|
||||
"SELECT COUNT(tam.id_agente_modulo) AS `module_lag`,
|
||||
AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS `lag`
|
||||
FROM (
|
||||
SELECT tagente_estado.last_execution_try, tagente_estado.current_interval, tagente_estado.id_agente_modulo
|
||||
FROM tagente_estado
|
||||
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.773.3";
|
||||
my $pandora_build = "230906";
|
||||
my $pandora_build = "230915";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
@ -4,7 +4,7 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230906
|
||||
%define release 230915
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -4,7 +4,7 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230906
|
||||
%define release 230915
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -9,7 +9,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773.3"
|
||||
PI_BUILD="230906"
|
||||
PI_BUILD="230915"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
@ -148,153 +148,3 @@ be67e5298c830c0bb582556f
|
||||
b03831cce718125cb9612c07
|
||||
5465b26fd45d86b059066cc2
|
||||
5351de84d2fd638b138ba27b
|
||||
6c63000157aed37fa8c0c022
|
||||
8d3c18c7fbe518694c6bdb22
|
||||
615ec092b6f63bb14a2bb42e
|
||||
61de25cf8e12926c28aeffdc
|
||||
2b96bc1c8f6f81a5437b61bf
|
||||
ba1f4fcf3954e0efe5d68c83
|
||||
ee5bd3e1a937b90562677f1d
|
||||
0cf18ae18b0c680d00cb4d2e
|
||||
abf72b0d66f90bd6e67c43c6
|
||||
f263d033bb07e0b8cd405224
|
||||
418ddf02720649b40db2dd67
|
||||
01d1a735aa980326d385ea65
|
||||
0cc3860bb0a3fd5822b25ea4
|
||||
b0b89dbebfab05fafd6cf9dd
|
||||
2fcbb999444db5c0c77c2ec2
|
||||
f49a97b3531b8ab8d487c7a7
|
||||
ffb66d5003620e2fa47ef8ea
|
||||
04da742ab6c99b5c44f9f0cc
|
||||
dc310a9d42d7c367671ffbf9
|
||||
b0f5c4ee8d327449ef2103e6
|
||||
5bd2ce604ed7c820169f0ac2
|
||||
57f874a6e41baa5a1196b15f
|
||||
b43142736205ad1011f4a5a6
|
||||
50cf8523e5090251516eecb0
|
||||
ebad61d47be209696f9d41aa
|
||||
66bc5976a98266560d1867ff
|
||||
3c37fc452e9ad36cd7adcb1a
|
||||
4ac8c3db63a69ce883f3fcf5
|
||||
6c89e2bb90b9ab95f4adde3c
|
||||
917de5ece0a5ef663a8f44e7
|
||||
b50eba76cf29aca3cf696d7e
|
||||
74264c913ac1e141db78708a
|
||||
2b6c93011f62cffb5c085886
|
||||
700617c377952010272b9522
|
||||
dac10c8ddf7c45e55d8028af
|
||||
053328a6ff4f2773eebe76fe
|
||||
2d7390260285c272688ae1e8
|
||||
fa30c9ee6fb1e2f00d7ccb77
|
||||
0ca6db378a05246f30c8b820
|
||||
9ad6f959de166cc1475040ea
|
||||
23b4702f4dfb350085e77482
|
||||
4198a8ab80780c5d9b0d82d5
|
||||
baebd530dfc47ac77ea42d2a
|
||||
636d2ab4e018b5542e429f5e
|
||||
40ae44193af360eea68b6f0b
|
||||
dd47b39e494a62a4f5b6bef8
|
||||
240339c9dcd159595c1edbf3
|
||||
0f11840efe364ca6bbb17f43
|
||||
8522e203fb4b53e2bd6d6f82
|
||||
f134d9b501fa40b17993beee
|
||||
d0483306f2f972aacfb4fcea
|
||||
926ee4e0a80455cfee517f8b
|
||||
c188a327bc66df4878cb3e8b
|
||||
c874083c1d932bb4ade6d028
|
||||
be2271d8da327f97e05c1c60
|
||||
9ca7451d3f261682ec717547
|
||||
9eb46e2a5fd072c5267d7432
|
||||
41e8f3f7733f87e16b773bad
|
||||
f642220cd19f84154e4dd972
|
||||
fe3d9f6433883332b464b7ca
|
||||
3e9648ccf60b1fa712ea8590
|
||||
b7da7292e9418889bc957bd7
|
||||
fb4a392d386eca19eec9215e
|
||||
34188e4a6590877b2dbb67b0
|
||||
e233cb364659dea13dee1fd8
|
||||
757b8330465df34879414b7d
|
||||
5e0f80102fee69d0742934b2
|
||||
d72124afc78e9b3f91550497
|
||||
21c77bfe67c6e99f73323f42
|
||||
afa8ce345db6300882858f93
|
||||
886cc8b32ed80f4c69edb990
|
||||
64ea275ce73ef4070cefca19
|
||||
c676f1ffe5bdce4e1d3643ed
|
||||
baca61ab59568605e3ec8899
|
||||
1610892c53a071ed02d20c75
|
||||
3321fb7111d74e532932d262
|
||||
29583747ac9fbf0bf21c1574
|
||||
f51210b47a6e847dcfb52f94
|
||||
63c95735ba96c65d2d45b23d
|
||||
679c4e3acb15ebec6ecc7529
|
||||
42da0760b02d50c6587a8c31
|
||||
e42de775dcfcc3c950c1cff5
|
||||
ae5791cf265badebd39c78d9
|
||||
f66c123309525eeb81b47e92
|
||||
7cddc2b9ed6b4df83c72fcbe
|
||||
e69cc74632fdaa06f76f708a
|
||||
7cfd19c2eeaef2c0537332be
|
||||
d27cdcea69f4e49fbae06f4d
|
||||
bdfaa2ec52319f0e6533e826
|
||||
d59452cdfce11e21682a791f
|
||||
cbb74f2d35d54557abdbc2da
|
||||
369a4e6f128475bc9f87ef42
|
||||
90bf992a98d0b768cbc50520
|
||||
1fea663421dae7b418b9b15f
|
||||
f9fc5505565c43cebc1545f9
|
||||
d02a8f77fbb2b7f384a99949
|
||||
279ff35e17c7f6b6a043fde7
|
||||
9cf7725d3a97d9aa9e529ce6
|
||||
1f465b328b349502c0953b2d
|
||||
283fad60fa48ea2075a0e516
|
||||
ef5d9e841a02665c54d8fa7f
|
||||
b6023425cb4a1503726b3135
|
||||
7fb8a1a734c24cc22a5c75eb
|
||||
da38d78e83c9288e4cd60cca
|
||||
2a928a6498ae8e0b29675c25
|
||||
d2194ab5b0e48c2c1f213860
|
||||
53acafcd86a61ce55688ebef
|
||||
65608eeebc7d9fe2912635ed
|
||||
fafb0273e3b04deb1edb2628
|
||||
baf07d1f28416da065b6771f
|
||||
c2ee8e58209102fdd0bb341c
|
||||
f8e92e00670f65c29c4617c9
|
||||
a83661705134029ae344176d
|
||||
fc02c24e172d12a29b17eede
|
||||
2632f143ffe3f64e63e4ba32
|
||||
847120de4b72f59263d160f1
|
||||
5be36ff5b668eb93823974b2
|
||||
cdd8fe5081225519b5fc28af
|
||||
53569cbaedb9265839290a6c
|
||||
decca89ea0e8944fd93fcd24
|
||||
4b10511d840b7f5129ed6190
|
||||
5c4a1904de5f90f4d5dd749a
|
||||
49c47514c3308df82fcd6b79
|
||||
15af3e182c00000eea12f8e5
|
||||
a9645c4a43ad211d9ae9a406
|
||||
dcffa4e5eee8f966b1edcdaf
|
||||
75b25f796f1e392f45c3a737
|
||||
0ad5f0b96946ebcabd0457e9
|
||||
2f9128177cab74e0bad61189
|
||||
49ed14b81e0a166ccf335b4a
|
||||
dfe100788326c45dfb84579c
|
||||
2616f38caef9decae47e5023
|
||||
99b2d0eb14ac19d1cfedd86e
|
||||
fb1d4c42ea70fad330b5c5ee
|
||||
b6c560867faa3b41b1f5d4fa
|
||||
1167fb22e86098ef684eb702
|
||||
a2e2c2ee8ec87d4e5d59eb22
|
||||
b228beac094e16a0fa3cb528
|
||||
ea0de9aad68deed0a4df3e71
|
||||
e50cb420497d928ef9827800
|
||||
3bb39890ca4a6da941e01782
|
||||
73391f2914465c3f2335e24a
|
||||
f8b2f512cc0cbc024e2cd377
|
||||
4f816b0d36c934b44dbd5bc0
|
||||
817edf1e2637fef229752a5f
|
||||
4466f97959df7247f7410fbe
|
||||
cc85c727080e9d6eb75ef513
|
||||
7e27f012167ed8bedc4bd635
|
||||
98a445ff41a81a0a752aff25
|
||||
3b339e213dd613c4efd878c1
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
||||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.773.3 Build 230906";
|
||||
my $version = "7.0NG.773.3 Build 230915";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
@ -359,7 +359,12 @@ sub pandora_purgedb ($$$) {
|
||||
log_message ('!', "Cannot execute " . $conf->{'_netflow_nfexpire'} . ", skipping.");
|
||||
}
|
||||
else {
|
||||
`yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -r "$conf->{'_netflow_path'}" -t $conf->{'_netflow_max_lifetime'}d`;
|
||||
# Update stats file with max lifetime.
|
||||
`yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -u "$conf->{'_netflow_path'}" -t $conf->{'_netflow_max_lifetime'}d -w 100`;
|
||||
# Rescan directory.
|
||||
`yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -r "$conf->{'_netflow_path'}"`;
|
||||
# Expire files
|
||||
`yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -e "$conf->{'_netflow_path'}"`;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
||||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.773.3 Build 230906";
|
||||
my $version = "7.0NG.773.3 Build 230915";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user