Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round

This commit is contained in:
Pablo Aragon 2023-03-30 12:26:06 +02:00
commit e03e1e45ed
51 changed files with 472 additions and 466 deletions

View File

@ -174,7 +174,7 @@ execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
if [ "$MYVER" -eq '80' ] ; then
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-24" "Installing Percona Server 80"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-80" "Installing Percona Server 80"
fi
if [ "$MYVER" -ne '80' ] ; then

View File

@ -155,7 +155,7 @@ execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_
execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server &>> "$LOGFILE"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server percona-xtrabackup-80 &>> "$LOGFILE"
check_cmd_status "Error Installing MySql Server"
#Configuring Database

View File

@ -42,7 +42,7 @@ check_cmd_status () {
echo "Error installing Pandora FMS Agent for detailed error please check log: $LOGFILE"
rm -rf $HOME/pandora_deploy_tmp/*.rpm* &>> $LOGFILE
exit 1
else
else
echo -e "${green}OK${reset}"
return 0
fi
@ -65,6 +65,12 @@ check_root_permissions () {
fi
}
install_tarball () {
tar xvzf $1
cd unix && ./pandora_agent_installer --install
}
install_autodiscover () {
local arch=$1
wget http://firefly.artica.es/projects/autodiscover-linux.zip
@ -145,14 +151,17 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
$package_manager_cmd install -y http://firefly.artica.es/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"
fi
if [[ $OS_RELEASE == 'debian' ]]; then
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.artica.es/pandorafms/latest/Debian_Ubuntu/pandorafms.agent_linux_7.0NG.deb' 'Downloading Pandora FMS agent dependencies'
execute_cmd 'apt install -y ./pandorafms.agent_linux_7.0NG.deb' 'Installing Pandora FMS agent'
execute_cmd 'wget http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz' '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"
cd $HOME/pandora_deploy_tmp
fi
# Configuring Agente
@ -165,6 +174,7 @@ fi
[[ $PANDORA_AGENT_ALIAS ]] && sed -i "s/^#agent_alias.*$/agent_alias $PANDORA_AGENT_ALIAS/g" $PANDORA_AGENT_CONF
[[ $PANDORA_SECONDARY_GROUPS ]] && sed -i "s/^# secondary_groups.*$/secondary_groups $PANDORA_SECONDARY_GROUPS/g" $PANDORA_AGENT_CONF
[[ $TIMEZONE ]] && ln -sfn /usr/share/zoneinfo/$TIMEZONE /etc/localtime
[[ $PANDORA_AGENT_SSL ]] && sed -i "s/^#server_ssl.*$/server_ssl $PANDORA_AGENT_SSL/g" $PANDORA_AGENT_CONF
#installing autodiscover

View File

@ -238,7 +238,7 @@ execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
if [ "$MYVER" -eq '80' ] ; then
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-24" "Installing Percona Server 80"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-80" "Installing Percona Server 80"
fi
if [ "$MYVER" -ne '80' ] ; then

View File

@ -273,6 +273,7 @@ server_dependencies=" \
libencode-perl \
cron \
libgeo-ip-perl \
arping \
openjdk-8-jdk "
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
@ -385,7 +386,7 @@ execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_
execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server &>> "$LOGFILE"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server percona-xtrabackup-80 &>> "$LOGFILE"
check_cmd_status "Error Installing MySql Server"

View File

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

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

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.770
%define release 230329
%define release 230330
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.770
%define release 230329
%define release 230330
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.770"
PI_BUILD="230329"
PI_BUILD="230330"
OS_NAME=`uname -s`
FORCE=0

View File

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

View File

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

View File

@ -267,7 +267,7 @@ if (db_get_num_rows($sql) == 0) {
$data[5] .= '</b></a>&nbsp;&nbsp;';
// Force refresh module
$data[5] .= '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'&force_inventory_module='.$row['id_agent_module_inventory'].'">';
$data[5] .= html_print_image('images/change-active.svg', true, ['border' => '0', 'title' => __('Force'), 'class' => 'main_menu_icon invert_filter']).'</b></a>';
$data[5] .= html_print_image('images/force@svg.svg', true, ['border' => '0', 'title' => __('Force'), 'class' => 'main_menu_icon invert_filter']).'</b></a>';
array_push($table->data, $data);
}

View File

@ -967,17 +967,19 @@ foreach ($simple_alerts as $alert) {
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$policyInfo = policies_is_alert_in_policy2($alert['id'], false);
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if (is_array($policyInfo) === false && $module_linked === false) {
if ((is_array($policyInfo) === false && $module_linked === false)
|| (is_array($policyInfo) === false && $module_linked === '1')
) {
$data[$index['policy']] = '';
} else {
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png';
} else {
$img = 'images/policies_mc.png';
$img = 'images/policy@svg.svg';
}
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name'], 'class' => 'invert_filter main_menu_icon']).'</a>';
}
}
}

View File

@ -208,7 +208,7 @@ foreach ($servers as $server) {
if ($server['type'] === 'data') {
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
$data[8] .= html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Reset module status and fired alert counts'),
@ -219,7 +219,7 @@ foreach ($servers as $server) {
} else if ($server['type'] === 'enterprise snmp') {
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
$data[8] .= html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Claim back SNMP modules'),

View File

@ -673,7 +673,7 @@ class DiscoveryTaskList extends HTML
$data[0] .= ');" >';
$data[0] .= html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force'),

View File

@ -810,10 +810,7 @@ class HostDevices extends Wizard
'name' => 'interval_manual_defined',
'return' => true,
],
'extra' => '<div id="interval_manual_container"><div class="time_selection_container mrgn_top_20px">'.ui_print_help_tip(
__('The minimum recomended interval for Recon Task is 5 minutes'),
true
).html_print_extended_select_for_time(
'extra' => '<div id="interval_manual_container"><div class="time_selection_container mrgn_top_20px">'.html_print_extended_select_for_time(
'interval',
$this->task['interval_sweep'],
'',

View File

@ -1279,7 +1279,7 @@ if (check_login()) {
if ((int) $module['flag'] === 0) {
$additionalLinkAction = '&amp;flag=1';
$linkCaption = __('Force checks');
$imgaction = 'images/target.png';
$imgaction = 'images/force@svg.svg';
} else {
$additionalLinkAction = '';
$linkCaption = __('Refresh');

View File

@ -4132,10 +4132,10 @@ class AgentWizard extends HTML
$table->width = '100%';
$table->class = 'info_table';
// Subheaders for Warning and Critical columns.
$subheaders = '<span class=\'wizard-colum-levels font_w300 mrgn_lft_0.8em\'>Min.</span>';
$subheaders .= '<span class=\'wizard-colum-levels font_w300 mrgn_lft_1.6em\'>Max.</span>';
$subheaders .= '<span class=\'wizard-colum-levels font_w300 mrgn_lft_2em\'>Inv.</span>';
$subheaders .= '<span class=\'wizard-colum-levels font_w300 mrgn_lft_2em\'>%.</span>';
$subheaders = '<span class=\'wizard-colum-levels font_w300 margin-left-1\'>Min.</span>';
$subheaders .= '<span class=\'wizard-colum-levels font_w300 margin-left-1\'>Max.</span>';
$subheaders .= '<span class=\'wizard-colum-levels font_w300 margin-left-1\'>Inv.</span>';
$subheaders .= '<span class=\'wizard-colum-levels font_w300 margin-left-05\'>%.</span>';
// Warning header.
$warning_header = html_print_div(
@ -4352,8 +4352,7 @@ class AgentWizard extends HTML
);
$data_warning .= html_print_div(
[
'class' => 'wizard-column-levels-check',
'style' => 'margin-top: 0.3em;',
'class' => 'wizard-column-levels-check mrgn_top_10px',
'content' => html_print_checkbox(
'module-warning-inv-'.$uniqueId,
$module['inv_warning'],
@ -4369,8 +4368,7 @@ class AgentWizard extends HTML
);
$data_warning .= html_print_div(
[
'class' => 'wizard-column-levels-check',
'style' => 'margin-top: 0.3em;',
'class' => 'wizard-column-levels-check mrgn_top_10px',
'content' => html_print_checkbox(
'module-warning-perc-'.$uniqueId,
$module['perc_warning'],
@ -4436,8 +4434,7 @@ class AgentWizard extends HTML
$data[4] .= html_print_div(
[
'class' => 'wizard-column-levels-check',
'style' => 'margin-top: 0.3em;',
'class' => 'wizard-column-levels-check mrgn_top_10px',
'content' => html_print_checkbox(
'module-critical-inv-'.$uniqueId,
$module['inv_critical'],
@ -4454,8 +4451,7 @@ class AgentWizard extends HTML
$data[4] .= html_print_div(
[
'class' => 'wizard-column-levels-check',
'style' => 'margin-top: 0.3em;',
'class' => 'wizard-column-levels-check mrgn_top_10px',
'content' => html_print_checkbox(
'module-critical-perc-'.$uniqueId,
$module['perc_critical'],
@ -4490,7 +4486,7 @@ class AgentWizard extends HTML
'',
true,
'',
'pdd_0px'
'pdd_0px mrgn_top-8px'
);
} else {
// WIP. Current value of this module.

View File

@ -524,7 +524,7 @@ class CustomNetScan extends Wizard
// Schedule.
$form['inputs'][] = [
'label' => __('Interval').ui_print_help_tip(
__('Manual interval means that it will be executed only On-demand'),
__('Manual interval means that it will be executed only On-demand').', '.__('The minimum recomended interval for Recon Task is 5 minutes'),
true
),
'class' => 'input-interval',
@ -549,9 +549,6 @@ class CustomNetScan extends Wizard
true,
false,
false
).ui_print_help_tip(
__('The minimum recomended interval for Recon Task is 5 minutes'),
true
).'</span>',
];

View File

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

View File

@ -530,7 +530,7 @@ function cron_list_table()
$task['id']
),
'content' => html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force run'),
@ -568,7 +568,7 @@ function cron_list_table()
$task['id']
),
'content' => html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force run'),
@ -623,7 +623,7 @@ function cron_list_table()
$task['id']
),
'content' => html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force run'),
@ -715,7 +715,7 @@ function cron_list_table()
$task['id']
),
'content' => html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force run'),
@ -751,7 +751,7 @@ function cron_list_table()
$task['id']
),
'content' => html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force run'),
@ -797,7 +797,7 @@ function cron_list_table()
$task['id']
),
'content' => html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force run'),
@ -839,7 +839,7 @@ function cron_list_table()
$task['id']
),
'content' => html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force run'),
@ -873,7 +873,7 @@ function cron_list_table()
$task['id']
),
'content' => html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force run'),

View File

@ -4560,7 +4560,7 @@ function events_page_details($event, $server_id=0)
true,
[
'title' => __('Go to data overview'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
);
} else {
@ -4569,7 +4569,7 @@ function events_page_details($event, $server_id=0)
true,
[
'title' => __('Go to data overview'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
'style' => 'opacity: .5',
]
);

View File

@ -814,6 +814,10 @@ function get_data_basic_info_sql($params, $count=false)
$where .= sprintf(' AND id_agente = %d', $params['id_agent']);
}
if ($params['id_group'] > 0) {
$where .= sprintf(' AND id_grupo = %d', $params['id_group']);
}
if ($params['search'] > 0) {
$where .= sprintf(
' AND ( alias LIKE "%%%s%%" )',

View File

@ -97,7 +97,7 @@ function snmp_browser_get_html_tree(
// Id used to expand leafs.
$sub_id = time().rand(0, getrandmax());
// Display the branch.
$output .= '<li id="li_'.$sub_id.'" class="'.$class.' mrgn_0px pdd_0px">';
$output .= '<li id="li_'.$sub_id.'" class="'.$class.' mrgn_0px pdd_0px flex_center">';
// Indent sub branches.
for ($i = 1; $i <= $depth; $i++) {

View File

@ -1246,20 +1246,22 @@ function ui_format_alert_row(
$policyInfo = policies_is_alert_in_policy2($alert['id'], false);
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if (is_array($policyInfo) === false && $module_linked === false) {
if ((is_array($policyInfo) === false && $module_linked === false)
|| (is_array($policyInfo) === false && $module_linked === '1')
) {
$data[$index['policy']] = '';
} else {
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png';
} else {
$img = 'images/policies_mc.png';
$img = 'images/policy@svg.svg';
}
if (is_metaconsole() === false) {
$data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
$data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name'], 'class' => 'invert_filter main_menu_icon']).'</a>';
} else {
$data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=advanced/policymanager&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
$data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=advanced/policymanager&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name'], 'class' => 'invert_filter main_menu_icon']).'</a>';
}
}

View File

@ -22,7 +22,7 @@
}
#menu_tab {
margin: 0px;
margin: 0;
}
#menu_tab li.nomn.tab_operation img,
@ -426,12 +426,16 @@ li#search_input_widget {
top: 2px;
}
.select2-search--dropdown .select2-search__field {
width: auto;
}
div#dashboard-controls {
position: fixed;
z-index: 1;
top: 10px;
right: 10px;
width: 800px;
width: 450px;
height: 70px;
display: flex;
flex-direction: row;
@ -444,7 +448,7 @@ div#dashboard-controls {
}
div#dashboard-controls div {
flex: 0.5;
margin-left: 10px;
text-align: center;
}

View File

@ -15,8 +15,8 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* Copyright (c) 2005-2023 Pandora FMS
* Please see https://pandorafms.com 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.
@ -1653,7 +1653,7 @@ table.info_box.warning {
}
.warning * {
color: #f3b200;
color: #8d4100;
}
.help {
@ -7007,6 +7007,10 @@ div.graph div.legend table {
margin-top: -2px !important;
}
.mrgn_top-8px {
margin-top: -8px !important;
}
.mrgn_top-10px {
margin-top: -10px;
}

View File

@ -1600,3 +1600,7 @@ a.pandora_pagination,
.info_table > tbody > tr > td {
border-bottom: 1px solid #3f3f3f;
}
.font-title-font {
color: #fff;
}

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.770';
$build = '230329';
$build = '230330';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -109,44 +109,93 @@ $utimestampSelectValues = array_reduce(
// Inventory module select.
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->size = [];
$table->data = [];
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[2] = '33%';
$table->class = 'filter-table-adv';
$table->data[0][0] = __('Module');
$table->data[0][1] = html_print_select_from_sql(
$sqlModuleInventoryAgentView,
'module_inventory_agent_view',
$module,
'javascript:this.form.submit();',
__('All'),
0,
$table->data[0][0] = html_print_label_input_block(
__('Module'),
html_print_select_from_sql(
$sqlModuleInventoryAgentView,
'module_inventory_agent_view',
$module,
'javascript:this.form.submit();',
__('All'),
0,
true,
false,
true,
false,
'width:100%;'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Date'),
html_print_select(
$utimestampSelectValues,
'utimestamp',
$utimestamp,
'javascript:this.form.submit();',
__('Now'),
0,
true,
false,
true,
'',
false,
'width:100%;'
)
);
$table->data[0][2] = html_print_label_input_block(
__('Search'),
html_print_input_text(
'search_string',
$search_string,
'',
25,
0,
true
)
);
$buttons = html_print_submit_button(
__('Filter'),
'search_button',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
);
$table->data[0][2] = __('Date');
$table->data[0][3] = html_print_select(
$utimestampSelectValues,
'utimestamp',
$utimestamp,
'javascript:this.form.submit();',
__('Now'),
0,
$searchForm = '<form method="post" action="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=inventory&id_agente='.$id_agente.'">';
$searchForm .= html_print_table($table, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => $buttons,
],
true
);
$searchForm .= '</form>';
$table->data[0][4] = __('Search');
$table->data[0][5] = html_print_input_text('search_string', $search_string, '', 25, 0, true);
$table->data[0][6] = html_print_submit_button(__('Search'), 'search_button', false, 'class="sub wand"', true);
// Show filters table.
echo sprintf(
'<form method="post" action="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=inventory&id_agente=%s">%s</form>',
$id_agente,
html_print_table($table, true)
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
unset($table);
$idModuleInventory = null;
$rowTable = 1;
@ -181,7 +230,7 @@ foreach ($rows as $row) {
$table->align = [];
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->class = 'databox filters';
$table->class = 'info_table';
$table->head = [];
$table->head[0] = $row['name'].' - ('.date($config['date_format'], $row['utimestamp']).')';
@ -210,7 +259,7 @@ foreach ($rows as $row) {
foreach ($subHeadTitles as $titleData) {
$table->data[0][$iterator] = $titleData;
$table->cellstyle[0][$iterator] = 'background: #373737; color: #FFF;';
$table->cellstyle[0][$iterator] = 'background: var(--primary-color); color: #FFF;';
$iterator++;
}

View File

@ -119,6 +119,7 @@ if (is_ajax() === true) {
$length = (int) get_parameter('length', $config['block_size']);
$order = get_datatable_order();
$id_agent = (int) get_parameter('id_agent', 0);
$id_group = (int) get_parameter('id_group', 0);
$params = [
'search' => $filter['value'],
@ -126,6 +127,7 @@ if (is_ajax() === true) {
'length' => $length,
'order' => $order,
'id_agent' => $id_agent,
'id_group' => $id_group,
];
$data = get_data_basic_info_sql($params);
@ -753,295 +755,8 @@ if (is_metaconsole() === true) {
$filteringFunction = '';
}
if ($is_metaconsole === false) {
// Single agent selected.
if ($inventory_id_agent > 0 && isset($agents[$inventory_id_agent]) === true) {
$agents = [$inventory_id_agent => $agents[$inventory_id_agent]];
}
$agents_ids = array_keys($agents);
if (count($agents_ids) > 0) {
$rows = inventory_get_datatable(
$agents_ids,
$inventory_module,
$utimestamp,
$inventory_search_string,
$export,
false,
$order_by_agent
);
}
if (count($agents_ids) === 0 || (int) $rows === ERR_NODATA) {
ui_print_info_message(['no_close' => true, 'message' => __('No data found.') ]);
echo '&nbsp;</td></tr><tr><td>';
return;
}
echo "<div id='loading_url' style='display: none; width: ".$table->width."; text-align: right;'>".html_print_image('images/spinner.gif', true).'</div>';
?>
<script type="text/javascript">
function get_csv_url(module, id_group, search_string, utimestamp, agent, order_by_agent) {
$("#url_csv").hide();
$("#loading_url").show();
$.ajax ({
method:'GET',
url:'ajax.php',
datatype:'html',
data:{
"page" : "operation/inventory/inventory",
"get_csv_url" : 1,
"module" : module,
"id_group" : id_group,
"search_string" : search_string,
"utimestamp" : utimestamp,
"agent" : agent,
"export": true,
"order_by_agent": order_by_agent
},
success: function (data, status) {
$("#url_csv").html(data);
$("#loading_url").hide();
$("#url_csv").show();
}
});
}
</script>
<?php
if ($inventory_module !== 'basic') {
if ($order_by_agent === true) {
foreach ($rows as $agent_rows) {
$data = [];
$modules = '';
foreach ($agent_rows['row'] as $key_row => $row) {
$columns = explode(';', io_safe_output($row['data_format']));
array_push($columns, 'Timestamp');
$data_rows = explode(PHP_EOL, $row['data']);
foreach ($data_rows as $data_row) {
// Exclude results don't match filter.
if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($data_row)) == 0) {
continue;
}
$column_data = explode(';', io_safe_output($data_row));
if ($column_data[0] !== '') {
$row_tmp = [];
foreach ($column_data as $key => $value) {
$row_tmp[$columns[$key]] = $value;
}
$row_tmp['Timestamp'] = $row['timestamp'];
array_push($data, (object) $row_tmp);
}
}
$id_table = 'id_'.$key_row.'_'.$row['id_module_inventory'].'_'.$row['id_agente'];
$table = ui_print_datatable(
[
'id' => $id_table,
'class' => 'info_table w100p',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $columns,
'no_sortable_columns' => [],
'data_element' => $data,
'searching' => true,
'dom_elements' => 'ftip',
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('No inventory found'),
'emptyTable' => __('No inventory found'),
'return' => true,
'default_pagination' => 10,
'no_sortable_columns' => [-1],
]
);
$modules .= ui_toggle(
$table,
'<span class="title-blue">'.$row['name'].'</span>',
'',
'',
true,
true,
'',
'white-box-content w100p',
'box-shadow white_table_graph w100p',
'images/arrow_down_green.png',
'images/arrow_right_green.png',
false,
false,
false,
'',
'',
null,
null,
false,
$id_table
);
}
ui_toggle(
$modules,
$agent_rows['agent'],
'',
'',
false,
false
);
}
} else {
$count_rows = count($rows);
foreach ($rows as $module_rows) {
$agent = '';
$data = [];
foreach ($module_rows as $row) {
$columns = explode(';', io_safe_output($row['data_format']));
array_push($columns, 'Timestamp');
array_push($columns, 'Agent');
// Exclude results don't match filter.
if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($row['data'])) == 0) {
continue;
}
$data_tmp = [];
if ($row['data'] !== '') {
$values_explode = explode(';', io_safe_output($row['data']));
foreach ($values_explode as $key => $value) {
$data_tmp[$columns[$key]] = $value;
}
$data_tmp['Timestamp'] = $row['timestamp'];
$data_tmp['Agent'] = $row['name_agent'];
array_push($data, $data_tmp);
}
$id_table = 'id_'.$row['id_module_inventory'];
}
$table = ui_print_datatable(
[
'id' => $id_table,
'class' => 'info_table w100p',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $columns,
'no_sortable_columns' => [],
'data_element' => $data,
'searching' => true,
'dom_elements' => 'ftip',
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('No inventory found'),
'emptyTable' => __('No inventory found'),
'return' => true,
'no_sortable_columns' => [],
]
);
if ($count_rows > 1) {
ui_toggle(
$table,
array_shift($module_rows)['name'],
'',
'',
false,
false
);
} else {
echo $table;
html_print_action_buttons(
'',
['type' => 'form_action']
);
}
}
}
} else {
$id_agente = $inventory_id_agent;
$agentes = [];
$data = [];
$class = 'info_table';
$style = 'width: 99%';
$ordering = true;
$searching = false;
$columns = [
'alias',
'ip',
'secondoaryIp',
'group',
'secondaryGroups',
'description',
'os',
'interval',
'lastContact',
'lastStatusChange',
'customFields',
'valuesCustomFields',
];
$columns_names = [
__('Alias'),
__('IP'),
__('Secondary IP'),
__('Group'),
__('Secondary groups'),
__('Description'),
__('OS'),
__('Interval'),
__('Last contact'),
__('Last status change'),
__('Custom fields'),
__('Values Custom Fields'),
];
ui_print_datatable(
[
'id' => 'basic_info',
'class' => $class,
'style' => $style,
'columns' => $columns,
'column_names' => $columns_names,
'ordering' => $ordering,
'searching' => $searching,
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'ajax_url' => 'operation/inventory/inventory',
'ajax_data' => [
'get_data_basic_info' => 1,
'id_agent' => $id_agente,
],
'zeroRecords' => __('Agent info not found'),
'emptyTable' => __('Agent info not found'),
'return' => false,
]
);
html_print_action_buttons(
'',
['type' => 'form_action']
);
}
} else {
// Metaconsole.
if ($inventory_module !== 'basic') {
if ($inventory_module !== 'basic') {
if (is_metaconsole() === true) {
if ($order_by_agent === true) {
$count_nodos_tmp = [];
foreach ($nodos as $count_value) {
@ -1266,73 +981,293 @@ if ($is_metaconsole === false) {
}
}
} else {
$id_agente = $inventory_id_agent;
$agentes = [];
$data = [];
$class = 'info_table';
$style = 'width: 99%';
$ordering = true;
$searching = false;
// Single agent selected.
if ($inventory_id_agent > 0 && isset($agents[$inventory_id_agent]) === true) {
$agents = [$inventory_id_agent => $agents[$inventory_id_agent]];
}
$columns = [
'alias',
'ip',
'secondoaryIp',
'group',
'secondaryGroups',
'description',
'os',
'interval',
'lastContact',
'lastStatusChange',
'customFields',
'valuesCustomFields',
];
$agents_ids = array_keys($agents);
if (count($agents_ids) > 0) {
$rows = inventory_get_datatable(
$agents_ids,
$inventory_module,
$utimestamp,
$inventory_search_string,
$export,
false,
$order_by_agent
);
}
$columns_names = [
__('Alias'),
__('IP'),
__('Secondary IP'),
__('Group'),
__('Secondary groups'),
__('Description'),
__('OS'),
__('Interval'),
__('Last contact'),
__('Last status change'),
__('Custom fields'),
__('Values Custom Fields'),
];
if (count($agents_ids) === 0 || (int) $rows === ERR_NODATA) {
ui_print_info_message(
[
'no_close' => true,
'message' => __('No data found.'),
]
);
return;
}
ui_print_datatable(
[
'id' => 'basic_info',
'class' => $class,
'style' => $style,
'columns' => $columns,
'column_names' => $columns_names,
'ordering' => $ordering,
'searching' => $searching,
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'ajax_url' => 'operation/inventory/inventory',
'ajax_data' => [
'get_data_basic_info' => 1,
'id_agent' => $id_agente,
],
'zeroRecords' => __('Agent info not found'),
'emptyTable' => __('Agent info not found'),
'return' => false,
]
);
echo "<div id='loading_url' style='display: none; width: ".$table->width."; text-align: right;'>".html_print_image('images/spinner.gif', true).'</div>';
?>
<script type="text/javascript">
function get_csv_url(module, id_group, search_string, utimestamp, agent, order_by_agent) {
$("#url_csv").hide();
$("#loading_url").show();
$.ajax ({
method:'GET',
url:'ajax.php',
datatype:'html',
data:{
"page" : "operation/inventory/inventory",
"get_csv_url" : 1,
"module" : module,
"id_group" : id_group,
"search_string" : search_string,
"utimestamp" : utimestamp,
"agent" : agent,
"export": true,
"order_by_agent": order_by_agent
},
success: function (data, status) {
$("#url_csv").html(data);
$("#loading_url").hide();
$("#url_csv").show();
}
});
}
</script>
<?php
if ($order_by_agent === true) {
foreach ($rows as $agent_rows) {
$data = [];
$modules = '';
foreach ($agent_rows['row'] as $key_row => $row) {
$columns = explode(';', io_safe_output($row['data_format']));
array_push($columns, 'Timestamp');
html_print_action_buttons(
'',
['type' => 'form_action']
);
$data_rows = explode(PHP_EOL, $row['data']);
foreach ($data_rows as $data_row) {
// Exclude results don't match filter.
if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($data_row)) == 0) {
continue;
}
$column_data = explode(';', io_safe_output($data_row));
if ($column_data[0] !== '') {
$row_tmp = [];
foreach ($column_data as $key => $value) {
$row_tmp[$columns[$key]] = $value;
}
$row_tmp['Timestamp'] = $row['timestamp'];
array_push($data, (object) $row_tmp);
}
}
$id_table = 'id_'.$key_row.'_'.$row['id_module_inventory'].'_'.$row['id_agente'];
$table = ui_print_datatable(
[
'id' => $id_table,
'class' => 'info_table w100p',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $columns,
'no_sortable_columns' => [],
'data_element' => $data,
'searching' => true,
'dom_elements' => 'ftip',
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('No inventory found'),
'emptyTable' => __('No inventory found'),
'return' => true,
'default_pagination' => 10,
'no_sortable_columns' => [-1],
]
);
$modules .= ui_toggle(
$table,
'<span class="title-blue">'.$row['name'].'</span>',
'',
'',
true,
true,
'',
'white-box-content w100p',
'box-shadow white_table_graph w100p',
'images/arrow_down_green.png',
'images/arrow_right_green.png',
false,
false,
false,
'',
'',
null,
null,
false,
$id_table
);
}
ui_toggle(
$modules,
$agent_rows['agent'],
'',
'',
false,
false
);
}
} else {
$count_rows = count($rows);
foreach ($rows as $module_rows) {
$agent = '';
$data = [];
foreach ($module_rows as $row) {
$columns = explode(';', io_safe_output($row['data_format']));
array_push($columns, 'Timestamp');
array_push($columns, 'Agent');
// Exclude results don't match filter.
if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($row['data'])) == 0) {
continue;
}
$data_tmp = [];
if ($row['data'] !== '') {
$values_explode = explode(';', io_safe_output($row['data']));
foreach ($values_explode as $key => $value) {
$data_tmp[$columns[$key]] = $value;
}
$data_tmp['Timestamp'] = $row['timestamp'];
$data_tmp['Agent'] = $row['name_agent'];
array_push($data, $data_tmp);
}
$id_table = 'id_'.$row['id_module_inventory'];
}
$table = ui_print_datatable(
[
'id' => $id_table,
'class' => 'info_table w100p',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $columns,
'no_sortable_columns' => [],
'data_element' => $data,
'searching' => true,
'dom_elements' => 'ftip',
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'zeroRecords' => __('No inventory found'),
'emptyTable' => __('No inventory found'),
'return' => true,
'no_sortable_columns' => [],
]
);
if ($count_rows > 1) {
ui_toggle(
$table,
array_shift($module_rows)['name'],
'',
'',
false,
false
);
} else {
echo $table;
html_print_action_buttons(
'',
['type' => 'form_action']
);
}
}
}
}
} else {
$id_agente = $inventory_id_agent;
$agentes = [];
$data = [];
$class = 'info_table';
$style = 'width: 99%';
$ordering = true;
$searching = false;
$columns = [
'alias',
'ip',
'secondoaryIp',
'group',
'secondaryGroups',
'description',
'os',
'interval',
'lastContact',
'lastStatusChange',
'customFields',
'valuesCustomFields',
];
$columns_names = [
__('Alias'),
__('IP'),
__('Secondary IP'),
__('Group'),
__('Secondary groups'),
__('Description'),
__('OS'),
__('Interval'),
__('Last contact'),
__('Last status change'),
__('Custom fields'),
__('Values Custom Fields'),
];
ui_print_datatable(
[
'id' => 'basic_info',
'class' => $class,
'style' => $style,
'columns' => $columns,
'column_names' => $columns_names,
'ordering' => $ordering,
'searching' => $searching,
'order' => [
'field' => $columns[0],
'direction' => 'asc',
],
'ajax_url' => 'operation/inventory/inventory',
'ajax_data' => [
'get_data_basic_info' => 1,
'id_agent' => $id_agente,
'id_group' => $inventory_id_group,
],
'zeroRecords' => __('Agent info not found'),
'emptyTable' => __('Agent info not found'),
'return' => false,
]
);
html_print_action_buttons(
'',
['type' => 'form_action']
);
}
ui_require_jquery_file('pandora.controls');

View File

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

View File

@ -216,7 +216,7 @@ $table_agent_header .= '<div class="icono_right">'.$status_img.'</div>';
$table_agent_header .= '&nbsp;&nbsp;';
$table_agent_header .= '<a href="'.$model->url.'&op=force&id='.$cluster->id();
$table_agent_header .= '">'.html_print_image(
'images/change-active.svg',
'images/force@svg.svg',
true,
[
'title' => __('Force cluster status calculation'),

View File

@ -159,7 +159,7 @@ if ($public_dashboard_hash !== false) {
}
$comboRefreshCountdown['text'] = '<div class="dashboard-countdown display_in"></div>';
$comboRefresh['text'] = '<form id="refr-form" method="post" class="mrgn_top_13px" action="'.$urlRefresh.'">';
$comboRefresh['text'] = '<form id="refr-form" method="post" class="mrgn_top_13px" action="'.$urlRefresh.'">';
$comboRefresh['text'] .= __('Refresh').':';
$comboRefresh['text'] .= html_print_select(
\get_refresh_time_array(),
@ -284,7 +284,7 @@ if (isset($config['public_dashboard']) === true
}
}
if ($publicLink === false) {
if ($config['pure'] === false) {
ui_print_standard_header(
$dashboardName,
'',

View File

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

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.770";
my $pandora_build = "230329";
my $pandora_build = "230330";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

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.770";
my $pandora_build = "230329";
my $pandora_build = "230330";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.770
%define release 230329
%define release 230330
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.770
%define release 230329
%define release 230330
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.770"
PI_BUILD="230329"
PI_BUILD="230330"
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.770 Build 230329";
my $version = "7.0NG.770 Build 230330";
# 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.770 Build 230329";
my $version = "7.0NG.770 Build 230330";
# save program name for logging
my $progname = basename($0);

View File

@ -59,6 +59,7 @@ Where OPTIONS could be:
-uniqid Use custom temporary file name.
-inUsage Show only input usage (in percentage) - 1, or not 0.
-outUsage Show only output usage (in percentage) - 1, or not 0.
-f We treat unkonwn duplex as full duplex.
Note: You can also use snmpget/snmpwalk argument notation,
e.g. -v is equal to -version, -c to -community, etc.