merge develop
This commit is contained in:
commit
ba88dcf3d2
|
@ -421,7 +421,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_unix-7.0NG.noarch.rpm ${PANDORA
|
|||
execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages"
|
||||
|
||||
# Copy gotty utility
|
||||
execute_cmd "wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
||||
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
||||
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
|
||||
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
|
||||
|
||||
|
|
|
@ -14,11 +14,13 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
|
|||
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
||||
|
||||
|
||||
S_VERSION='2022050901'
|
||||
S_VERSION='2022050501'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
|
||||
# define default variables
|
||||
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||
[ "$MYVER" ] || MYVER=57
|
||||
[ "$PHPVER" ] || PHPVER=7
|
||||
[ "$DBHOST" ] || DBHOST=127.0.0.1
|
||||
[ "$DBNAME" ] || DBNAME=pandora
|
||||
[ "$DBUSER" ] || DBUSER=pandora
|
||||
|
@ -202,15 +204,28 @@ fi
|
|||
#Installing wget
|
||||
execute_cmd "dnf install -y wget" "Installing wget"
|
||||
|
||||
#Installing extra repositiries
|
||||
|
||||
#Installing php
|
||||
execute_cmd "dnf module reset -y php " "Disabling standard PHP module"
|
||||
execute_cmd "dnf module install -y php:remi-7.4" "Configuring PHP"
|
||||
if [ "$PHPVER" -ne '8' ] ; then
|
||||
execute_cmd "dnf module install -y php:remi-7.4" "Configuring PHP 7"
|
||||
fi
|
||||
|
||||
if [ "$PHPVER" -eq '8' ] ; then
|
||||
execute_cmd "dnf module install -y php:remi-8.0" "Configuring PHP 8"
|
||||
fi
|
||||
|
||||
# Install percona Database
|
||||
execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
|
||||
#rm -rf /etc/my.cnf
|
||||
execute_cmd "dnf install -y Percona-Server-server-57" "Installing Percona Server"
|
||||
|
||||
if [ "$MYVER" -eq '80' ] ; then
|
||||
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module"
|
||||
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-24" "Installing Percona Server 80"
|
||||
fi
|
||||
|
||||
if [ "$MYVER" -ne '80' ] ; then
|
||||
execute_cmd "dnf install -y Percona-Server-server-57 percona-xtrabackup-24" "Installing Percona Server 57"
|
||||
fi
|
||||
|
||||
|
||||
# Console dependencies
|
||||
console_dependencies=" \
|
||||
|
@ -380,20 +395,31 @@ EO_CONFIG_TMP
|
|||
|
||||
#Configuring Database
|
||||
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
|
||||
execute_cmd "systemctl start mysqld" "Starting database engine"
|
||||
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
|
||||
echo """
|
||||
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!');
|
||||
UNINSTALL PLUGIN validate_password;
|
||||
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$DBROOTPASS');
|
||||
""" | mysql --connect-expired-password -uroot &>> "$LOGFILE"
|
||||
execute_cmd "systemctl start mysqld" "Starting database engine"
|
||||
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
|
||||
if [ "$MYVER" -eq '80' ] ; then
|
||||
echo """
|
||||
SET PASSWORD FOR 'root'@'localhost' = 'Pandor4!';
|
||||
UNINSTALL COMPONENT 'file://component_validate_password';
|
||||
SET PASSWORD FOR 'root'@'localhost' = '$DBROOTPASS';
|
||||
""" | mysql --connect-expired-password -uroot &>> "$LOGFILE"
|
||||
fi
|
||||
|
||||
if [ "$MYVER" -ne '80' ] ; then
|
||||
echo """
|
||||
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!');
|
||||
UNINSTALL PLUGIN validate_password;
|
||||
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$DBROOTPASS');
|
||||
""" | mysql --connect-expired-password -uroot &>> "$LOGFILE"fi
|
||||
fi
|
||||
fi
|
||||
export MYSQL_PWD=$DBROOTPASS
|
||||
echo -en "${cyan}Creating Pandora FMS database...${reset}"
|
||||
echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST
|
||||
check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support."
|
||||
|
||||
echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%' identified by \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST
|
||||
echo "CREATE USER \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -uroot -P$DBPORT -h$DBHOST
|
||||
echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -uroot -P$DBPORT -h$DBHOST
|
||||
export MYSQL_PWD=$DBPASS
|
||||
|
||||
#Generating my.cnf
|
||||
|
@ -441,6 +467,10 @@ pid-file=/var/run/mysqld/mysqld.pid
|
|||
|
||||
EO_CONFIG_F
|
||||
|
||||
if [ "$MYVER" -eq '80' ] ; then
|
||||
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
|
||||
fi
|
||||
|
||||
execute_cmd "systemctl restart mysqld" "Configuring database engine"
|
||||
|
||||
|
||||
|
@ -464,7 +494,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_unix-7.0NG.noarch.rpm ${PANDORA
|
|||
execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages"
|
||||
|
||||
# Copy gotty utility
|
||||
execute_cmd "wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
||||
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
||||
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
|
||||
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, AIX version
|
||||
# Version 7.0NG.762, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, FreeBSD Version
|
||||
# Version 7.0NG.762, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, HP-UX Version
|
||||
# Version 7.0NG.762, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, GNU/Linux
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, GNU/Linux
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, Solaris Version
|
||||
# Version 7.0NG.762, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.761
|
||||
# Version 7.0NG.762
|
||||
# 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
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.761, AIX version
|
||||
# Version 7.0NG.762, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.761
|
||||
# Version 7.0NG.762
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.761, HPUX Version
|
||||
# Version 7.0NG.762, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761
|
||||
# Version 7.0NG.762
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761
|
||||
# Version 7.0NG.762
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761
|
||||
# Version 7.0NG.762
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.761, Solaris version
|
||||
# Version 7.0NG.762, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, AIX version
|
||||
# Version 7.0NG.762, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.761-220509
|
||||
Version: 7.0NG.762-220531
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.761-220509"
|
||||
pandora_version="7.0NG.762-220531"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.761"
|
||||
VERSION="7.0NG.762"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.761" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.762" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.761" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.762" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.761</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.761 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.761</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.762</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.762 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.762</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, GNU/Linux
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, FreeBSD Version
|
||||
# Version 7.0NG.762, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, HP-UX Version
|
||||
# Version 7.0NG.762, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, GNU/Linux
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, GNU/Linux
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, NetBSD Version
|
||||
# Version 7.0NG.762, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.761, Solaris Version
|
||||
# Version 7.0NG.762, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1014,8 +1014,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.761';
|
||||
use constant AGENT_BUILD => '220509';
|
||||
use constant AGENT_VERSION => '7.0NG.762';
|
||||
use constant AGENT_BUILD => '220531';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.761
|
||||
%define release 220509
|
||||
%define version 7.0NG.762
|
||||
%define release 220531
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.761
|
||||
%define release 220509
|
||||
%define version 7.0NG.762
|
||||
%define release 220531
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.761"
|
||||
PI_BUILD="220509"
|
||||
PI_VERSION="7.0NG.762"
|
||||
PI_BUILD="220531"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.761
|
||||
# Version 7.0NG.762
|
||||
# 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
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.761}
|
||||
{Pandora FMS Windows Agent v7.0NG.762}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{220509}
|
||||
{220531}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.761 Build 220509")
|
||||
#define PANDORA_VERSION ("7.0NG.762 Build 220531")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.761(Build 220509))"
|
||||
VALUE "ProductVersion", "(7.0NG.762(Build 220531))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.761-220509
|
||||
Version: 7.0NG.762-220531
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.761-220509"
|
||||
pandora_version="7.0NG.762-220531"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
START TRANSACTION;
|
||||
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('lts_name', 'Akira');
|
||||
|
||||
COMMIT;
|
|
@ -31,6 +31,10 @@ if (!$config['MR']) {
|
|||
$config['MR'] = 0;
|
||||
}
|
||||
|
||||
if (isset($config['lts_name']) === false) {
|
||||
$config['lts_name'] = '';
|
||||
}
|
||||
|
||||
echo '<a class="footer"target="_blank" href="'.$config['homeurl'].$license_file.'">';
|
||||
|
||||
require_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
|
@ -46,7 +50,7 @@ if ($current_package === null) {
|
|||
echo __(
|
||||
'%s %s - %s - MR %s',
|
||||
get_product_name(),
|
||||
$pandora_version,
|
||||
$pandora_version.' '.$config['lts_name'],
|
||||
$build_package_version,
|
||||
$config['MR']
|
||||
).'</a><br><span>'.__('Page generated on %s', date('Y-m-d H:i:s')).'</span><br>';
|
||||
|
|
|
@ -256,7 +256,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$ignored_params['refr'] = '';
|
||||
$values = get_refresh_time_array();
|
||||
|
||||
$autorefresh_additional = '<span id="combo_refr" class="invisible">';
|
||||
$autorefresh_additional = '<span id="combo_refr" class="invisible_events">';
|
||||
$autorefresh_additional .= html_print_select(
|
||||
$values,
|
||||
'ref',
|
||||
|
@ -875,9 +875,9 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$('div#head').addClass('fixed_header');
|
||||
$('div#main').css('padding-top', $('div#head').innerHeight() + 'px');
|
||||
}
|
||||
|
||||
|
||||
/* Temporal fix to hide graphics when ui_dialog are displayed */
|
||||
$("#yougotalert").click(function () {
|
||||
$("#yougotalert").click(function () {
|
||||
$("#agent_access").css("display", "none");
|
||||
});
|
||||
$("#ui_close_dialog_titlebar").click(function () {
|
||||
|
@ -912,7 +912,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
|
||||
var autorefresh_draw = '<?php echo $autorefresh_draw; ?>';
|
||||
$("#header_autorefresh").css('padding-right', '5px');
|
||||
if(autorefresh_draw == true) {
|
||||
if(autorefresh_draw == true) {
|
||||
var refresh_interval = parseInt('<?php echo ($config['refr'] * 1000); ?>');
|
||||
var until_time='';
|
||||
|
||||
|
@ -921,7 +921,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
until_time.setTime (until_time.getTime () + parseInt(<?php echo ($config['refr'] * 1000); ?>));
|
||||
|
||||
$("#refrcounter").countdown ({
|
||||
until: until_time,
|
||||
until: until_time,
|
||||
layout: '%M%nn%M:%S%nn%S',
|
||||
labels: ['', '', '', '', '', '', ''],
|
||||
onExpiry: function () {
|
||||
|
@ -936,9 +936,9 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
} else {
|
||||
var refr_time = <?php echo (int) get_parameter('refr', $config['refr']); ?>;
|
||||
var t = new Date();
|
||||
t.setTime (t.getTime () + parseInt(<?php echo ($config['refr'] * 1000); ?>));
|
||||
t.setTime (t.getTime () + parseInt(<?php echo ($config['refr'] * 1000); ?>));
|
||||
$("#refrcounter").countdown ({
|
||||
until: t,
|
||||
until: t,
|
||||
layout: '%M%nn%M:%S%nn%S',
|
||||
labels: ['', '', '', '', '', '', ''],
|
||||
onExpiry: function () {
|
||||
|
@ -957,7 +957,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$("#combo_refr").toggle ();
|
||||
$("select#ref").change (function () {
|
||||
href = $("a.autorefresh").attr ("href");
|
||||
|
||||
|
||||
if(autorefresh_draw == true){
|
||||
inputs = $("#events_form :input");
|
||||
values = {};
|
||||
|
@ -965,17 +965,17 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
values[this.name] = $(this).val();
|
||||
})
|
||||
|
||||
var newValue = btoa(JSON.stringify(values));
|
||||
var newValue = btoa(JSON.stringify(values));
|
||||
<?php
|
||||
// Check if the url has the parameter fb64.
|
||||
if (isset($_GET['fb64']) === true) {
|
||||
$fb64 = $_GET['fb64'];
|
||||
?>
|
||||
var fb64 = '<?php echo $fb64; ?>';
|
||||
var fb64 = '<?php echo $fb64; ?>';
|
||||
// Check if the filters have changed.
|
||||
if(fb64 !== newValue){
|
||||
href = href.replace(fb64, newValue);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).attr("location", href+ '&refr=' + this.value);
|
||||
<?php
|
||||
|
@ -989,7 +989,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$(document).attr ("location", href + this.value);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
|
|
@ -278,11 +278,11 @@ foreach ($sessions as $session) {
|
|||
true
|
||||
).human_time_comparation($session['utimestamp'], 'tiny');
|
||||
$data[3] = $session_ip_origen;
|
||||
$description = str_replace([',', ', '], ', ', $session['descripcion']);
|
||||
$description = io_safe_output(str_replace([',', ', '], ', ', $session['descripcion']));
|
||||
if (strlen($description) > 100) {
|
||||
$data[4] = '<div >'.io_safe_output(substr($description, 0, 150).'...').'</div>';
|
||||
$data[4] = '<div >'.io_safe_input(substr($description, 0, 150)).'...</div>';
|
||||
} else {
|
||||
$data[4] = '<div >'.io_safe_output($description).'</div>';
|
||||
$data[4] = '<div >'.io_safe_input($description).'</div>';
|
||||
}
|
||||
|
||||
array_push($table->data, $data);
|
||||
|
|
|
@ -1156,7 +1156,7 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
|||
);
|
||||
$table_advanced->colspan[16][1] = 6;
|
||||
} else {
|
||||
// Store in a hidden field if is not visible to avoid delete the value
|
||||
// Store in a hidden field if is not visible to avoid delete the value.
|
||||
$table_advanced->data[15][4] .= html_print_input_hidden('id_category', $id_category, true);
|
||||
}
|
||||
|
||||
|
@ -1193,7 +1193,7 @@ if (!$in_policy) {
|
|||
}
|
||||
|
||||
|
||||
// Advanced form part
|
||||
// Advanced form part.
|
||||
$table_macros = new stdClass();
|
||||
$table_macros->id = 'module_macros';
|
||||
$table_macros->width = '100%';
|
||||
|
@ -1398,7 +1398,7 @@ ui_require_jquery_file('json');
|
|||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
$(document).ready (function () {
|
||||
var disabledBecauseInPolicy = <?php echo '\''.(empty($disabledBecauseInPolicy) === true ? '0' : '1').'\''; ?>;
|
||||
var disabledBecauseInPolicy = <?php echo '\''.((empty($disabledBecauseInPolicy) === true) ? '0' : '1').'\''; ?>;
|
||||
$("#right").click (function () {
|
||||
jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) {
|
||||
tag_name = $(value).html();
|
||||
|
@ -1407,12 +1407,16 @@ $(document).ready (function () {
|
|||
$("#id_tag_available").find("option[value='" + tag_name + "']").remove();
|
||||
$("#id_tag_selected").find("option[value='']").remove();
|
||||
if($("#id_tag_available option").length == 0) {
|
||||
$("select[name='id_tag_available[]']").append(value);
|
||||
$("select[name='id_tag_available[]']").append(
|
||||
$("<option></option>").val('').html(
|
||||
'<i><?php echo __('None'); ?></i>'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#left").click (function () {
|
||||
jQuery.each($("select[name='id_tag_selected[]'] option:selected"), function (key, value) {
|
||||
tag_name = $(value).html();
|
||||
|
@ -1422,7 +1426,11 @@ $(document).ready (function () {
|
|||
$("#id_tag_selected").find("option[value='" + id_tag + "']").remove();
|
||||
$("#id_tag_available").find("option[value='']").remove();
|
||||
if($("#id_tag_selected option").length == 0) {
|
||||
$("select[name='id_tag_selected[]']").append(value);
|
||||
$("select[name='id_tag_selected[]']").append(
|
||||
$("<option></option>").val('').html(
|
||||
'<i><?php echo __('None'); ?></i>'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -238,6 +238,9 @@ if ($searchFlag) {
|
|||
}
|
||||
|
||||
$id_agents = array_keys($agents);
|
||||
if (empty($id_agents) === true) {
|
||||
$id_agents[0] = 0;
|
||||
}
|
||||
|
||||
$total = agents_get_alerts_simple(
|
||||
(empty($agent_id) === false) ? ['0' => $agent_id] : $id_agents,
|
||||
|
|
|
@ -1,24 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* Table builder for Servers View.
|
||||
*
|
||||
* @category View
|
||||
* @package Pandora FMS
|
||||
* @subpackage Monitoring.
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Load global vars
|
||||
// Begin.
|
||||
require_once 'include/functions_clippy.php';
|
||||
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AR') === false) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Server Management'
|
||||
|
@ -57,7 +72,6 @@ $table->headstyle[1] = 'text-align:center';
|
|||
$table->headstyle[3] = 'text-align:center';
|
||||
$table->headstyle[8] = 'text-align:right;width: 120px;';
|
||||
|
||||
// $table->title = __('Tactical server information');
|
||||
$table->titleclass = 'tabletitle';
|
||||
$table->titlestyle = 'text-transform:uppercase;';
|
||||
|
||||
|
@ -69,11 +83,11 @@ $table->head[3] = __('Version');
|
|||
$table->head[4] = __('Modules');
|
||||
$table->head[5] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true);
|
||||
$table->head[6] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true);
|
||||
// This will have a column of data such as "6 hours"
|
||||
// This will have a column of data such as "6 hours".
|
||||
$table->head[7] = __('Updated');
|
||||
|
||||
// Only Pandora Administrator can delete servers
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
// Only Pandora Administrator can delete servers.
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$table->head[8] = '<span title="Operations">'.__('Op.').'</span>';
|
||||
}
|
||||
|
||||
|
@ -89,14 +103,14 @@ foreach ($servers as $server) {
|
|||
|
||||
foreach ($servers as $server) {
|
||||
$data = [];
|
||||
// $table->cellclass[][3] = 'progress_bar';
|
||||
|
||||
$table->cellclass[] = [
|
||||
3 => 'progress_bar',
|
||||
8 => 'action_buttons',
|
||||
];
|
||||
$data[0] = '<span title="'.$server['version'].'">'.strip_tags($server['name']).'</span>';
|
||||
|
||||
// Status
|
||||
// Status.
|
||||
$data[1] = ui_print_status_image(STATUS_SERVER_OK, '', true);
|
||||
if ($server['status'] == -1) {
|
||||
$data[1] = ui_print_status_image(
|
||||
|
@ -104,7 +118,7 @@ foreach ($servers as $server) {
|
|||
__('Server has crashed.'),
|
||||
true
|
||||
);
|
||||
} else if (($server['status'] == 0)
|
||||
} else if ((int) ($server['status'] === 0)
|
||||
|| (($date - time_w_fixed_tz($server['keepalive'])) > ($server['server_keepalive']) * 2)
|
||||
) {
|
||||
$data[1] = ui_print_status_image(
|
||||
|
@ -114,13 +128,13 @@ foreach ($servers as $server) {
|
|||
);
|
||||
}
|
||||
|
||||
// Type
|
||||
// Type.
|
||||
$data[2] = '<span class="nowrap">'.$server['img'];
|
||||
if ($server['master'] == $master) {
|
||||
$data[2] .= ui_print_help_tip(__('This is a master server'), true);
|
||||
}
|
||||
|
||||
if ($server['exec_proxy'] == 1) {
|
||||
if ((int) $server['exec_proxy'] === 1) {
|
||||
$data[2] .= html_print_image('images/star.png', true, ['title' => __('Exec server enabled')]);
|
||||
}
|
||||
|
||||
|
@ -169,11 +183,11 @@ foreach ($servers as $server) {
|
|||
}
|
||||
}
|
||||
|
||||
// Only Pandora Administrator can delete servers
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
// Only Pandora Administrator can delete servers.
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$data[8] = '';
|
||||
|
||||
if ($server['type'] == 'recon') {
|
||||
if ($server['type'] === 'recon') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/first_task/icono_grande_reconserver.png',
|
||||
|
@ -188,7 +202,7 @@ foreach ($servers as $server) {
|
|||
$data[8] .= '</a>';
|
||||
}
|
||||
|
||||
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] .= html_print_image(
|
||||
'images/target.png',
|
||||
|
@ -199,7 +213,7 @@ foreach ($servers as $server) {
|
|||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
} 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] .= html_print_image(
|
||||
'images/target.png',
|
||||
|
@ -223,7 +237,7 @@ foreach ($servers as $server) {
|
|||
);
|
||||
$data[8] .= '</a>';
|
||||
|
||||
if (($names_servers[$safe_server_name] === true) && ($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) {
|
||||
if (($names_servers[$safe_server_name] === true) && ($server['type'] === 'data' || $server['type'] === 'enterprise satellite')) {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/remote_configuration.png',
|
||||
|
|
|
@ -63,7 +63,7 @@ if (empty($directory) === true) {
|
|||
|
||||
$real_directory = realpath($config['homedir'].'/'.$directory);
|
||||
|
||||
echo '<h4>'.__('Index of %s', $directory).'</h4>';
|
||||
echo '<h4>'.__('Index of %s', io_safe_input($directory)).'</h4>';
|
||||
|
||||
$upload_file = (bool) get_parameter('upload_file');
|
||||
$create_text_file = (bool) get_parameter('create_text_file');
|
||||
|
|
|
@ -1,12 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
* Setup view for Netflow
|
||||
*
|
||||
* @category Setup
|
||||
* @package Pandora FMS
|
||||
* @subpackage Configuration
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -18,6 +26,7 @@
|
|||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
require_once 'include/functions_ui.php';
|
||||
|
@ -26,6 +35,7 @@ check_login();
|
|||
|
||||
$update = (bool) get_parameter('update');
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->border = 0;
|
||||
$table->cellspacing = 3;
|
||||
|
|
|
@ -5,10 +5,11 @@ if ($argv === null) {
|
|||
exit(0);
|
||||
}
|
||||
|
||||
// UMC dependencies.
|
||||
require_once __DIR__.'/vendor/autoload.php';
|
||||
|
||||
chdir(__DIR__.'/../../');
|
||||
|
||||
// UMC dependencies.
|
||||
require_once 'vendor/autoload.php';
|
||||
// Config file.
|
||||
$cnf_file = 'include/config.php';
|
||||
|
||||
if (file_exists($cnf_file) === false) {
|
||||
|
@ -19,9 +20,6 @@ ini_set('display_errors', 1);
|
|||
|
||||
require_once $cnf_file;
|
||||
|
||||
// PandoraFMS dependencies.
|
||||
require_once __DIR__.'/vendor/autoload.php';
|
||||
|
||||
use PandoraFMS\Core\Config;
|
||||
use PandoraFMS\Core\DBMaintainer;
|
||||
|
||||
|
|
|
@ -329,7 +329,7 @@ class AgentWizard extends HTML
|
|||
}
|
||||
}
|
||||
|
||||
if (count($this->datalist) === 1 && $this->targetIp === '') {
|
||||
if (empty($this->datalist) === false && count($this->datalist) === 1 && $this->targetIp === '') {
|
||||
$this->targetIp = $this->datalist[0];
|
||||
}
|
||||
}
|
||||
|
@ -4827,8 +4827,8 @@ class AgentWizard extends HTML
|
|||
// SecurityName.
|
||||
$macros[6]['value'] = $this->authUserV3;
|
||||
|
||||
// SecurityContext.
|
||||
$macros[7]['value'] = $this->community;
|
||||
// SecurityContext. Empty by default.
|
||||
$macros[7]['value'] = '';
|
||||
|
||||
// SecurityLevel.
|
||||
$macros[8]['value'] = $this->securityLevelV3;
|
||||
|
|
|
@ -811,7 +811,7 @@ class Tree
|
|||
}
|
||||
}
|
||||
|
||||
// Counters
|
||||
// Counters.
|
||||
if (empty($agent['counters'])) {
|
||||
$agent['counters'] = [];
|
||||
|
||||
|
@ -824,7 +824,7 @@ class Tree
|
|||
$agent['counters']['alerts'] = isset($agent['fired_count']) ? $agent['fired_count'] : 0;
|
||||
}
|
||||
|
||||
// Status image
|
||||
// Status image.
|
||||
$agent['statusImageHTML'] = agents_tree_view_status_img_ball(
|
||||
$agent['counters']['critical'],
|
||||
$agent['counters']['warning'],
|
||||
|
@ -834,7 +834,14 @@ class Tree
|
|||
$agent['counters']['alerts']
|
||||
);
|
||||
|
||||
// search module recalculate counters
|
||||
$agent['agentStatus'] = -1;
|
||||
if ((bool) $this->filter['show_not_init_agents'] === true) {
|
||||
if ($agent['total_count'] === 0 || $agent['total_count'] === $agent['notinit_count']) {
|
||||
$agent['agentStatus'] = AGENT_STATUS_NOT_INIT;
|
||||
}
|
||||
}
|
||||
|
||||
// Search module recalculate counters.
|
||||
if (array_key_exists('state_normal', $agent)) {
|
||||
$agent['counters']['unknown'] = $agent['state_unknown'];
|
||||
$agent['counters']['critical'] = $agent['state_critical'];
|
||||
|
@ -935,7 +942,8 @@ class Tree
|
|||
foreach ($agents as $iterator => $agent) {
|
||||
$this->processAgent($agents[$iterator], $server);
|
||||
if ($agents[$iterator]['counters']['total'] !== '0'
|
||||
|| (bool) $this->filter['show_not_init_agents'] === true
|
||||
|| ((bool) $this->filter['show_not_init_agents'] === true
|
||||
&& $agents[$iterator]['agentStatus'] === AGENT_STATUS_NOT_INIT)
|
||||
) {
|
||||
$agents_aux[] = $agents[$iterator];
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC220509';
|
||||
$pandora_version = 'v7.0NG.761';
|
||||
$build_version = 'PC220531';
|
||||
$pandora_version = 'v7.0NG.762';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
|
|
@ -3236,8 +3236,8 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
|
|||
$ni_by_agents = [];
|
||||
foreach ($agents as $agent) {
|
||||
$agent_id = (isset($agent['id_agente'])) ? $agent['id_agente'] : $agent;
|
||||
$agent_group_id = (isset($agent['id_grupo']) === true) ? $agent['id_grupo'] : '';
|
||||
$agent_name = (isset($agent['alias']) === true) ? $agent['alias'] : '';
|
||||
$agent_group_id = (isset($agent['id_grupo']) === true) ? $agent['id_grupo'] : agents_get_agent_group($agent_id);
|
||||
$agent_name = (isset($agent['alias']) === true) ? $agent['alias'] : agents_get_alias($agent_id);
|
||||
$agent_interfaces = [];
|
||||
|
||||
$accepted_module_types = [];
|
||||
|
|
|
@ -556,7 +556,7 @@ function config_update_config()
|
|||
$error_update[] = __('Autocreate profile group');
|
||||
}
|
||||
|
||||
if (config_update_value('default_assign_tags', implode(',', get_parameter('default_assign_tags')), true) === false) {
|
||||
if (config_update_value('default_assign_tags', implode(',', get_parameter('default_assign_tags', [])), true) === false) {
|
||||
$error_update[] = __('Autocreate profile tags');
|
||||
}
|
||||
|
||||
|
|
|
@ -670,16 +670,16 @@ function filemanager_file_explorer(
|
|||
}
|
||||
|
||||
if ($fileinfo['is_dir']) {
|
||||
$data[1] = '<a href="'.$url.'&directory='.$relative_directory.'/'.$fileinfo['name'].'&hash2='.md5($relative_directory.'/'.$fileinfo['name'].$config['server_unique_identifier']).'">'.$fileinfo['name'].'</a>';
|
||||
$data[1] = '<a href="'.$url.'&directory='.$relative_directory.'/'.io_safe_input($fileinfo['name']).'&hash2='.md5($relative_directory.'/'.$fileinfo['name'].$config['server_unique_identifier']).'">'.io_safe_input($fileinfo['name']).'</a>';
|
||||
} else if (empty($url_file) === false) {
|
||||
// Set the custom url file.
|
||||
$url_file_clean = str_replace('[FILE_FULLPATH]', $fileinfo['realpath'], $url_file);
|
||||
|
||||
$data[1] = '<a href="'.$url_file_clean.'">'.$fileinfo['name'].'</a>';
|
||||
$data[1] = '<a href="'.$url_file_clean.'">'.io_safe_input($fileinfo['name']).'</a>';
|
||||
} else {
|
||||
$filename = base64_encode($relative_directory.'/'.$fileinfo['name']);
|
||||
$hash = md5($filename.$config['server_unique_identifier']);
|
||||
$data[1] = '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'">'.$fileinfo['name'].'</a>';
|
||||
$data[1] = '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'">'.io_safe_input($fileinfo['name']).'</a>';
|
||||
}
|
||||
|
||||
// Notice that uploaded php files could be dangerous.
|
||||
|
|
|
@ -2455,6 +2455,8 @@ function pandoraFlotArea(
|
|||
number_format(value[x].max, 0, unit, short_data, divisor) +
|
||||
" Avg: " +
|
||||
number_format(value[x].avg, 0, unit, short_data, divisor);
|
||||
} else {
|
||||
data_legend[index] = " Min: " + 0 + " Max: " + 0 + " Avg: " + 0;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -846,6 +846,10 @@ function add_macro_field(macro, row_model_id, type_copy, k) {
|
|||
|
||||
// Change attributes to be unique and with identificable class
|
||||
$macro_field.attr("id", row_id);
|
||||
$macro_field
|
||||
.find("input")
|
||||
.first()
|
||||
.attr("name", macro_macro);
|
||||
|
||||
$macro_field.attr("class", "macro_field");
|
||||
|
||||
|
|
|
@ -454,11 +454,38 @@ class TopNWidget extends Widget
|
|||
}
|
||||
|
||||
$data_hbar = [];
|
||||
$valueMax = 0;
|
||||
$valueMin = 0;
|
||||
$booleanModulesCount = 0;
|
||||
$booleanModulesTypes = [
|
||||
2,
|
||||
6,
|
||||
9,
|
||||
18,
|
||||
35,
|
||||
];
|
||||
|
||||
foreach ($modules as $module) {
|
||||
$module['aliasAgent'] = ui_print_truncate_text($module['aliasAgent'], 20);
|
||||
$item_name = '';
|
||||
$item_name = $module['aliasAgent'].' - '.$module['nameModule'];
|
||||
$data_hbar[$item_name]['g'] = $module[$display];
|
||||
// Calculation of max-min values for show in graph.
|
||||
$calc = (ceil((5 * (float) $module[$display]) / 100) + $module[$display]);
|
||||
// Set of max-min values for graph.
|
||||
$valueMax = ((int) $module[$display] >= $valueMax) ? $calc : (int) $valueMax;
|
||||
$valueMin = ((int) $module[$display] < $valueMin) ? $calc : (int) $valueMin;
|
||||
// Count if all modules are booleans (for visual representation).
|
||||
if (in_array($module['type_module'], $booleanModulesTypes) === true) {
|
||||
$booleanModulesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($booleanModulesCount === count($modules)) {
|
||||
// All modules are booleans. By this, only are allowed 0 or 1.
|
||||
$valueMax = 1;
|
||||
} else if ((int) $valueMax === (int) $valueMin) {
|
||||
// This change is for get more space between values.
|
||||
$valueMax += 10;
|
||||
}
|
||||
|
||||
$height = (count($data_hbar) * 25 + 35);
|
||||
|
@ -480,7 +507,9 @@ class TopNWidget extends Widget
|
|||
1,
|
||||
$config['homeurl'],
|
||||
'white',
|
||||
'black'
|
||||
'#DFDFDF',
|
||||
$valueMin,
|
||||
$valueMax
|
||||
);
|
||||
$output .= '</div>';
|
||||
|
||||
|
|
|
@ -704,14 +704,19 @@ class Module extends Entity
|
|||
return false;
|
||||
}
|
||||
|
||||
return (bool) \db_process_sql_insert(
|
||||
'talert_template_modules',
|
||||
[
|
||||
'id_agent_module' => $this->id_agente_modulo(),
|
||||
'id_alert_template' => $id_alert_template,
|
||||
'last_reference' => time(),
|
||||
]
|
||||
);
|
||||
$old = $this->alertTemplatesAssigned();
|
||||
if (in_array($id_alert_template, $old) === false) {
|
||||
return (bool) \db_process_sql_insert(
|
||||
'talert_template_modules',
|
||||
[
|
||||
'id_agent_module' => $this->id_agente_modulo(),
|
||||
'id_alert_template' => $id_alert_template,
|
||||
'last_reference' => time(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -759,6 +759,9 @@ select:-internal-list-box {
|
|||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.padding-0 {
|
||||
padding: 0 !important;
|
||||
}
|
||||
.padding-2 {
|
||||
padding: 2em;
|
||||
}
|
||||
|
|
|
@ -128,8 +128,8 @@
|
|||
</div>
|
||||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.761';
|
||||
$build = '220509';
|
||||
$version = '7.0NG.762';
|
||||
$build = '220531';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -552,14 +552,18 @@ function print_table(
|
|||
|
||||
$all_interfaces = [];
|
||||
|
||||
foreach ($data as $value) {
|
||||
$agent_alias = agents_get_alias($value['name']);
|
||||
foreach ($data as $key => $value) {
|
||||
if (empty($value['name']) === false) {
|
||||
$agent_alias = $value['name'];
|
||||
} else {
|
||||
$agent_alias = agents_get_alias($key);
|
||||
}
|
||||
|
||||
foreach ($value['interfaces'] as $if_name => $interface) {
|
||||
$interface['agent_id'] = $value['name'];
|
||||
$interface['agent_id'] = $key;
|
||||
$interface['agent_alias'] = $agent_alias;
|
||||
$interface['if_name'] = $if_name;
|
||||
$all_interfaces[$if_name] = $interface;
|
||||
$all_interfaces[$key][$if_name] = $interface;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -569,117 +573,121 @@ function print_table(
|
|||
) {
|
||||
$filtered_interfaces = $all_interfaces;
|
||||
} else {
|
||||
// Filter interfaces array.
|
||||
$filtered_interfaces = array_filter(
|
||||
$all_interfaces,
|
||||
function ($interface) use ($selected_interfaces) {
|
||||
return in_array(
|
||||
$interface['status_module_id'],
|
||||
$selected_interfaces
|
||||
) === true;
|
||||
}
|
||||
);
|
||||
foreach ($all_interfaces as $key => $value) {
|
||||
// Filter interfaces array.
|
||||
$filtered_interfaces[$key] = array_filter(
|
||||
$value,
|
||||
function ($interface) use ($selected_interfaces) {
|
||||
return in_array(
|
||||
$interface['status_module_id'],
|
||||
$selected_interfaces
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
||||
foreach ($filtered_interfaces as $if_name => $agent_interfaces) {
|
||||
// Get usage modules.
|
||||
$usage_module_in = db_get_row(
|
||||
'tagente_modulo',
|
||||
'nombre',
|
||||
$if_name.'_inUsage'
|
||||
);
|
||||
$usage_module_out = db_get_row(
|
||||
'tagente_modulo',
|
||||
'nombre',
|
||||
$if_name.'_outUsage'
|
||||
);
|
||||
foreach ($filtered_interfaces as $interfaces) {
|
||||
foreach ($interfaces as $if_name => $agent_interfaces) {
|
||||
// Get usage modules.
|
||||
$usage_module_in = db_get_row(
|
||||
'tagente_modulo',
|
||||
'nombre',
|
||||
$if_name.'_inUsage'
|
||||
);
|
||||
$usage_module_out = db_get_row(
|
||||
'tagente_modulo',
|
||||
'nombre',
|
||||
$if_name.'_outUsage'
|
||||
);
|
||||
|
||||
$usage_module_id_in = $usage_module_in['id_agente_modulo'];
|
||||
$usage_module_id_out = $usage_module_out['id_agente_modulo'];
|
||||
$usage_module_description = $usage_module_in['descripcion'];
|
||||
$usage_module_id_in = $usage_module_in['id_agente_modulo'];
|
||||
$usage_module_id_out = $usage_module_out['id_agente_modulo'];
|
||||
$usage_module_description = $usage_module_in['descripcion'];
|
||||
|
||||
// Get usage modules data.
|
||||
$usage_module_data_in = modules_get_previous_data(
|
||||
$usage_module_id_in,
|
||||
time()
|
||||
);
|
||||
// Get usage modules data.
|
||||
$usage_module_data_in = modules_get_previous_data(
|
||||
$usage_module_id_in,
|
||||
time()
|
||||
);
|
||||
|
||||
$usage_module_data_out = modules_get_previous_data(
|
||||
$usage_module_id_out,
|
||||
time()
|
||||
);
|
||||
$usage_module_data_out = modules_get_previous_data(
|
||||
$usage_module_id_out,
|
||||
time()
|
||||
);
|
||||
|
||||
// Extract ifSpeed from description of usage module.
|
||||
$if_speed_str = strstr($usage_module_description, 'Speed:');
|
||||
$if_speed_str = substr($if_speed_str, 0, -1);
|
||||
$if_speed_str = explode(':', $if_speed_str)[1];
|
||||
// Extract ifSpeed from description of usage module.
|
||||
$if_speed_str = strstr($usage_module_description, 'Speed:');
|
||||
$if_speed_str = substr($if_speed_str, 0, -1);
|
||||
$if_speed_str = explode(':', $if_speed_str)[1];
|
||||
|
||||
$matches = [];
|
||||
preg_match_all('/\d+/', $if_speed_str, $matches);
|
||||
$matches = [];
|
||||
preg_match_all('/\d+/', $if_speed_str, $matches);
|
||||
|
||||
$if_speed_value = $matches[0][0];
|
||||
$if_speed_value = $matches[0][0];
|
||||
|
||||
// Transform ifSpeed unit.
|
||||
$divisor = 1000;
|
||||
$counter = 0;
|
||||
while ($if_speed_value >= $divisor) {
|
||||
if ($if_speed_value >= $divisor) {
|
||||
$if_speed_value = ($if_speed_value / $divisor);
|
||||
// Transform ifSpeed unit.
|
||||
$divisor = 1000;
|
||||
$counter = 0;
|
||||
while ($if_speed_value >= $divisor) {
|
||||
if ($if_speed_value >= $divisor) {
|
||||
$if_speed_value = ($if_speed_value / $divisor);
|
||||
}
|
||||
|
||||
$counter++;
|
||||
}
|
||||
|
||||
$counter++;
|
||||
$if_speed_unit = 'bps';
|
||||
|
||||
switch ($counter) {
|
||||
case 1:
|
||||
$if_speed_unit = 'Kbps';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$if_speed_unit = 'Mbps';
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$if_speed_unit = 'Gbps';
|
||||
break;
|
||||
|
||||
case 4:
|
||||
$if_speed_unit = 'Tbps';
|
||||
break;
|
||||
|
||||
default:
|
||||
$if_speed_unit = 'bps';
|
||||
break;
|
||||
}
|
||||
|
||||
// Get in and out traffic.
|
||||
$ifInOctets = modules_get_previous_data(
|
||||
$agent_interfaces['traffic']['in'],
|
||||
time()
|
||||
);
|
||||
$ifOutOctets = modules_get_previous_data(
|
||||
$agent_interfaces['traffic']['out'],
|
||||
time()
|
||||
);
|
||||
|
||||
if ($sec === 'view') {
|
||||
$table_data[$loop_index]['if_agent_name'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$agent_interfaces['agent_id'].'">'.$agent_interfaces['agent_alias'].'</a>';
|
||||
}
|
||||
|
||||
$table_data[$loop_index]['if_name'] = $agent_interfaces['if_name'];
|
||||
$table_data[$loop_index]['if_status_image'] = $agent_interfaces['status_image'];
|
||||
$table_data[$loop_index]['if_speed_data'] = ($if_speed_value === null) ? __('N/A') : $if_speed_value.' '.$if_speed_unit;
|
||||
$table_data[$loop_index]['if_in_octets'] = ($ifInOctets['datos'] === null) ? __('N/A') : $ifInOctets['datos'];
|
||||
$table_data[$loop_index]['if_out_octets'] = ($ifOutOctets['datos'] === null) ? __('N/A') : $ifOutOctets['datos'];
|
||||
$table_data[$loop_index]['if_usage_module_data_in'] = ($usage_module_data_in['datos'] === null) ? __('N/A') : $usage_module_data_in['datos'];
|
||||
$table_data[$loop_index]['if_usage_module_data_out'] = ($usage_module_data_out['datos'] === null) ? __('N/A') : $usage_module_data_out['datos'];
|
||||
$table_data[$loop_index]['if_last_data'] = human_time_comparation($agent_interfaces['last_contact']);
|
||||
|
||||
$loop_index++;
|
||||
}
|
||||
|
||||
$if_speed_unit = 'bps';
|
||||
|
||||
switch ($counter) {
|
||||
case 1:
|
||||
$if_speed_unit = 'Kbps';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$if_speed_unit = 'Mbps';
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$if_speed_unit = 'Gbps';
|
||||
break;
|
||||
|
||||
case 4:
|
||||
$if_speed_unit = 'Tbps';
|
||||
break;
|
||||
|
||||
default:
|
||||
$if_speed_unit = 'bps';
|
||||
break;
|
||||
}
|
||||
|
||||
// Get in and out traffic.
|
||||
$ifInOctets = modules_get_previous_data(
|
||||
$agent_interfaces['traffic']['in'],
|
||||
time()
|
||||
);
|
||||
$ifOutOctets = modules_get_previous_data(
|
||||
$agent_interfaces['traffic']['out'],
|
||||
time()
|
||||
);
|
||||
|
||||
if ($sec === 'view') {
|
||||
$table_data[$loop_index]['if_agent_name'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$agent_interfaces['agent_id'].'">'.$agent_interfaces['agent_alias'].'</a>';
|
||||
}
|
||||
|
||||
$table_data[$loop_index]['if_name'] = $agent_interfaces['if_name'];
|
||||
$table_data[$loop_index]['if_status_image'] = $agent_interfaces['status_image'];
|
||||
$table_data[$loop_index]['if_speed_data'] = ($if_speed_value === null) ? __('N/A') : $if_speed_value.' '.$if_speed_unit;
|
||||
$table_data[$loop_index]['if_in_octets'] = ($ifInOctets['datos'] === null) ? __('N/A') : $ifInOctets['datos'];
|
||||
$table_data[$loop_index]['if_out_octets'] = ($ifOutOctets['datos'] === null) ? __('N/A') : $ifOutOctets['datos'];
|
||||
$table_data[$loop_index]['if_usage_module_data_in'] = ($usage_module_data_in['datos'] === null) ? __('N/A') : $usage_module_data_in['datos'];
|
||||
$table_data[$loop_index]['if_usage_module_data_out'] = ($usage_module_data_out['datos'] === null) ? __('N/A') : $usage_module_data_out['datos'];
|
||||
$table_data[$loop_index]['if_last_data'] = human_time_comparation($agent_interfaces['last_contact']);
|
||||
|
||||
$loop_index++;
|
||||
}
|
||||
|
||||
// Sort array of previously processed table values.
|
||||
|
|
|
@ -117,11 +117,13 @@ ui_print_message_dialog(
|
|||
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../include/styles/js/jquery-ui.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../include/styles/js/jquery-ui_custom.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../include/styles/select2.min.css" type="text/css" />
|
||||
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/pandora_ui.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/jquery-ui.min.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/select2.min.js'></script>
|
||||
<?php
|
||||
require_once $config['homedir'].'/include/graphs/functions_flot.php';
|
||||
echo include_javascript_dependencies_flot_graph(true, '../');
|
||||
|
|
|
@ -241,10 +241,10 @@ if ($is_admin) {
|
|||
}
|
||||
|
||||
$out = '<table cellpadding=0 cellspacing=0 class="databox pies mrgn_top_15px" width=100%><tr><td>';
|
||||
$out .= '<fieldset class="databox tactical_set" id="total_event_graph">
|
||||
$out .= '<fieldset class="padding-0 databox tactical_set" id="total_event_graph">
|
||||
<legend>'.__('Event graph').'</legend>'.html_print_image('images/spinner.gif', true, ['id' => 'spinner_total_event_graph']).'</fieldset>';
|
||||
$out .= '</td><td>';
|
||||
$out .= '<fieldset class="databox tactical_set" id="graphic_event_group">
|
||||
$out .= '<fieldset class="padding-0 databox tactical_set" id="graphic_event_group">
|
||||
<legend>'.__('Event graph by agent').'</legend>'.html_print_image('images/spinner.gif', true, ['id' => 'spinner_graphic_event_group']).'</fieldset>';
|
||||
$out .= '</td></tr></table>';
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.761
|
||||
%define release 220509
|
||||
%define version 7.0NG.762
|
||||
%define release 220531
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.761
|
||||
%define release 220509
|
||||
%define version 7.0NG.762
|
||||
%define release 220531
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.761
|
||||
%define release 220509
|
||||
%define version 7.0NG.762
|
||||
%define release 220531
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.761"
|
||||
PI_VERSION="7.0NG.762"
|
||||
FORCE=0
|
||||
DESTDIR=""
|
||||
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`
|
||||
|
|
|
@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
|
||||
('custom_report_front_header', ''),
|
||||
('custom_report_front_footer', ''),
|
||||
('MR', 53),
|
||||
('MR', 54),
|
||||
('identification_reminder', 1),
|
||||
('identification_reminder_timestamp', 0),
|
||||
('current_package', 761),
|
||||
('current_package', 762),
|
||||
('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.00097656250000":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'),
|
||||
('custom_docs_logo', 'default_docs.png'),
|
||||
('custom_support_logo', 'default_support.png'),
|
||||
|
@ -142,7 +142,8 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||
('sample_agent', '0'),
|
||||
('gotty', '/usr/bin/gotty'),
|
||||
('custom_module_units', '{"bytes":"bytes","entries":"entries","files":"files","hits":"hits","sessions":"sessions","users":"users","ºC":"ºC","ºF":"ºF"}'),
|
||||
('server_unique_identifier', replace(uuid(),'-',''));
|
||||
('server_unique_identifier', replace(uuid(),'-','')),
|
||||
('lts_name', 'Akira');
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
|
|
|
@ -469,15 +469,21 @@ sub parse_log ($$$$$$$$) {
|
|||
# Go to starting position
|
||||
seek(LOGFILE, $Idx_pos, 0);
|
||||
|
||||
$buffer .= "<module>\n";
|
||||
$buffer .= "<name><![CDATA[" . $Module_name . "]]></name>\n";
|
||||
$buffer .= "<description><![CDATA[" . $Description . "]]></description>\n";
|
||||
|
||||
if ($type eq "return_ocurrences"){
|
||||
$buffer .= "<type>generic_data</type>\n";
|
||||
if ($type eq "log_module"){
|
||||
$buffer = "<log_module>\n";
|
||||
$buffer .= "<source><![CDATA[" . $Module_name . "]]></source>\n";
|
||||
$buffer .= "<data><![CDATA[";
|
||||
} else {
|
||||
$buffer .= "<type><![CDATA[async_string]]></type>\n";
|
||||
$buffer .= "<datalist>\n";
|
||||
$buffer .= "<module>\n";
|
||||
$buffer .= "<name><![CDATA[" . $Module_name . "]]></name>\n";
|
||||
$buffer .= "<description><![CDATA[" . $Description . "]]></description>\n";
|
||||
|
||||
if ($type eq "return_ocurrences"){
|
||||
$buffer .= "<type>generic_data</type>\n";
|
||||
} else {
|
||||
$buffer .= "<type><![CDATA[async_string]]></type>\n";
|
||||
$buffer .= "<datalist>\n";
|
||||
}
|
||||
}
|
||||
|
||||
while ($line = <LOGFILE>) {
|
||||
|
@ -503,6 +509,11 @@ sub parse_log ($$$$$$$$) {
|
|||
$buffer .= "<data><value><![CDATA[".$line."]]></value></data>\n";
|
||||
}
|
||||
|
||||
if ($type eq "log_module") {
|
||||
$line =~ s/\]\]/]]]]><![CDATA[/g;
|
||||
$buffer .= $line."\n";
|
||||
}
|
||||
|
||||
# Critical severity will prevail over other matches
|
||||
if ($severity eq ""){
|
||||
$severity = $value->{"severity"};
|
||||
|
@ -515,11 +526,12 @@ sub parse_log ($$$$$$$$) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($type eq "return_ocurrences"){
|
||||
$buffer .= "<data><![CDATA[".$count."]]></data>\n";
|
||||
} else {
|
||||
$buffer .= "</datalist>\n";
|
||||
if ($type ne "log_module"){
|
||||
if ($type eq "return_ocurrences"){
|
||||
$buffer .= "<data><![CDATA[".$count."]]></data>\n";
|
||||
} else {
|
||||
$buffer .= "</datalist>\n";
|
||||
}
|
||||
}
|
||||
|
||||
# Execute action if any match (always for last match)
|
||||
|
@ -527,13 +539,18 @@ sub parse_log ($$$$$$$$) {
|
|||
`$action`;
|
||||
}
|
||||
|
||||
# Write severity field in XML
|
||||
if ($severity ne ""){
|
||||
$buffer .= "<status>$severity</status>\n";
|
||||
}
|
||||
if ($type ne "log_module"){
|
||||
# Write severity field in XML
|
||||
if ($severity ne ""){
|
||||
$buffer .= "<status>$severity</status>\n";
|
||||
}
|
||||
|
||||
# End XML
|
||||
$buffer .= "</module>\n";
|
||||
# End XML
|
||||
$buffer .= "</module>\n";
|
||||
}else {
|
||||
$buffer .= "]]></data>\n";
|
||||
$buffer .= "</log_module>\n";
|
||||
}
|
||||
|
||||
# Update Index
|
||||
$Idx_pos = tell(LOGFILE);
|
||||
|
@ -746,4 +763,4 @@ while (my ($key, $value) = each (@{$plugin_setup{"log"}})) {
|
|||
|
||||
print "\n";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.761-220509
|
||||
Version: 7.0NG.762-220531
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.761-220509"
|
||||
pandora_version="7.0NG.762-220531"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#############################################################################
|
||||
# Pandora FMS Server Parameters
|
||||
# Pandora FMS, the Flexible Monitoring System.
|
||||
# Version 7.0NG.761
|
||||
# Version 7.0NG.762
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -45,8 +45,8 @@ our @EXPORT = qw(
|
|||
);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.761";
|
||||
my $pandora_build = "220509";
|
||||
my $pandora_version = "7.0NG.762";
|
||||
my $pandora_build = "220531";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -33,8 +33,8 @@ use base 'Exporter';
|
|||
our @ISA = qw(Exporter);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.761";
|
||||
my $pandora_build = "220509";
|
||||
my $pandora_version = "7.0NG.762";
|
||||
my $pandora_build = "220531";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
@ -2206,73 +2206,93 @@ sub snmp_get {
|
|||
'error' => 'snmpwalk not found'
|
||||
};
|
||||
}
|
||||
|
||||
$snmp->{extra} = '' unless defined $snmp->{extra};
|
||||
|
||||
if ( defined ($snmp->{version} )
|
||||
&& (($snmp->{version} eq "1")
|
||||
|| ($snmp->{version} eq "2")
|
||||
|| ($snmp->{version} eq "2c"))) {
|
||||
|
||||
if (defined $snmp->{port}){
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -c $snmp->{community} $snmp->{host}:$snmp->{port} $snmp->{oid}";
|
||||
}
|
||||
else {
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -c $snmp->{community} $snmp->{host} $snmp->{oid}";
|
||||
}
|
||||
|
||||
}
|
||||
elsif ( defined ($snmp->{version} )
|
||||
&& ($snmp->{version} eq "3") ) { # SNMP v3
|
||||
# Authentication required
|
||||
|
||||
# $securityLevel = (noAuthNoPriv|authNoPriv|authPriv);
|
||||
|
||||
# unauthenticated request
|
||||
# Ex. snmpget -r $retries -t $timeout $snmp->{extra} -On -v 3 -n "" -u noAuthUser -l noAuthNoPriv test.net-snmp.org sysUpTime
|
||||
|
||||
# authenticated request
|
||||
# Ex. snmpget -r $retries -t $timeout $snmp->{extra} -On -v 3 -n "" -u MD5User -a MD5 -A "The Net-SNMP Demo Password" -l authNoPriv test.net-snmp.org sysUpTime
|
||||
|
||||
# authenticated and encrypted request
|
||||
# Ex. snmpget -r $retries -t $timeout $snmp->{extra} -On -v 3 -n "" -u MD5DESUser -a MD5 -A "The Net-SNMP Demo Password" -x DES -X "The Net-SNMP Demo Password" -l authPriv test.net-snmp.org system
|
||||
|
||||
if ($snmp->{securityLevel} =~ /^noAuthNoPriv$/i){
|
||||
# Unauthenticated request
|
||||
|
||||
if (defined $snmp->{port}){
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -l $snmp->{securityLevel} $snmp->{host}:$snmp->{port} $snmp->{oid}";
|
||||
}
|
||||
else {
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -l $snmp->{securityLevel} $snmp->{host} $snmp->{oid}";
|
||||
}
|
||||
}
|
||||
elsif ($snmp->{securityLevel} =~ /^authNoPriv$/i){
|
||||
# Authenticated request
|
||||
|
||||
if (defined $snmp->{port}){
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -u $snmp->{securityName} -a $snmp->{authProtocol} -A $snmp->{authKey} -l $snmp->{securityLevel} $snmp->{host}:$snmp->{port} $snmp->{oid}";
|
||||
}
|
||||
else {
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -u $snmp->{securityName} -a $snmp->{authProtocol} -A $snmp->{authKey} -l $snmp->{securityLevel} $snmp->{host} $snmp->{oid}";
|
||||
}
|
||||
}
|
||||
elsif ($snmp->{securityLevel} =~ /^authPriv$/i){
|
||||
# Authenticated and encrypted request
|
||||
|
||||
if (defined $snmp->{port}){
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -u $snmp->{securityName} -l $snmp->{securityLevel} -a $snmp->{authProtocol} -A $snmp->{authKey} -x $snmp->{privProtocol} -X $snmp->{privKey} $snmp->{host}:$snmp->{port} $snmp->{oid}";
|
||||
}
|
||||
else {
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -u $snmp->{securityName} -l $snmp->{securityLevel} -a $snmp->{authProtocol} -A $snmp->{authKey} -x $snmp->{privProtocol} -X $snmp->{privKey} $snmp->{host} $snmp->{oid}";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!defined $snmp->{version}) {
|
||||
return {
|
||||
error => "Only SNMP 1 2 2c and 3 are supported."
|
||||
'error' => "Only SNMP 1 2 2c and 3 are supported."
|
||||
};
|
||||
} elsif (!defined $snmp->{host}) {
|
||||
return {
|
||||
'error' => "Destination host must be defined."
|
||||
};
|
||||
} elsif (!defined $snmp->{oid}) {
|
||||
return {
|
||||
'error' => "OID must be defined"
|
||||
};
|
||||
} else {
|
||||
$snmp->{extra} = '' unless defined $snmp->{extra};
|
||||
$snmp->{context} = '' unless defined $snmp->{context};
|
||||
$snmp->{community} = 'public' unless defined $snmp->{community};
|
||||
|
||||
if (($snmp->{version} eq "1")
|
||||
|| ($snmp->{version} eq "2")
|
||||
|| ($snmp->{version} eq "2c")) {
|
||||
|
||||
if (defined $snmp->{port}){
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -c $snmp->{community} $snmp->{host}:$snmp->{port} $snmp->{oid}";
|
||||
}
|
||||
else {
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -c $snmp->{community} $snmp->{host} $snmp->{oid}";
|
||||
}
|
||||
|
||||
}
|
||||
elsif ( defined ($snmp->{version} )
|
||||
&& ($snmp->{version} eq "3") ) {
|
||||
|
||||
$snmp->{securityLevel} = '' unless defined $snmp->{securityLevel};
|
||||
|
||||
# SNMP v3
|
||||
# Authentication required
|
||||
|
||||
# $securityLevel = (noAuthNoPriv|authNoPriv|authPriv);
|
||||
|
||||
# unauthenticated request
|
||||
# Ex. snmpget -r $retries -t $timeout $snmp->{extra} -On -v 3 -n "" -u noAuthUser -l noAuthNoPriv test.net-snmp.org sysUpTime
|
||||
|
||||
# authenticated request
|
||||
# Ex. snmpget -r $retries -t $timeout $snmp->{extra} -On -v 3 -n "" -u MD5User -a MD5 -A "The Net-SNMP Demo Password" -l authNoPriv test.net-snmp.org sysUpTime
|
||||
|
||||
# authenticated and encrypted request
|
||||
# Ex. snmpget -r $retries -t $timeout $snmp->{extra} -On -v 3 -n "" -u MD5DESUser -a MD5 -A "The Net-SNMP Demo Password" -x DES -X "The Net-SNMP Demo Password" -l authPriv test.net-snmp.org system
|
||||
|
||||
if ($snmp->{securityLevel} =~ /^noAuthNoPriv$/i){
|
||||
# Unauthenticated request
|
||||
|
||||
if (defined $snmp->{port}){
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -l $snmp->{securityLevel} $snmp->{host}:$snmp->{port} $snmp->{oid}";
|
||||
}
|
||||
else {
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -l $snmp->{securityLevel} $snmp->{host} $snmp->{oid}";
|
||||
}
|
||||
}
|
||||
elsif ($snmp->{securityLevel} =~ /^authNoPriv$/i){
|
||||
# Authenticated request
|
||||
|
||||
if (defined $snmp->{port}){
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -u $snmp->{securityName} -a $snmp->{authProtocol} -A $snmp->{authKey} -l $snmp->{securityLevel} $snmp->{host}:$snmp->{port} $snmp->{oid}";
|
||||
}
|
||||
else {
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -u $snmp->{securityName} -a $snmp->{authProtocol} -A $snmp->{authKey} -l $snmp->{securityLevel} $snmp->{host} $snmp->{oid}";
|
||||
}
|
||||
}
|
||||
elsif ($snmp->{securityLevel} =~ /^authPriv$/i){
|
||||
# Authenticated and encrypted request
|
||||
|
||||
if (defined $snmp->{port}){
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -u $snmp->{securityName} -l $snmp->{securityLevel} -a $snmp->{authProtocol} -A $snmp->{authKey} -x $snmp->{privProtocol} -X $snmp->{privKey} $snmp->{host}:$snmp->{port} $snmp->{oid}";
|
||||
}
|
||||
else {
|
||||
$cmd = "snmpget -r $retries -t $timeout $snmp->{extra} -On -v $snmp->{version} -n \"$snmp->{context}\" -u $snmp->{securityName} -l $snmp->{securityLevel} -a $snmp->{authProtocol} -A $snmp->{authKey} -x $snmp->{privProtocol} -X $snmp->{privKey} $snmp->{host} $snmp->{oid}";
|
||||
}
|
||||
}
|
||||
else {
|
||||
return {
|
||||
'error' => "Security Level not defined."
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#print STDERR "Launched: $cmd\n";
|
||||
my $result = `$cmd`;
|
||||
if ($? != 0) {
|
||||
|
@ -2293,7 +2313,7 @@ sub snmp_data_switcher {
|
|||
|
||||
my $pure_data = trim($st_data[1]) or undef;
|
||||
$data{data} = $pure_data;
|
||||
|
||||
|
||||
if ( uc($st_data[0]) eq uc("INTEGER")) {
|
||||
$data{type} = "generic_data";
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Server
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.761
|
||||
%define release 220509
|
||||
%define version 7.0NG.762
|
||||
%define release 220531
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Server
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.761
|
||||
%define release 220509
|
||||
%define version 7.0NG.762
|
||||
%define release 220531
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.761"
|
||||
PI_BUILD="220509"
|
||||
PI_VERSION="7.0NG.762"
|
||||
PI_BUILD="220531"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
@ -333,7 +333,9 @@ install () {
|
|||
fi
|
||||
# when fakeroot installation, this can fail
|
||||
chown -R pandora:$GROUPNAME $DESTDIR$PANDORA_SPOOL 2>/dev/null
|
||||
|
||||
|
||||
chown apache:$GROUPNAME $DESTDIR$PANDORA_SPOOL/data_in/customer_key 2>/dev/null
|
||||
|
||||
echo "Creating setup directory in $PANDORA_CFG_DIR"
|
||||
mkdir -p $DESTDIR$PANDORA_CFG_DIR 2> /dev/null
|
||||
if [ -f "$DESTDIR$PANDORA_CFG_FILE" ]
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.761 Build 220509";
|
||||
my $version = "7.0NG.762 Build 220531";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.761 Build 220509";
|
||||
my $version = "7.0NG.762 Build 220531";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
|
@ -157,7 +157,7 @@ sub prepare_tree {
|
|||
} else {
|
||||
$snmp_call{'oid'} = $config->{'oid_base'} . $config->{'x86_indexes'}{'__idx__'}.$ifIndex;
|
||||
}
|
||||
|
||||
|
||||
my $raw = snmp_walk(\%snmp_call);
|
||||
return $raw if (ref($raw) eq "HASH");
|
||||
|
||||
|
@ -485,36 +485,39 @@ foreach my $pk (keys %{$_config}) {
|
|||
$config->{$pk} = $_config->{$pk};
|
||||
}
|
||||
}
|
||||
|
||||
# Validate config
|
||||
$config->{'host'} = '127.0.0.1' if empty($config->{'host'});
|
||||
$config->{'port'} = '161' if empty($config->{'port'});
|
||||
$config->{'tmp_separator'} = ';' if empty($config->{'tmp_separator'});
|
||||
$config->{'tmp'} = (($^O =~ /win/)?$ENV{'TMP'}:'/tmp') if empty($config->{'tmp'});
|
||||
|
||||
if(snmp_walk({
|
||||
%{$config},
|
||||
'oid' => '.1.3.6.1.2.1.31.1.1.1.6'
|
||||
})
|
||||
) {
|
||||
# x64 counters available.
|
||||
$config->{'use_x64'} = 1;
|
||||
} else {
|
||||
# x64 counters not available.
|
||||
$config->{'use_x64'} = 1;
|
||||
}
|
||||
|
||||
# Create unique name for tmp and log file for host
|
||||
my $filename = $config->{'tmp'}.'/pandora_bandwith_'.$config->{'host'};
|
||||
|
||||
if (!empty($config->{'uniqid'})) {
|
||||
$filename = $config->{'tmp'}.'/pandora_bandwith_'.$config->{'uniqid'};
|
||||
}
|
||||
|
||||
# Replace every dot for underscore
|
||||
$filename =~ tr/./_/;
|
||||
$config->{'tmp_file'} = $filename.'.idx' if empty($config->{'tmp_file'});
|
||||
$config->{'log'} = $filename.'.log' if empty($config->{'log'});
|
||||
|
||||
# Check snmp connectivity
|
||||
my $sysobjectid = snmp_get({%{$config}, 'oid' => '.1.3.6.1.2.1.1.2.0'});
|
||||
|
||||
if ( defined($sysobjectid->{'error'}) || $sysobjectid->{'data'} eq '' ) {
|
||||
logger($config, 'info', "Failed: connecting snmp protocol: sysobjectid") if (is_enabled($config->{'debug'}));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
# Check SNMP x64 interfaces
|
||||
my $walk64 = snmp_walk({%{$config}, 'oid' => '.1.3.6.1.2.1.31.1.1.1.6'});
|
||||
if ( $walk64 =~ 'No Such Instance currently exists at this OID' || $walk64 =~ 'No more variables left in this MIB View') {
|
||||
$config->{'use_x64'} = 0;
|
||||
} else {
|
||||
$config->{'use_x64'} = 1;
|
||||
}
|
||||
|
||||
|
||||
my @int_exc = split /,/, trim($config->{'interface_exceptions'}) if (!empty($config->{'interface_exceptions'}));
|
||||
if ($#int_exc >= 0) {
|
||||
$config->{'interface_exceptions'} = \@int_exc;
|
||||
|
|
Loading…
Reference in New Issue