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 if [ "$MYVER" -eq '80' ] ; then
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module" 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 fi
if [ "$MYVER" -ne '80' ] ; then 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" execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}" 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" check_cmd_status "Error Installing MySql Server"
#Configuring Database #Configuring Database

View File

@ -42,7 +42,7 @@ check_cmd_status () {
echo "Error installing Pandora FMS Agent for detailed error please check log: $LOGFILE" echo "Error installing Pandora FMS Agent for detailed error please check log: $LOGFILE"
rm -rf $HOME/pandora_deploy_tmp/*.rpm* &>> $LOGFILE rm -rf $HOME/pandora_deploy_tmp/*.rpm* &>> $LOGFILE
exit 1 exit 1
else else
echo -e "${green}OK${reset}" echo -e "${green}OK${reset}"
return 0 return 0
fi fi
@ -65,6 +65,12 @@ check_root_permissions () {
fi fi
} }
install_tarball () {
tar xvzf $1
cd unix && ./pandora_agent_installer --install
}
install_autodiscover () { install_autodiscover () {
local arch=$1 local arch=$1
wget http://firefly.artica.es/projects/autodiscover-linux.zip 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 $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}" echo -en "${cyan}Installing Pandora FMS agent...${reset}"
check_cmd_status 'Error installing Pandora FMS agent' 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 fi
if [[ $OS_RELEASE == 'debian' ]]; then if [[ $OS_RELEASE == 'debian' ]]; then
execute_cmd "apt update" 'Updating repos' execute_cmd "apt update" 'Updating repos'
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies' 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 'wget http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz' 'Downloading Pandora FMS agent package'
execute_cmd 'apt install -y ./pandorafms.agent_linux_7.0NG.deb' 'Installing Pandora FMS agent' 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 fi
# Configuring Agente # 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_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 [[ $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 [[ $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 #installing autodiscover

View File

@ -238,7 +238,7 @@ execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
if [ "$MYVER" -eq '80' ] ; then if [ "$MYVER" -eq '80' ] ; then
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module" 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 fi
if [ "$MYVER" -ne '80' ] ; then if [ "$MYVER" -ne '80' ] ; then

View File

@ -273,6 +273,7 @@ server_dependencies=" \
libencode-perl \ libencode-perl \
cron \ cron \
libgeo-ip-perl \ libgeo-ip-perl \
arping \
openjdk-8-jdk " openjdk-8-jdk "
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies" 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" execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}" 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" check_cmd_status "Error Installing MySql Server"

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.770-230329 Version: 7.0NG.770-230330
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{230329} {230330}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #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_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" 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" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.770-230329 Version: 7.0NG.770-230330
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -267,7 +267,7 @@ if (db_get_num_rows($sql) == 0) {
$data[5] .= '</b></a>&nbsp;&nbsp;'; $data[5] .= '</b></a>&nbsp;&nbsp;';
// Force refresh module // 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] .= '<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); array_push($table->data, $data);
} }

View File

@ -967,17 +967,19 @@ foreach ($simple_alerts as $alert) {
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$policyInfo = policies_is_alert_in_policy2($alert['id'], false); $policyInfo = policies_is_alert_in_policy2($alert['id'], false);
$module_linked = policies_is_module_linked($alert['id_agent_module']); $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']] = ''; $data[$index['policy']] = '';
} else { } else {
$module_linked = policies_is_module_linked($alert['id_agent_module']); $module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') { if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png'; $img = 'images/unlinkpolicy.png';
} else { } 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') { 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] .= '<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( $data[8] .= html_print_image(
'images/change-active.svg', 'images/force@svg.svg',
true, true,
[ [
'title' => __('Reset module status and fired alert counts'), 'title' => __('Reset module status and fired alert counts'),
@ -219,7 +219,7 @@ foreach ($servers as $server) {
} else if ($server['type'] === 'enterprise snmp') { } 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] .= '<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( $data[8] .= html_print_image(
'images/change-active.svg', 'images/force@svg.svg',
true, true,
[ [
'title' => __('Claim back SNMP modules'), 'title' => __('Claim back SNMP modules'),

View File

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

View File

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

View File

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

View File

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

View File

@ -524,7 +524,7 @@ class CustomNetScan extends Wizard
// Schedule. // Schedule.
$form['inputs'][] = [ $form['inputs'][] = [
'label' => __('Interval').ui_print_help_tip( '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 true
), ),
'class' => 'input-interval', 'class' => 'input-interval',
@ -549,9 +549,6 @@ class CustomNetScan extends Wizard
true, true,
false, false,
false false
).ui_print_help_tip(
__('The minimum recomended interval for Recon Task is 5 minutes'),
true
).'</span>', ).'</span>',
]; ];

View File

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

View File

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

View File

@ -4560,7 +4560,7 @@ function events_page_details($event, $server_id=0)
true, true,
[ [
'title' => __('Go to data overview'), 'title' => __('Go to data overview'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
); );
} else { } else {
@ -4569,7 +4569,7 @@ function events_page_details($event, $server_id=0)
true, true,
[ [
'title' => __('Go to data overview'), 'title' => __('Go to data overview'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
'style' => 'opacity: .5', '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']); $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) { if ($params['search'] > 0) {
$where .= sprintf( $where .= sprintf(
' AND ( alias LIKE "%%%s%%" )', ' AND ( alias LIKE "%%%s%%" )',

View File

@ -97,7 +97,7 @@ function snmp_browser_get_html_tree(
// Id used to expand leafs. // Id used to expand leafs.
$sub_id = time().rand(0, getrandmax()); $sub_id = time().rand(0, getrandmax());
// Display the branch. // 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. // Indent sub branches.
for ($i = 1; $i <= $depth; $i++) { 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); $policyInfo = policies_is_alert_in_policy2($alert['id'], false);
$module_linked = policies_is_module_linked($alert['id_agent_module']); $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']] = ''; $data[$index['policy']] = '';
} else { } else {
$module_linked = policies_is_module_linked($alert['id_agent_module']); $module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') { if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png'; $img = 'images/unlinkpolicy.png';
} else { } else {
$img = 'images/policies_mc.png'; $img = 'images/policy@svg.svg';
} }
if (is_metaconsole() === false) { 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 { } 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 { #menu_tab {
margin: 0px; margin: 0;
} }
#menu_tab li.nomn.tab_operation img, #menu_tab li.nomn.tab_operation img,
@ -426,12 +426,16 @@ li#search_input_widget {
top: 2px; top: 2px;
} }
.select2-search--dropdown .select2-search__field {
width: auto;
}
div#dashboard-controls { div#dashboard-controls {
position: fixed; position: fixed;
z-index: 1; z-index: 1;
top: 10px; top: 10px;
right: 10px; right: 10px;
width: 800px; width: 450px;
height: 70px; height: 70px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -444,7 +448,7 @@ div#dashboard-controls {
} }
div#dashboard-controls div { div#dashboard-controls div {
flex: 0.5; margin-left: 10px;
text-align: center; text-align: center;
} }

View File

@ -15,8 +15,8 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.
@ -1653,7 +1653,7 @@ table.info_box.warning {
} }
.warning * { .warning * {
color: #f3b200; color: #8d4100;
} }
.help { .help {
@ -7007,6 +7007,10 @@ div.graph div.legend table {
margin-top: -2px !important; margin-top: -2px !important;
} }
.mrgn_top-8px {
margin-top: -8px !important;
}
.mrgn_top-10px { .mrgn_top-10px {
margin-top: -10px; margin-top: -10px;
} }

View File

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

View File

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

View File

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

View File

@ -119,6 +119,7 @@ if (is_ajax() === true) {
$length = (int) get_parameter('length', $config['block_size']); $length = (int) get_parameter('length', $config['block_size']);
$order = get_datatable_order(); $order = get_datatable_order();
$id_agent = (int) get_parameter('id_agent', 0); $id_agent = (int) get_parameter('id_agent', 0);
$id_group = (int) get_parameter('id_group', 0);
$params = [ $params = [
'search' => $filter['value'], 'search' => $filter['value'],
@ -126,6 +127,7 @@ if (is_ajax() === true) {
'length' => $length, 'length' => $length,
'order' => $order, 'order' => $order,
'id_agent' => $id_agent, 'id_agent' => $id_agent,
'id_group' => $id_group,
]; ];
$data = get_data_basic_info_sql($params); $data = get_data_basic_info_sql($params);
@ -753,295 +755,8 @@ if (is_metaconsole() === true) {
$filteringFunction = ''; $filteringFunction = '';
} }
if ($is_metaconsole === false) { if ($inventory_module !== 'basic') {
// Single agent selected. if (is_metaconsole() === true) {
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 ($order_by_agent === true) { if ($order_by_agent === true) {
$count_nodos_tmp = []; $count_nodos_tmp = [];
foreach ($nodos as $count_value) { foreach ($nodos as $count_value) {
@ -1266,73 +981,293 @@ if ($is_metaconsole === false) {
} }
} }
} else { } else {
$id_agente = $inventory_id_agent; // Single agent selected.
$agentes = []; if ($inventory_id_agent > 0 && isset($agents[$inventory_id_agent]) === true) {
$data = []; $agents = [$inventory_id_agent => $agents[$inventory_id_agent]];
$class = 'info_table'; }
$style = 'width: 99%';
$ordering = true;
$searching = false;
$columns = [ $agents_ids = array_keys($agents);
'alias', if (count($agents_ids) > 0) {
'ip', $rows = inventory_get_datatable(
'secondoaryIp', $agents_ids,
'group', $inventory_module,
'secondaryGroups', $utimestamp,
'description', $inventory_search_string,
'os', $export,
'interval', false,
'lastContact', $order_by_agent
'lastStatusChange', );
'customFields', }
'valuesCustomFields',
];
$columns_names = [ if (count($agents_ids) === 0 || (int) $rows === ERR_NODATA) {
__('Alias'), ui_print_info_message(
__('IP'), [
__('Secondary IP'), 'no_close' => true,
__('Group'), 'message' => __('No data found.'),
__('Secondary groups'), ]
__('Description'), );
__('OS'), return;
__('Interval'), }
__('Last contact'),
__('Last status change'),
__('Custom fields'),
__('Values Custom Fields'),
];
ui_print_datatable( echo "<div id='loading_url' style='display: none; width: ".$table->width."; text-align: right;'>".html_print_image('images/spinner.gif', true).'</div>';
[ ?>
'id' => 'basic_info', <script type="text/javascript">
'class' => $class, function get_csv_url(module, id_group, search_string, utimestamp, agent, order_by_agent) {
'style' => $style, $("#url_csv").hide();
'columns' => $columns, $("#loading_url").show();
'column_names' => $columns_names, $.ajax ({
'ordering' => $ordering, method:'GET',
'searching' => $searching, url:'ajax.php',
'order' => [ datatype:'html',
'field' => $columns[0], data:{
'direction' => 'asc', "page" : "operation/inventory/inventory",
], "get_csv_url" : 1,
'ajax_url' => 'operation/inventory/inventory', "module" : module,
'ajax_data' => [ "id_group" : id_group,
'get_data_basic_info' => 1, "search_string" : search_string,
'id_agent' => $id_agente, "utimestamp" : utimestamp,
], "agent" : agent,
'zeroRecords' => __('Agent info not found'), "export": true,
'emptyTable' => __('Agent info not found'), "order_by_agent": order_by_agent
'return' => false, },
] 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( $data_rows = explode(PHP_EOL, $row['data']);
'', foreach ($data_rows as $data_row) {
['type' => 'form_action'] // 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'); ui_require_jquery_file('pandora.controls');

View File

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

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.770 %define version 7.0NG.770
%define release 230329 %define release 230330
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %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 .= '&nbsp;&nbsp;';
$table_agent_header .= '<a href="'.$model->url.'&op=force&id='.$cluster->id(); $table_agent_header .= '<a href="'.$model->url.'&op=force&id='.$cluster->id();
$table_agent_header .= '">'.html_print_image( $table_agent_header .= '">'.html_print_image(
'images/change-active.svg', 'images/force@svg.svg',
true, true,
[ [
'title' => __('Force cluster status calculation'), '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>'; $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'] .= __('Refresh').':';
$comboRefresh['text'] .= html_print_select( $comboRefresh['text'] .= html_print_select(
\get_refresh_time_array(), \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( ui_print_standard_header(
$dashboardName, $dashboardName,
'', '',

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.770-230329 Version: 7.0NG.770-230330
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.770 Build 230329"; my $version = "7.0NG.770 Build 230330";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

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

View File

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