Merge remote-tracking branch 'origin/develop' into ent-9086-eliminacion-de-la-replicacion-de-eventos-duplicado

This commit is contained in:
Daniel Barbero Martin 2022-06-23 12:51:35 +02:00
commit 5328cf21c6
77 changed files with 609 additions and 213 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, AIX version # Version 7.0NG.763, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, FreeBSD Version # Version 7.0NG.763, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, HP-UX Version # Version 7.0NG.763, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, GNU/Linux # Version 7.0NG.763, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, GNU/Linux # Version 7.0NG.763, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, Solaris Version # Version 7.0NG.763, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.762 # Version 7.0NG.763
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version # Foundation; either version 2 of the Licence or any later version

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.762, AIX version # Version 7.0NG.763, AIX version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.762 # Version 7.0NG.763
# FreeBSD/IPSO version # FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena # Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.762, HPUX Version # Version 7.0NG.763, HPUX Version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762 # Version 7.0NG.763
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762 # Version 7.0NG.763
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762 # Version 7.0NG.763
# Licensed under GPL license v2, # Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.762, Solaris version # Version 7.0NG.763, Solaris version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, AIX version # Version 7.0NG.763, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

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

@ -31,7 +31,7 @@ fi
if [ "$#" -ge 2 ]; then if [ "$#" -ge 2 ]; then
VERSION="$2" VERSION="$2"
else else
VERSION="7.0NG.762" VERSION="7.0NG.763"
fi fi
# Path for the generated DMG file # Path for the generated DMG file

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false"> <choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/> <pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice> </choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.762" onConclusion="none">pandorafms_src.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.763" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications"> <choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/> <pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice> </choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.762" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.763" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" /> <!-- <installation-check script="check()" />
<script> <script>
<![CDATA[ <![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string> <key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string> <key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.762</string> <key>CFBundleVersion</key> <string>7.0NG.763</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.762 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string> <key>CFBundleGetInfoString</key> <string>7.0NG.763 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.762</string> <key>CFBundleShortVersionString</key> <string>7.0NG.763</string>
<key>NSPrincipalClass</key><string>NSApplication</string> <key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string> <key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, GNU/Linux # Version 7.0NG.763, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, FreeBSD Version # Version 7.0NG.763, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, HP-UX Version # Version 7.0NG.763, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, GNU/Linux # Version 7.0NG.763, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, GNU/Linux # Version 7.0NG.763, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, NetBSD Version # Version 7.0NG.763, NetBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.762, Solaris Version # Version 7.0NG.763, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1014,7 +1014,7 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.762'; use constant AGENT_VERSION => '7.0NG.763';
use constant AGENT_BUILD => '220623'; use constant AGENT_BUILD => '220623';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.762 %define version 7.0NG.763
%define release 220623 %define release 1
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.762 %define version 7.0NG.763
%define release 220623 %define release 1
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.762" PI_VERSION="7.0NG.763"
PI_BUILD="220623" PI_BUILD="220623"
OS_NAME=`uname -s` OS_NAME=`uname -s`

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.762 # Version 7.0NG.763
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version # Foundation; either version 2 of the Licence or any later version

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes} {Yes}
AppName AppName
{Pandora FMS Windows Agent v7.0NG.762} {Pandora FMS Windows Agent v7.0NG.763}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No} {No}
Windows,Executable Windows,Executable
{<%AppName%>-<%Version%>-Setup<%Ext%>} {<%AppName%>-Setup<%Ext%>}
Windows,FileDescription Windows,FileDescription
{<%AppName%> <%Version%> Setup} {<%AppName%> <%Version%> Setup}

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.762 Build 220623") #define PANDORA_VERSION ("7.0NG.763 Build 220623")
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.762(Build 220623))" VALUE "ProductVersion", "(7.0NG.763(Build 220623))"
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.762-220623 Version: 7.0NG.763
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.762-220623" pandora_version="7.0NG.763"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -41,6 +41,15 @@ ALTER TABLE `tservice` ADD COLUMN `rca` TEXT;
ALTER TABLE `tdashboard` MODIFY `name` TEXT NOT NULL DEFAULT ''; ALTER TABLE `tdashboard` MODIFY `name` TEXT NOT NULL DEFAULT '';
ALTER TABLE `tevent_alert` ADD COLUMN `field1_recovery` TEXT AFTER `recovery_notify`;
ALTER TABLE `tevent_alert` ADD COLUMN `field4_recovery` TEXT AFTER `field3_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field5_recovery` TEXT AFTER `field4_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field6_recovery` TEXT AFTER `field5_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field7_recovery` TEXT AFTER `field6_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field8_recovery` TEXT AFTER `field7_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field9_recovery` TEXT AFTER `field8_recovery`;
ALTER TABLE `tevent_alert` ADD COLUMN `field10_recovery` TEXT AFTER `field9_recovery`;
ALTER TABLE `tagente` ADD COLUMN `satellite_server` INT NOT NULL default 0; ALTER TABLE `tagente` ADD COLUMN `satellite_server` INT NOT NULL default 0;
ALTER TABLE `tmetaconsole_agent` ADD COLUMN `satellite_server` INT NOT NULL default 0; ALTER TABLE `tmetaconsole_agent` ADD COLUMN `satellite_server` INT NOT NULL default 0;

View File

@ -288,7 +288,7 @@ foreach ($sessions as $session) {
array_push($table->data, $data); array_push($table->data, $data);
} }
$activity .= html_print_table($table, true); $activity = html_print_table($table, true);
unset($table); unset($table);
ui_toggle( ui_toggle(

View File

@ -663,6 +663,16 @@ $tip = ui_print_help_tip(
true true
); );
$table_other->data[$i][0] = __('WMI binary');
$table_other->data[$i++][1] = html_print_input_text(
'wmiBinary',
$config['wmiBinary'],
'',
50,
50,
true
);
if (enterprise_installed() === true) { if (enterprise_installed() === true) {
$table_other->data[$i][0] = __('PhantomJS cache cleanup ').$tip; $table_other->data[$i][0] = __('PhantomJS cache cleanup ').$tip;
$table_other->data[$i++][1] = html_print_input( $table_other->data[$i++][1] = html_print_input(

View File

@ -11,7 +11,7 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// 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.
// Load global vars // Load global vars.
global $config; global $config;
check_login(); check_login();
@ -181,7 +181,8 @@ $backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png);
$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif); $backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif);
asort($backgrounds_list); asort($backgrounds_list);
if (!enterprise_installed()) { $open = false;
if (enterprise_installed() === false) {
$open = true; $open = true;
} }
@ -953,7 +954,7 @@ $options_full_escale[2] = __('On Boolean graphs');
$table_chars->data[$row][1] = html_print_select( $table_chars->data[$row][1] = html_print_select(
$options_full_escale, $options_full_escale,
'full_scale_option', 'full_scale_option',
$config['full_scale_option'], (isset($config['full_scale_option']) === true) ? $config['full_scale_option'] : 0,
'', '',
'', '',
0, 0,
@ -973,7 +974,7 @@ $options_soft_graphs[1] = __('Show MAX/AVG/MIN by default');
$table_chars->data[$row][1] = html_print_select( $table_chars->data[$row][1] = html_print_select(
$options_soft_graphs, $options_soft_graphs,
'type_mode_graph', 'type_mode_graph',
$config['type_mode_graph'], (isset($config['type_mode_graph']) === true) ? $config['type_mode_graph'] : 0,
'', '',
'', '',
0, 0,
@ -1053,13 +1054,31 @@ $table_vc->data[$row][1] = html_print_extended_select_for_time(
$row++; $row++;
$table_vc->data[$row][0] = __('Default interval for refresh on Visual Console'); $table_vc->data[$row][0] = __('Default interval for refresh on Visual Console');
$table_vc->data[$row][1] = html_print_select($values, 'vc_refr', (int) $config['vc_refr'], '', 'N/A', 0, true, false, false); $table_vc->data[$row][1] = html_print_select(
$values,
'vc_refr',
(int) $config['vc_refr'],
'',
'N/A',
0,
true,
false,
false
);
$row++; $row++;
$vc_favourite_view_array[0] = __('Classic view'); $vc_favourite_view_array[0] = __('Classic view');
$vc_favourite_view_array[1] = __('View of favorites'); $vc_favourite_view_array[1] = __('View of favorites');
$table_vc->data[$row][0] = __('Type of view of visual consoles'); $table_vc->data[$row][0] = __('Type of view of visual consoles');
$table_vc->data[$row][1] = html_print_select($vc_favourite_view_array, 'vc_favourite_view', $config['vc_favourite_view'], '', '', 0, true); $table_vc->data[$row][1] = html_print_select(
$vc_favourite_view_array,
'vc_favourite_view',
$config['vc_favourite_view'],
'',
'',
0,
true
);
$row++; $row++;
$table_vc->data[$row][0] = __('Number of favorite visual consoles to show in the menu'); $table_vc->data[$row][0] = __('Number of favorite visual consoles to show in the menu');
@ -1067,7 +1086,23 @@ $table_vc->data[$row][1] = "<input type ='number' value=".$config['vc_menu_items
$row++; $row++;
$table_vc->data[$row][0] = __('Default line thickness for the Visual Console'); $table_vc->data[$row][0] = __('Default line thickness for the Visual Console');
$table_vc->data[$row][1] = html_print_input_text('vc_line_thickness', (int) $config['vc_line_thickness'], '', 5, 5, true); $table_vc->data[$row][1] = html_print_input_text(
'vc_line_thickness',
(int) $config['vc_line_thickness'],
'',
5,
5,
true
);
$table_vc->data[$row][0] = __('Mobile view not allow visual console orientation');
$table_vc->data[$row][1] = html_print_checkbox_switch(
'mobile_view_orientation_vc',
1,
(bool) $config['mobile_view_orientation_vc'],
true
);
$row++;
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
@ -1133,7 +1168,17 @@ $interval_description = [
'tiny' => 'Short', 'tiny' => 'Short',
]; ];
$table_report->data[$row][0] = __('Interval description'); $table_report->data[$row][0] = __('Interval description');
$table_report->data[$row][1] = html_print_select($interval_description, 'interval_description', $config['interval_description'], '', '', '', true, false, false); $table_report->data[$row][1] = html_print_select(
$interval_description,
'interval_description',
(isset($config['interval_description']) === true) ? $config['interval_description'] : 'large',
'',
'',
'',
true,
false,
false
);
$row++; $row++;

View File

@ -278,6 +278,13 @@ class AgentWizard extends HTML
*/ */
private $extraArguments = ''; private $extraArguments = '';
/**
* Binary of wmic.
*
* @var string
*/
private $wmiBinary = '';
/** /**
* Constructor * Constructor
@ -291,7 +298,7 @@ class AgentWizard extends HTML
// Check access. // Check access.
check_login(); check_login();
if (!check_acl($config['id_user'], 0, 'AR')) { if ((bool) check_acl($config['id_user'], 0, 'AR') === false) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
'Trying to access event viewer' 'Trying to access event viewer'
@ -311,6 +318,7 @@ class AgentWizard extends HTML
$this->idAgent = get_parameter('id_agente', ''); $this->idAgent = get_parameter('id_agente', '');
$this->idPolicy = get_parameter('id', ''); $this->idPolicy = get_parameter('id', '');
$this->targetIp = get_parameter('targetIp', ''); $this->targetIp = get_parameter('targetIp', '');
$this->wmiBinary = $config['wmiBinary'];
if (empty($this->idAgent) === false) { if (empty($this->idAgent) === false) {
$array_aux = db_get_all_rows_sql( $array_aux = db_get_all_rows_sql(
@ -1044,7 +1052,7 @@ class AgentWizard extends HTML
$oidExplore = '.1.3.6.1.2.1.1.2.0'; $oidExplore = '.1.3.6.1.2.1.1.2.0';
} }
// Explore general or interfaces // Explore general or interfaces.
$receivedOid = $this->snmpWalkValues( $receivedOid = $this->snmpWalkValues(
$oidExplore, $oidExplore,
false, false,
@ -1080,7 +1088,7 @@ class AgentWizard extends HTML
// Capture the parameters. // Capture the parameters.
// Call WMI Explorer function. // Call WMI Explorer function.
$this->wmiCommand = wmi_compose_query( $this->wmiCommand = wmi_compose_query(
'wmic', $this->wmiBinary,
$this->usernameWMI, $this->usernameWMI,
$this->passwordWMI, $this->passwordWMI,
$this->targetIp, $this->targetIp,
@ -1090,19 +1098,26 @@ class AgentWizard extends HTML
// the host is Windows (and allow WMI). // the host is Windows (and allow WMI).
$commandQuery = $this->wmiCommand; $commandQuery = $this->wmiCommand;
$commandQuery .= ' "SELECT Caption FROM Win32_ComputerSystem"'; $commandQuery .= ' "SELECT Caption FROM Win32_ComputerSystem"';
// Execute the wmic command. // Declare the vars.
$result = []; $result = [];
exec($commandQuery, $result); $returnVar = 0;
$execCorrect = true;
$tmpError = ''; $tmpError = '';
$execCorrect = true;
// Look for the response if we have ERROR messages. // Execute the command.
foreach ($result as $info) { exec($commandQuery, $result, $returnVar);
if (preg_match('/ERROR:/', $info) !== 0) { // Only is valid if return code is 0.
$execCorrect = false; if ($returnVar === 0) {
$tmpError = strrchr($info, 'ERROR:'); // Look for the response if we have ERROR messages.
break; foreach ($result as $info) {
if (preg_match('/ERROR:/', $info) !== 0) {
$execCorrect = false;
$tmpError = strrchr($info, 'ERROR:');
break;
}
} }
} else {
$tmpError = sprintf('Return Code %s', $returnVar);
$execCorrect = false;
} }
// FOUND ERRORS: TIMEOUT. // FOUND ERRORS: TIMEOUT.
@ -2806,7 +2821,7 @@ class AgentWizard extends HTML
// Unpack the query filters. // Unpack the query filters.
$queryFilters = json_decode($module['query_filters'], true); $queryFilters = json_decode($module['query_filters'], true);
// Name of query filter field. // Name of query filter field.
$fieldValueName = $fieldSet[$queryFilters['field']]; $fieldValueName = (empty($fieldSet[$queryFilters['field']]) === false) ? $fieldSet[$queryFilters['field']] : '1';
// Evaluate type of scan and execution. // Evaluate type of scan and execution.
if ($module['scan_type'] == SCAN_TYPE_FIXED) { if ($module['scan_type'] == SCAN_TYPE_FIXED) {
@ -2841,13 +2856,13 @@ class AgentWizard extends HTML
// If name of the module have a macro. // If name of the module have a macro.
$moduleBlocks[$k]['name'] = $this->macroFilter( $moduleBlocks[$k]['name'] = $this->macroFilter(
$module['name'], io_safe_output($module['name']),
$columnsList, $columnsList,
$rowList $rowList
); );
// Description can have macros too. // Description can have macros too.
$moduleBlocks[$k]['description'] = $this->macroFilter( $moduleBlocks[$k]['description'] = $this->macroFilter(
$module['description'], io_safe_output($module['description']),
$columnsList, $columnsList,
$rowList $rowList
); );
@ -2859,7 +2874,7 @@ class AgentWizard extends HTML
); );
foreach ($columnsList as $columnKey => $columnValue) { foreach ($columnsList as $columnKey => $columnValue) {
$macros['macros']['_'.$columnValue.'_'] = $rowList[$columnKey]; $macros['macros']['_'.trim($columnValue).'_'] = $rowList[trim($columnKey)];
} }
$moduleBlocks[$k]['macros'] = json_encode($macros); $moduleBlocks[$k]['macros'] = json_encode($macros);
@ -2892,6 +2907,7 @@ class AgentWizard extends HTML
$dataCombined = array_combine($columnsList, $rowList); $dataCombined = array_combine($columnsList, $rowList);
// Change the macros for values. // Change the macros for values.
foreach ($dataCombined as $macroKey => $macroValue) { foreach ($dataCombined as $macroKey => $macroValue) {
$macroKey = trim($macroKey);
if (preg_match('/_'.$macroKey.'_/', $valueOperation) !== 0) { if (preg_match('/_'.$macroKey.'_/', $valueOperation) !== 0) {
$valueOperation = preg_replace( $valueOperation = preg_replace(
'/_'.$macroKey.'_/', '/_'.$macroKey.'_/',
@ -2937,19 +2953,19 @@ class AgentWizard extends HTML
$rowList = explode('|', $rowContent); $rowList = explode('|', $rowContent);
// If name of the module have a macro. // If name of the module have a macro.
$newModule['name'] = $this->macroFilter( $newModule['name'] = $this->macroFilter(
$module['name'], io_safe_output($module['name']),
$columnsList, $columnsList,
$rowList $rowList
); );
// Description can have macros too. // Description can have macros too.
$newModule['description'] = $this->macroFilter( $newModule['description'] = $this->macroFilter(
$module['description'], io_safe_output($module['description']),
$columnsList, $columnsList,
$rowList $rowList
); );
$newModule['query_filters'] = $this->macroFilter( $newModule['query_filters'] = $this->macroFilter(
$module['query_filters'], io_safe_output($module['query_filters']),
$columnsList, $columnsList,
$rowList $rowList
); );
@ -2995,6 +3011,7 @@ class AgentWizard extends HTML
); );
// Change the macros for values. // Change the macros for values.
foreach ($dataCombined as $macroKey => $macroValue) { foreach ($dataCombined as $macroKey => $macroValue) {
$macroKey = trim($macroKey);
if (preg_match('/_'.$macroKey.'_/', $valueOperation) !== 0) { if (preg_match('/_'.$macroKey.'_/', $valueOperation) !== 0) {
$valueOperation = preg_replace( $valueOperation = preg_replace(
'/_'.$macroKey.'_/', '/_'.$macroKey.'_/',
@ -3022,39 +3039,48 @@ class AgentWizard extends HTML
} }
} }
// Create the final table with all of data received. // If we not retrieve information (P.E. connection refused).
foreach ($moduleBlocks as $module) { if (empty($moduleBlocks) === true) {
// Prepare the blocks. If its new, create a new index. $this->message['type'][] = 'warning';
if (key_exists($module['group'], $blockTables) === false) { $this->message['message'][] = __(
$blockTables[$module['group']] = [ 'No information could be retrieved.'
'name' => $module['group_name'], );
'data' => [], $this->showMessage();
]; } else {
// Create the final table with all of data received.
foreach ($moduleBlocks as $module) {
// Prepare the blocks. If its new, create a new index.
if (key_exists($module['group'], $blockTables) === false) {
$blockTables[$module['group']] = [
'name' => $module['group_name'],
'data' => [],
];
}
// Add the module info in the block.
$blockTables[$module['group']]['data'][] = $module;
if (isset($blockTables[$module['group']]['activeModules']) === false
&& (int) $module['module_enabled'] === 1
) {
$blockTables[$module['group']]['activeModules'] = 2;
} else if (isset($blockTables[$module['group']]['activeModules']) === true
&& (int) $module['module_enabled'] === 0
) {
$blockTables[$module['group']]['activeModules'] = 1;
}
} }
// Add the module info in the block. // General Default monitoring.
$blockTables[$module['group']]['data'][] = $module; html_print_div(
if (isset($blockTables[$module['group']]['activeModules']) === false [
&& (int) $module['module_enabled'] === 1 'class' => 'wizard wizard-result',
) { 'style' => 'margin-top: 20px;',
$blockTables[$module['group']]['activeModules'] = 2; 'content' => $this->toggleTableModules($blockTables),
} else if (isset($blockTables[$module['group']]['activeModules']) === true ]
&& (int) $module['module_enabled'] === 0 );
) { // Add Create Modules form.
$blockTables[$module['group']]['activeModules'] = 1; $this->createModulesForm();
}
} }
// General Default monitoring.
html_print_div(
[
'class' => 'wizard wizard-result',
'style' => 'margin-top: 20px;',
'content' => $this->toggleTableModules($blockTables),
]
);
// Add Create Modules form.
$this->createModulesForm();
} }
@ -5542,13 +5568,13 @@ class AgentWizard extends HTML
string $unit='', string $unit='',
?int $type=0 ?int $type=0
) { ) {
$output = '';
try { try {
// Avoid non-numeric or arithmetic chars for security reasons. // Avoid non-numeric or arithmetic chars for security reasons.
if (preg_match('/(([^0-9\s\+\-\*\/\(\).,])+)/', $operation) === 1) { if (preg_match('/(([^0-9\s\+\-\*\/\(\).,])+)/', $operation) === 1) {
throw new Exception(sprintf(__("The operation '%s' is not permitted. Review for remote components."), $operation)); throw new Exception(sprintf(__("The operation '%s' is not permitted. Review for remote components."), $operation));
} else { } else {
// Get the result of the operation and set it. // Get the result of the operation and set it.
$output = '';
eval('$output = '.$operation.';'); eval('$output = '.$operation.';');
// If this module has unit, attach to current value. // If this module has unit, attach to current value.
$output = $this->replacementUnit( $output = $this->replacementUnit(
@ -5723,7 +5749,7 @@ class AgentWizard extends HTML
$(this).removeClass('hidden'); $(this).removeClass('hidden');
return; return;
} }
if (this.id.match(regex)) { if (this.id.match(regex)) {
$(this).removeClass('hidden'); $(this).removeClass('hidden');
} else { } else {
@ -5735,7 +5761,7 @@ class AgentWizard extends HTML
$(this).addClass('hidden'); $(this).addClass('hidden');
} }
} }
if (filter_up == true) { if (filter_up == true) {
if ($(this).attr('operstatus') != 1) { if ($(this).attr('operstatus') != 1) {
$(this).addClass('hidden'); $(this).addClass('hidden');

View File

@ -851,6 +851,8 @@ class HTML
foreach ($inputs as $input) { foreach ($inputs as $input) {
if (is_array(($input['arguments'] ?? null)) === true if (is_array(($input['arguments'] ?? null)) === true
&& isset($input['arguments']) === true
&& isset($input['arguments']['type']) === true
&& $input['arguments']['type'] === 'submit' && $input['arguments']['type'] === 'submit'
) { ) {
$output_submit .= self::printBlock($input, true); $output_submit .= self::printBlock($input, true);

View File

@ -309,7 +309,7 @@ class WelcomeWindow extends Wizard
{ {
global $config; global $config;
return $config['welcome_id_agent']; return (isset($config['welcome_id_agent']) === true) ? $config['welcome_id_agent'] : '';
} }

View File

@ -21,7 +21,7 @@
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC220623'; $build_version = 'PC220623';
$pandora_version = 'v7.0NG.762'; $pandora_version = 'v7.0NG.763';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get(); $script_tz = @date_default_timezone_get();

View File

@ -902,6 +902,10 @@ function config_update_config()
$error_update[] = __('SNMP walk binary path (fallback for v1)'); $error_update[] = __('SNMP walk binary path (fallback for v1)');
} }
if (config_update_value('wmiBinary', get_parameter('wmiBinary'), true) === false) {
$error_update[] = __('Default WMI Binary');
}
$pjs = get_parameter('phantomjs_cache_interval'); $pjs = get_parameter('phantomjs_cache_interval');
switch ($pjs) { switch ($pjs) {
case $config['phantomjs_cache_interval']: case $config['phantomjs_cache_interval']:
@ -1157,6 +1161,10 @@ function config_update_config()
$error_update[] = __('Default line thickness for the Visual Console'); $error_update[] = __('Default line thickness for the Visual Console');
} }
if (config_update_value('mobile_view_orientation_vc', (int) get_parameter('mobile_view_orientation_vc'), true) === false) {
$error_update[] = __('Mobile view not allow visual console orientation');
}
if (config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10), true) === false) { if (config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10), true) === false) {
$error_update[] = __('Default line menu items for the Services'); $error_update[] = __('Default line menu items for the Services');
} }
@ -2065,6 +2073,10 @@ function config_process_config()
config_update_value('snmpwalk_fallback', 'snmpwalk'); config_update_value('snmpwalk_fallback', 'snmpwalk');
} }
if (isset($config['wmiBinary']) === false) {
config_update_value('wmiBinary', 'pandorawmic');
}
if (!isset($config['event_purge'])) { if (!isset($config['event_purge'])) {
config_update_value('event_purge', 15); config_update_value('event_purge', 15);
} }
@ -3019,6 +3031,10 @@ function config_process_config()
config_update_value('vc_line_thickness', 2); config_update_value('vc_line_thickness', 2);
} }
if (isset($config['mobile_view_orientation_vc']) === false) {
config_update_value('mobile_view_orientation_vc', 0);
}
if (!isset($config['agent_size_text_small'])) { if (!isset($config['agent_size_text_small'])) {
config_update_value('agent_size_text_small', 18); config_update_value('agent_size_text_small', 18);
} }

View File

@ -4924,7 +4924,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
case 'image': case 'image':
$output .= html_print_input_image( $output .= html_print_input_image(
$data['name'], ((isset($data['name']) === true) ? $data['name'] : ''),
$data['src'], $data['src'],
$data['value'], $data['value'],
((isset($data['style']) === true) ? $data['style'] : ''), ((isset($data['style']) === true) ? $data['style'] : ''),

View File

@ -34,15 +34,22 @@
* *
* @param boolean $id_user * @param boolean $id_user
* @param boolean $user_strict * @param boolean $user_strict
* @param [type] $acltags * @param array $acltags
* @param boolean $returnAllGroup * @param boolean $returnAllGroup
* @param string $mode * @param string $mode
* @param array $agent_filter * @param array $agent_filter
* @param array $module_filter * @param array $module_filter
* @return void * @return void
*/ */
function tactical_get_data($id_user=false, $user_strict=false, $acltags, $returnAllGroup=false, $mode='group', $agent_filter=[], $module_filter=[]) function tactical_get_data(
{ $id_user=false,
$user_strict=false,
$acltags=[],
$returnAllGroup=false,
$mode='group',
$agent_filter=[],
$module_filter=[]
) {
global $config; global $config;
if ($id_user == false) { if ($id_user == false) {
$id_user = $config['id_user']; $id_user = $config['id_user'];
@ -504,10 +511,12 @@ function tactical_status_modules_agents($id_user=false, $user_strict=false, $acc
function tactical_monitor_alerts($strict_user=false) function tactical_monitor_alerts($strict_user=false)
{ {
global $config;
$groups = users_get_groups($config['id_user'], 'AR', false); $groups = users_get_groups($config['id_user'], 'AR', false);
$id_groups = array_keys($groups); $id_groups = array_keys($groups);
if (empty($id_groups)) { $where_clause = '';
if (empty($id_groups) === true) {
$where_clause .= ' AND (1 = 0) '; $where_clause .= ' AND (1 = 0) ';
} else { } else {
$where_clause .= sprintf( $where_clause .= sprintf(

View File

@ -82,7 +82,7 @@ function visual_map_print_user_line_handles($layoutData)
function visual_map_print_item( function visual_map_print_item(
$mode='read', $mode='read',
$layoutData, $layoutData=[],
$proportion=null, $proportion=null,
$show_links=true, $show_links=true,
$isExternalLink=false, $isExternalLink=false,
@ -2554,13 +2554,13 @@ function visual_map_process_wizard_add(
$range, $range,
$width=0, $width=0,
$height=0, $height=0,
$period, $period='',
$process_value, $process_value='',
$percentileitem_width, $percentileitem_width='',
$max_value, $max_value=0,
$type_percentile, $type_percentile='',
$value_show, $value_show='',
$type $type=''
) { ) {
if (empty($id_agents)) { if (empty($id_agents)) {
print_error_message(__('No agents selected')); print_error_message(__('No agents selected'));
@ -3956,7 +3956,15 @@ function visual_map_get_layout_status($layout_id, $status_data=[], $depth=0)
sort_by_column($valid_layout_items, 'id_metaconsole'); sort_by_column($valid_layout_items, 'id_metaconsole');
} }
$num_elements_by_status = []; $num_elements_by_status = [
VISUAL_MAP_STATUS_CRITICAL_BAD => 0,
VISUAL_MAP_STATUS_CRITICAL_ALERT => 0,
VISUAL_MAP_STATUS_NORMAL => 0,
VISUAL_MAP_STATUS_WARNING => 0,
VISUAL_MAP_STATUS_UNKNOWN => 0,
VISUAL_MAP_STATUS_WARNING_ALERT => 0,
];
$meta_connected_to = null; $meta_connected_to = null;
foreach ($valid_layout_items as $layout_item_data) { foreach ($valid_layout_items as $layout_item_data) {
@ -3993,7 +4001,7 @@ function visual_map_get_layout_status($layout_id, $status_data=[], $depth=0)
$ent_element_status = enterprise_hook( $ent_element_status = enterprise_hook(
'enterprise_visual_map_get_status_element', 'enterprise_visual_map_get_status_element',
[$layoutData] [$layout_item_data]
); );
if ($ent_element_status === ENTERPRISE_NOT_HOOK) { if ($ent_element_status === ENTERPRISE_NOT_HOOK) {
$ent_element_status = false; $ent_element_status = false;
@ -4558,7 +4566,7 @@ function css_label_styles_visual_console($uniq, $ratio=1)
$output .= '.c-'.$uniq.' a {color: #3f3f3f } '; $output .= '.c-'.$uniq.' a {color: #3f3f3f } ';
$output .= '.c-'.$uniq.' .label p strong span {display: inline-block !important; line-height: normal !important} '; $output .= '.c-'.$uniq.' .label p strong span {display: inline-block !important; line-height: normal !important} ';
$output .= '.c-'.$uniq.' *:not(.parent_graph p table tr td span) { font-size: '.(8 * $ratio).'pt; line-height:'.(8 * ($ratio)).'pt; }'; $output .= '.c-'.$uniq.' *:not(.parent_graph p table tr td span) { font-size: '.(8 * $ratio).'pt; line-height:'.(8 * ($ratio)).'pt; }';
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td { padding: 0; margin: 0; }'; $output .= '.c-'.$uniq.' .visual-console-item-label table tr td { padding: 0; margin: 0; white-space: pre-wrap; }';
$output .= '.c-'.$uniq.' .visual_font_size_4pt, .c-'.$uniq.' .visual_font_size_4pt * { font-size: '.(4 * $ratio).'pt !important; line-height:'.(4 * ($ratio)).'pt !important; }'; $output .= '.c-'.$uniq.' .visual_font_size_4pt, .c-'.$uniq.' .visual_font_size_4pt * { font-size: '.(4 * $ratio).'pt !important; line-height:'.(4 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_6pt, .c-'.$uniq.' .visual_font_size_6pt * { font-size: '.(6 * $ratio).'pt !important; line-height:'.(6 * ($ratio)).'pt !important; }'; $output .= '.c-'.$uniq.' .visual_font_size_6pt, .c-'.$uniq.' .visual_font_size_6pt * { font-size: '.(6 * $ratio).'pt !important; line-height:'.(6 * ($ratio)).'pt !important; }';
$output .= '.c-'.$uniq.' .visual_font_size_8pt, .c-'.$uniq.' .visual_font_size_8pt * { font-size: '.(8 * $ratio).'pt !important; line-height:'.(8 * ($ratio)).'pt !important; }'; $output .= '.c-'.$uniq.' .visual_font_size_8pt, .c-'.$uniq.' .visual_font_size_8pt * { font-size: '.(8 * $ratio).'pt !important; line-height:'.(8 * ($ratio)).'pt !important; }';

View File

@ -32,13 +32,13 @@ function wmi_compose_query($wmi_client, $user, $password, $host, $namespace='')
{ {
$wmi_command = ''; $wmi_command = '';
if (!empty($password)) { if (empty($password) === false) {
$wmi_command = $wmi_client.' -U "'.$user.'"%"'.$password.'"'; $wmi_command = $wmi_client.' -U \''.$user.'\'%\''.$password.'\'';
} else { } else {
$wmi_command = $wmi_client.' -U "'.$user.'"'; $wmi_command = $wmi_client.' -U "'.$user.'"';
} }
if (!empty($namespace)) { if (empty($namespace) === false) {
$namespace = str_replace('&quot;', "'", $namespace); $namespace = str_replace('&quot;', "'", $namespace);
$wmi_command .= ' --namespace="'.$namespace.'"'; $wmi_command .= ' --namespace="'.$namespace.'"';
} }

View File

@ -1223,6 +1223,8 @@ function dashboardLoadVC(settings) {
var ratio_visualconsole = props.height / props.width; var ratio_visualconsole = props.height / props.width;
var ratio_w = size.width / props.width; var ratio_w = size.width / props.width;
var ratio_h = size.height / props.height; var ratio_h = size.height / props.height;
var acum_height = props.height;
var acum_width = props.width;
props.width = size.width; props.width = size.width;
props.height = size.width * ratio_visualconsole; props.height = size.width * ratio_visualconsole;
@ -1235,6 +1237,11 @@ function dashboardLoadVC(settings) {
props.height = size.height; props.height = size.height;
props.width = size.height / ratio_visualconsole; props.width = size.height / ratio_visualconsole;
} }
} else {
ratio = ratio_w;
var height = (acum_height * size.width) / acum_width;
props.height = height;
props.width = height / ratio_visualconsole;
} }
} else { } else {
if (props.height > size.height) { if (props.height > size.height) {
@ -1290,22 +1297,30 @@ function dashboardLoadVC(settings) {
var regex_hash = /(hash=)[^&]+(&?)/gi; var regex_hash = /(hash=)[^&]+(&?)/gi;
var replacement_hash = "$1" + props.hash + "$2"; var replacement_hash = "$1" + props.hash + "$2";
/*
var regex_width = /(width=)[^&]+(&?)/gi; var regex_width = /(width=)[^&]+(&?)/gi;
var replacement_width = "$1" + size.width + "$2"; var replacement_width = "$1" + size.width + "$2";
var regex_height = /(height=)[^&]+(&?)/gi; var regex_height = /(height=)[^&]+(&?)/gi;
var replacement_height = var replacement_height =
"$1" + (size.height + headerMobileFix) + "$2"; "$1" + (size.height + headerMobileFix) + "$2";
*/
// Change the URL (if the browser has support). // Change the URL (if the browser has support).
if ("history" in window) { if ("history" in window) {
var href = window.location.href.replace(regex, replacement); var href = window.location.href.replace(regex, replacement);
href = href.replace(regex_hash, replacement_hash); href = href.replace(regex_hash, replacement_hash);
href = href.replace(regex_width, replacement_width); //href = href.replace(regex_width, replacement_width);
href = href.replace(regex_height, replacement_height); //href = href.replace(regex_height, replacement_height);
window.history.replaceState({}, document.title, href); window.history.replaceState({}, document.title, href);
} }
if (props.height > props.width) {
$(".container-center").css("overflow", "auto");
} else {
$(".container-center").css("overflow", "inherit");
}
container.classList.remove("cv-overflow"); container.classList.remove("cv-overflow");
// View title. // View title.
@ -1351,40 +1366,42 @@ function dashboardLoadVC(settings) {
: "dashboard" : "dashboard"
); );
$(window).on("orientationchange", function() { if (settings.mobile_view_orientation_vc === true) {
$(container).width($(window).height()); $(window).on("orientationchange", function() {
$(container).height($(window).width() - headerMobileFix); $(container).width($(window).height());
//Remove spinner change VC. $(container).height($(window).width() - headerMobileFix);
container.classList.remove("is-updating"); //Remove spinner change VC.
container.classList.remove("cv-overflow"); container.classList.remove("is-updating");
container.classList.remove("cv-overflow");
var div = container.querySelector(".div-visual-console-spinner"); var div = container.querySelector(".div-visual-console-spinner");
if (div !== null) { if (div !== null) {
var parent = div.parentElement; var parent = div.parentElement;
if (parent !== null) { if (parent !== null) {
parent.removeChild(div); parent.removeChild(div);
}
} }
}
container.classList.add("is-updating"); container.classList.add("is-updating");
container.classList.add("cv-overflow"); container.classList.add("cv-overflow");
const divParent = document.createElement("div"); const divParent = document.createElement("div");
divParent.className = "div-visual-console-spinner"; divParent.className = "div-visual-console-spinner";
const divSpinner = document.createElement("div"); const divSpinner = document.createElement("div");
divSpinner.className = "visual-console-spinner"; divSpinner.className = "visual-console-spinner";
divParent.appendChild(divSpinner); divParent.appendChild(divSpinner);
container.appendChild(divParent); container.appendChild(divParent);
var dimensions = { var dimensions = {
width: $(window).height(), width: $(window).height(),
height: $(window).width() - 40 height: $(window).width() - 40
}; };
visualConsoleManager.changeDimensionsVc(dimensions, interval); visualConsoleManager.changeDimensionsVc(dimensions, interval);
}); });
}
} }
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars

View File

@ -438,16 +438,22 @@ class MapsMadeByUser extends Widget
$settings = \json_encode( $settings = \json_encode(
[ [
'props' => $visualConsoleData, 'props' => $visualConsoleData,
'items' => $visualConsoleItems, 'items' => $visualConsoleItems,
'baseUrl' => ui_get_full_url('/', false, false, false), 'baseUrl' => ui_get_full_url(
'ratio' => $ratio, '/',
'size' => $size, false,
'cellId' => $this->cellId, false,
'hash' => User::generatePublicHash(), false
'id_user' => $config['id_user'], ),
'page' => 'include/ajax/visual_console.ajax', 'ratio' => $ratio,
'uniq' => $uniq, 'size' => $size,
'cellId' => $this->cellId,
'hash' => User::generatePublicHash(),
'id_user' => $config['id_user'],
'page' => 'include/ajax/visual_console.ajax',
'uniq' => $uniq,
'mobile_view_orientation_vc' => false,
] ]
); );
@ -507,7 +513,6 @@ class MapsMadeByUser extends Widget
}, },
dataType: 'JSON', dataType: 'JSON',
success: function(data) { success: function(data) {
console.log(data);
$('#vcId').empty(); $('#vcId').empty();
Object.entries(data).forEach(e => { Object.entries(data).forEach(e => {
key = e[0]; key = e[0];

View File

@ -223,17 +223,33 @@ abstract class Model
*/ */
public function adjustToViewport($size, $mode='') public function adjustToViewport($size, $mode='')
{ {
global $config;
$ratio_visualconsole = $this->getRatio(); $ratio_visualconsole = $this->getRatio();
$ratio_w = ($size['width'] / $this->data['width']); $ratio_w = ($size['width'] / $this->data['width']);
$ratio_h = ($size['height'] / $this->data['height']); $ratio_h = ($size['height'] / $this->data['height']);
$acum_height = $this->data['height'];
$acum_width = $this->data['width'];
$this->data['width'] = $size['width']; $this->data['width'] = $size['width'];
$this->data['height'] = ($size['width'] * $ratio_visualconsole); $this->data['height'] = ($size['width'] * $ratio_visualconsole);
$ratio = $ratio_w; $ratio = $ratio_w;
if ($mode === 'mobile') { if ($mode === 'mobile') {
if ($this->data['height'] < $this->data['width']) { if ((bool) $config['mobile_view_orientation_vc'] === true) {
if ($this->data['height'] > $size['height']) { if ($this->data['height'] < $this->data['width']) {
if ($this->data['height'] > $size['height']) {
$ratio = $ratio_h;
$this->data['height'] = $size['height'];
$this->data['width'] = ($size['height'] / $ratio_visualconsole);
}
} else {
$ratio = $ratio_w;
$height = (($acum_height * ($size['width'])) / $acum_width);
$this->data['height'] = $height;
$this->data['width'] = ($height / $ratio_visualconsole);
}
} else {
if ($this->data['height'] > $this->data['width']) {
$ratio = $ratio_h; $ratio = $ratio_h;
$this->data['height'] = $size['height']; $this->data['height'] = $size['height'];
$this->data['width'] = ($size['height'] / $ratio_visualconsole); $this->data['width'] = ($size['height'] / $ratio_visualconsole);

View File

@ -174,6 +174,14 @@ final class StaticGraph extends Item
throw new \InvalidArgumentException('missing module Id'); throw new \InvalidArgumentException('missing module Id');
} }
if (isset($data['agentDisabled']) === false) {
$data['agentDisabled'] = false;
}
if (isset($data['moduleDisabled']) === false) {
$data['moduleDisabled'] = false;
}
if ((bool) $data['agentDisabled'] === false if ((bool) $data['agentDisabled'] === false
&& (bool) $data['moduleDisabled'] === false && (bool) $data['moduleDisabled'] === false
) { ) {

View File

@ -94,6 +94,7 @@ form#advanced_filters_alert textarea {
flex: 1 1 auto; flex: 1 1 auto;
height: 5em; height: 5em;
min-height: 5em; min-height: 5em;
width: 2em;
} }
form#advanced_filters_alert ul li label img { form#advanced_filters_alert ul li label img {

View File

@ -128,7 +128,7 @@
</div> </div>
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.762'; $version = '7.0NG.763';
$build = '220623'; $build = '220623';
$banner = "v$version Build $build"; $banner = "v$version Build $build";

View File

@ -1396,7 +1396,7 @@ div.ui-mobile-viewport {
overflow: visible; overflow: visible;
overflow-x: hidden; overflow-x: hidden;
padding: 1em; padding: 1em;
min-height: calc(100vh - 60px); /*min-height: calc(100vh - 60px);*/
} }
.ui-corner-all > .ui-toolbar-header:first-child, .ui-corner-all > .ui-toolbar-header:first-child,
.ui-corner-all > .ui-content:first-child, .ui-corner-all > .ui-content:first-child,

View File

@ -1003,6 +1003,22 @@ class Ui
$(document).ready(function () { $(document).ready(function () {
dashboardLoadVC(settings); dashboardLoadVC(settings);
if(settings.mobile_view_orientation_vc === false) {
$("#main_page > .ui-content").css("display", "block");
$(".container-center").css("padding", "50% 0");
$(".container-center").css("height", "100vh");
$(".visual-console-container-dashboard").css("display", "block");
$(".visual-console-container-dashboard").css("transform-origin", "left top");
$(".visual-console-container-dashboard").css("transform", "rotate(-90deg) translate(-100%)");
$(".visual-console-container-dashboard").css("margin-top", "-50%");
$(".visual-console-container-dashboard").css("white-space", "nowrap");
if(settings.props.height > settings.props.width) {
$(".container-center").css("overflow", "auto");
}
}
}); });
</script>' </script>'
); );

View File

@ -216,6 +216,7 @@ class Visualmap
*/ */
private function show_visualmap() private function show_visualmap()
{ {
global $config;
$ui = Ui::getInstance(); $ui = Ui::getInstance();
$system = System::getInstance(); $system = System::getInstance();
@ -279,6 +280,13 @@ class Visualmap
'height' => $this->height, 'height' => $this->height,
]; ];
if ((bool) $config['mobile_view_orientation_vc'] === true) {
$size = [
'width' => $this->height,
'height' => $this->width,
];
}
$ratio_t = $visualConsole->adjustToViewport($size, 'mobile'); $ratio_t = $visualConsole->adjustToViewport($size, 'mobile');
$visualConsoleData = $visualConsole->toArray(); $visualConsoleData = $visualConsole->toArray();
@ -340,16 +348,17 @@ class Visualmap
$settings = \json_encode( $settings = \json_encode(
[ [
'props' => $visualConsoleData, 'props' => $visualConsoleData,
'items' => $visualConsoleItems, 'items' => $visualConsoleItems,
'baseUrl' => ui_get_full_url('/', false, false, false), 'baseUrl' => ui_get_full_url('/', false, false, false),
'page' => 'include/ajax/visual_console.ajax', 'page' => 'include/ajax/visual_console.ajax',
'ratio' => $ratio_t, 'ratio' => $ratio_t,
'size' => $size, 'size' => $size,
'cellId' => $uniq, 'cellId' => $uniq,
'uniq' => $uniq, 'uniq' => $uniq,
'mobile' => true, 'mobile' => true,
'vcId' => $visualConsoleId, 'vcId' => $visualConsoleId,
'mobile_view_orientation_vc' => (bool) !$config['mobile_view_orientation_vc'],
] ]
); );

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.762 %define version 7.0NG.763
%define release 220623 %define release 1
# 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

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.762 %define version 7.0NG.763
%define release 220623 %define release 1
# 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

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.762 %define version 7.0NG.763
%define release 220623 %define release 1
%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

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license. # This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.762" PI_VERSION="7.0NG.763"
FORCE=0 FORCE=0
DESTDIR="" DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"` LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -3018,8 +3018,16 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` (
`saturday` TINYINT DEFAULT 1, `saturday` TINYINT DEFAULT 1,
`sunday` TINYINT DEFAULT 1, `sunday` TINYINT DEFAULT 1,
`recovery_notify` TINYINT DEFAULT 0, `recovery_notify` TINYINT DEFAULT 0,
`field2_recovery` TEXT , `field1_recovery` TEXT,
`field2_recovery` TEXT,
`field3_recovery` TEXT, `field3_recovery` TEXT,
`field4_recovery` TEXT,
`field5_recovery` TEXT,
`field6_recovery` TEXT,
`field7_recovery` TEXT,
`field8_recovery` TEXT,
`field9_recovery` TEXT,
`field10_recovery` TEXT,
`id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0, `id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0,
`internal_counter` INT DEFAULT 0, `internal_counter` INT DEFAULT 0,
`last_fired` BIGINT NOT NULL DEFAULT 0, `last_fired` BIGINT NOT NULL DEFAULT 0,

View File

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

View File

@ -1,7 +1,7 @@
############################################################################# #############################################################################
# Pandora FMS Server Parameters # Pandora FMS Server Parameters
# Pandora FMS, the Flexible Monitoring System. # Pandora FMS, the Flexible Monitoring System.
# Version 7.0NG.762 # Version 7.0NG.763
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -45,7 +45,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.762"; my $pandora_version = "7.0NG.763";
my $pandora_build = "220623"; my $pandora_build = "220623";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;

View File

@ -505,7 +505,7 @@ B<Returns>:
########################################################################## ##########################################################################
sub pandora_evaluate_alert ($$$$$$$;$$$$) { sub pandora_evaluate_alert ($$$$$$$;$$$$) {
my ($pa_config, $agent, $data, $last_status, $alert, $utimestamp, $dbh, my ($pa_config, $agent, $data, $last_status, $alert, $utimestamp, $dbh,
$last_data_value, $correlatedItems, $event, $log) = @_; $last_data_value, $correlated_items, $event, $log) = @_;
if (defined ($agent)) { if (defined ($agent)) {
logger ($pa_config, "Evaluating alert '" . safe_output($alert->{'name'}) . "' for agent '" . safe_output ($agent->{'nombre'}) . "'.", 10); logger ($pa_config, "Evaluating alert '" . safe_output($alert->{'name'}) . "' for agent '" . safe_output ($agent->{'nombre'}) . "'.", 10);
@ -603,13 +603,16 @@ sub pandora_evaluate_alert ($$$$$$$;$$$$) {
# Cease on valid data # Cease on valid data
$status = 3; $status = 3;
# Unlike module alerts, correlated alerts recover when they cease!
$status = 4 if ($alert->{'recovery_notify'} == 1 && !defined($alert->{'id_template_module'}));
# Always reset # Always reset
($alert->{'internal_counter'}, $alert->{'times_fired'}) = (0, 0); ($alert->{'internal_counter'}, $alert->{'times_fired'}) = (0, 0);
} }
# Recover takes precedence over cease # Recover takes precedence over cease
$status = 4 if ($alert->{'recovery_notify'} == 1); $status = 4 if ($alert->{'recovery_notify'} == 1 && defined ($alert->{'id_template_module'}));
} }
elsif ($utimestamp > $limit_utimestamp && $alert->{'internal_counter'} > 0) { elsif ($utimestamp > $limit_utimestamp && $alert->{'internal_counter'} > 0) {
@ -690,7 +693,7 @@ sub pandora_evaluate_alert ($$$$$$$;$$$$) {
$pa_config, $pa_config,
$dbh, $dbh,
$alert, $alert,
$correlatedItems, $correlated_items,
$event, $event,
$log $log
] ]

View File

@ -536,9 +536,54 @@ sub PandoraFMS::Recon::Base::test_module($$) {
# Column # Column
$test->{'tcp_port'} $test->{'tcp_port'}
); );
} elsif ($test->{'id_modulo'} == 4) {
# SNMP Bandwith plugin modules.
# Check if plugin is running.
if ($module->{'macros'} ne '') {
# Get Bandwidth plugin.
my $plugin = get_db_single_row(
$self->{'dbh'},
'SELECT * FROM tplugin WHERE name = "Network&#x20;bandwidth&#x20;SNMP"',
);
return 0 unless defined($plugin);
my $parameters = safe_output($plugin->{'parameters'});
my $plugin_exec = $plugin->{'plugin_exec'};
# Decode macros.
my $macros = p_decode_json($self->{'config'}, safe_output($test->{'macros'}));
my %macros = %{$macros};
if(ref($macros) eq "HASH") {
foreach my $macro_id (keys(%macros))
{
my $macro_field = safe_output($macros{$macro_id}{'macro'});
my $macro_desc = safe_output($macros{$macro_id}{'desc'});
my $macro_value = (defined($macros{$macro_id}{'hide'}) && $macros{$macro_id}{'hide'} eq '1') ?
pandora_output_password($self->{'config'}, safe_output($macros{$macro_id}{'value'})) :
safe_output($macros{$macro_id}{'value'});
# build parameters to invoke plugin
$parameters =~ s/\'$macros{$macro_id}{'macro'}\'/$macro_value/g;
}
}
my $command = safe_output($plugin_exec);
# Execute the plugin.
my $output = `$command 2>$DEVNULL`;
# Do not save the output if there was an error.
if ($? != 0) {
return 0;
} else {
$value = 1;
}
}
} elsif(is_enabled($test->{'id_plugin'})) { } elsif(is_enabled($test->{'id_plugin'})) {
# XXX TODO: Test plugins. How to identify arguments? and values? # XXX TODO: Test plugins. How to identify arguments? and values?
# Disabled until we can ensure result. # Disabled until we can ensure result.
return 0; return 0;
} }
@ -702,7 +747,7 @@ sub PandoraFMS::Recon::Base::create_interface_modules($$) {
'id_modulo' => 2, 'id_modulo' => 2,
'name' => $if_name."_ifOperStatus", 'name' => $if_name."_ifOperStatus",
'descripcion' => safe_input( 'descripcion' => safe_input(
$if_desc 'The current operational state of the interface: up(1), down(2), testing(3), unknown(4), dormant(5), notPresent(6), lowerLayerDown(7)',
), ),
'ip_target' => $device, 'ip_target' => $device,
'tcp_send' => $self->{'task_data'}{'snmp_version'}, 'tcp_send' => $self->{'task_data'}{'snmp_version'},
@ -713,7 +758,9 @@ sub PandoraFMS::Recon::Base::create_interface_modules($$) {
'plugin_user' => $self->{'task_data'}{'snmp_auth_user'}, 'plugin_user' => $self->{'task_data'}{'snmp_auth_user'},
'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'}, 'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'},
'snmp_community' => $community, 'snmp_community' => $community,
'snmp_oid' => "$PandoraFMS::Recon::Base::IFOPERSTATUS.$if_index" 'snmp_oid' => "$PandoraFMS::Recon::Base::IFOPERSTATUS.$if_index",
'unit' => ''
} }
); );
@ -741,7 +788,9 @@ sub PandoraFMS::Recon::Base::create_interface_modules($$) {
'plugin_user' => $self->{'task_data'}{'snmp_auth_user'}, 'plugin_user' => $self->{'task_data'}{'snmp_auth_user'},
'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'}, 'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'},
'snmp_community' => $community, 'snmp_community' => $community,
'snmp_oid' => "$PandoraFMS::Recon::Base::IFHCINOCTECTS.$if_index" 'snmp_oid' => "$PandoraFMS::Recon::Base::IFHCINOCTECTS.$if_index",
'unit' => safe_input('bytes/s')
} }
); );
} else { } else {
@ -766,7 +815,9 @@ sub PandoraFMS::Recon::Base::create_interface_modules($$) {
'plugin_user' => $self->{'task_data'}{'snmp_auth_user'}, 'plugin_user' => $self->{'task_data'}{'snmp_auth_user'},
'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'}, 'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'},
'snmp_community' => $community, 'snmp_community' => $community,
'snmp_oid' => "$PandoraFMS::Recon::Base::IFINOCTECTS.$if_index" 'snmp_oid' => "$PandoraFMS::Recon::Base::IFINOCTECTS.$if_index",
'unit' => safe_input('bytes/s')
} }
); );
} }
@ -784,7 +835,7 @@ sub PandoraFMS::Recon::Base::create_interface_modules($$) {
'id_modulo' => 2, 'id_modulo' => 2,
'name' => $if_name."_ifHCOutOctets", 'name' => $if_name."_ifHCOutOctets",
'descripcion' => safe_input( 'descripcion' => safe_input(
'The total number of octets received on the interface, including framing characters. This object is a 64-bit version of ifOutOctets.' 'The total number of octets transmitted out of the interface, including framing characters. This object is a 64-bit version of ifOutOctets.'
), ),
'ip_target' => $device, 'ip_target' => $device,
'tcp_send' => $self->{'task_data'}{'snmp_version'}, 'tcp_send' => $self->{'task_data'}{'snmp_version'},
@ -795,7 +846,9 @@ sub PandoraFMS::Recon::Base::create_interface_modules($$) {
'plugin_user' => $self->{'task_data'}{'snmp_auth_user'}, 'plugin_user' => $self->{'task_data'}{'snmp_auth_user'},
'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'}, 'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'},
'snmp_community' => $community, 'snmp_community' => $community,
'snmp_oid' => "$PandoraFMS::Recon::Base::IFHCOUTOCTECTS.$if_index" 'snmp_oid' => "$PandoraFMS::Recon::Base::IFHCOUTOCTECTS.$if_index",
'unit' => safe_input('bytes/s')
} }
); );
} else { } else {
@ -809,7 +862,7 @@ sub PandoraFMS::Recon::Base::create_interface_modules($$) {
'id_modulo' => 2, 'id_modulo' => 2,
'name' => $if_name."_ifOutOctets", 'name' => $if_name."_ifOutOctets",
'descripcion' => safe_input( 'descripcion' => safe_input(
'The total number of octets received on the interface, including framing characters.' 'The total number of octets transmitted out of the interface, including framing characters.'
), ),
'ip_target' => $device, 'ip_target' => $device,
'tcp_send' => $self->{'task_data'}{'snmp_version'}, 'tcp_send' => $self->{'task_data'}{'snmp_version'},
@ -820,10 +873,135 @@ sub PandoraFMS::Recon::Base::create_interface_modules($$) {
'plugin_user' => $self->{'task_data'}{'snmp_auth_user'}, 'plugin_user' => $self->{'task_data'}{'snmp_auth_user'},
'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'}, 'plugin_pass' => $self->{'task_data'}{'snmp_auth_pass'},
'snmp_community' => $community, 'snmp_community' => $community,
'snmp_oid' => "$PandoraFMS::Recon::Base::IFOUTOCTECTS.$if_index" 'snmp_oid' => "$PandoraFMS::Recon::Base::IFOUTOCTECTS.$if_index",
'unit' => safe_input('bytes/s')
} }
); );
} }
# Bandwidth plugin.
my $plugin = get_db_single_row(
$self->{'dbh'},
'SELECT id, macros FROM tplugin WHERE name = "Network&#x20;bandwidth&#x20;SNMP"',
);
next unless defined($plugin);
# Network Bandwidth is installed.
my $macros = p_decode_json($self->{'config'}, safe_output($plugin->{'macros'}));
my $id_plugin = $plugin->{'id'};
if(ref($macros) eq "HASH") {
# SNMP Version.
$macros->{'1'}->{'value'} = $self->{'task_data'}->{'snmp_version'};
# Community.
$macros->{'2'}->{'value'} = $community;
# Host.
$macros->{'3'}->{'value'} = $device;
# Port.
$macros->{'4'}->{'value'} = 161;
# Interface index filter.
$macros->{'5'}->{'value'} = $if_index;
# SecurityName.
$macros->{'6'}->{'value'} = $self->{'task_data'}->{'snmp_auth_user'};
# SecurityContext.
$macros->{'7'}->{'value'} = $community;
# SecurityLevel.
$macros->{'8'}->{'value'} = $self->{'task_data'}->{'snmp_security_level'};
# AuthProtocol.
$macros->{'9'}->{'value'} = $self->{'task_data'}->{'snmp_auth_method'};
# AuthKey.
$macros->{'10'}->{'value'} = $self->{'task_data'}->{'snmp_auth_pass'};
# PrivProtocol.
$macros->{'11'}->{'value'} = $self->{'task_data'}->{'snmp_privacy_method'};
# PrivKey.
$macros->{'12'}->{'value'} = $self->{'task_data'}->{'snmp_privacy_pass'};
# Hash identifier.
$macros->{'13'}->{'value'} = PandoraFMS::Tools::generate_agent_name_hash($if_name, $device);
# Get input usage.
$macros->{'14'}->{'value'} = 0;
# Get output usage.
$macros->{'15'}->{'value'} = 0;
$self->call(
'add_module',
$device,
{
'id_tipo_modulo' => 1,
'id_modulo' => 4,
'name' => $if_name."_Bandwith",
'descripcion' => safe_input(
'Amount of digital information sent and received from this interface over a particular time',
),
'unit' => '%',
'macros' => p_encode_json($self->{'config'}, $macros),
'id_plugin' => $id_plugin,
'unit' => '%',
'min_warning' => '0',
'max_warning' => '0',
'min_critical' => '85',
'max_critical' => '0',
}
);
# inUsage
# Hash identifier.
$macros->{'13'}->{'value'} = PandoraFMS::Tools::generate_agent_name_hash($if_name, $device);
# Get input usage.
$macros->{'14'}->{'value'} = 1;
# Get output usage.
$macros->{'15'}->{'value'} = 0;
$self->call(
'add_module',
$device,
{
'id_tipo_modulo' => 1,
'id_modulo' => 4,
'name' => $if_name."_inUsage",
'descripcion' => safe_input(
'Bandwidth usage received into this interface over a particular time',
),
'unit' => '%',
'macros' => p_encode_json($self->{'config'}, $macros),
'id_plugin' => $id_plugin,
'unit' => '%',
'min_warning' => '0',
'max_warning' => '0',
'min_critical' => '85',
'max_critical' => '0',
}
);
# OutUsage.
# Hash identifier.
$macros->{'13'}->{'value'} = PandoraFMS::Tools::generate_agent_name_hash($if_name, $device);
# Get input usage.
$macros->{'14'}->{'value'} = 0;
# Get output usage.
$macros->{'15'}->{'value'} = 1;
$self->call(
'add_module',
$device,
{
'id_tipo_modulo' => 1,
'id_modulo' => 4,
'name' => $if_name."_outUsage",
'descripcion' => safe_input(
'Bandwidth usage sent from this interface over a particular time',
),
'unit' => '%',
'macros' => p_encode_json($self->{'config'}, $macros),
'id_plugin' => $id_plugin,
'unit' => '%',
'min_warning' => '0',
'max_warning' => '0',
'min_critical' => '85',
'max_critical' => '0',
}
);
}
} }
} }
@ -1253,9 +1431,13 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
$id_tipo_modulo = get_module_id($self->{'dbh'}, $module->{'type'}) $id_tipo_modulo = get_module_id($self->{'dbh'}, $module->{'type'})
if is_empty($id_tipo_modulo); if is_empty($id_tipo_modulo);
my $description = safe_output($module->{'description'}); my $description = safe_output($module->{'descripcion'});
$description = '' if is_empty($description); $description = '' if is_empty($description);
my $unit = safe_output($module->{'unit'});
$unit = '' if is_empty($unit);
if (is_enabled($module->{'__module_component'})) { if (is_enabled($module->{'__module_component'})) {
# Module from network component. # Module from network component.
delete $module->{'__module_component'}; delete $module->{'__module_component'};
@ -1275,6 +1457,11 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
} else { } else {
# Create module - Direct. # Create module - Direct.
my $name = $module->{'name'}; my $name = $module->{'name'};
my $description = safe_output($module->{'descripcion'});
my $unit = safe_output($module->{'unit'});
$unit = '' if is_empty($unit);
delete $module->{'name'}; delete $module->{'name'};
delete $module->{'description'}; delete $module->{'description'};
$agentmodule_id = pandora_create_module_from_hash( $agentmodule_id = pandora_create_module_from_hash(
@ -1286,7 +1473,8 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
'nombre' => safe_input($name), 'nombre' => safe_input($name),
'descripcion' => safe_input($description), 'descripcion' => safe_input($description),
'id_agente' => $agent_id, 'id_agente' => $agent_id,
'ip_target' => $data->{'agent'}{'direccion'} 'ip_target' => $data->{'agent'}{'direccion'},
'unit' => safe_input($unit)
}, },
$self->{'dbh'} $self->{'dbh'}
); );

View File

@ -33,7 +33,7 @@ use base 'Exporter';
our @ISA = qw(Exporter); 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.762"; my $pandora_version = "7.0NG.763";
my $pandora_build = "220623"; my $pandora_build = "220623";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;

View File

@ -2,8 +2,8 @@
# Pandora FMS Server # Pandora FMS Server
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.762 %define version 7.0NG.763
%define release 220623 %define release 1
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
# Pandora FMS Server # Pandora FMS Server
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.762 %define version 7.0NG.763
%define release 220623 %define release 1
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -8,7 +8,7 @@
# This code is licensed under GPL 2.0 license. # This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.762" PI_VERSION="7.0NG.763"
PI_BUILD="220623" PI_BUILD="220623"
MODE=$1 MODE=$1

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.762 Build 220623"; my $version = "7.0NG.763 Build 220623";
# 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.762 Build 220623"; my $version = "7.0NG.763 Build 220623";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);

0
pandora_server/util/plugin/pandora_snmp_bandwidth.pl Normal file → Executable file
View File