Merge remote-tracking branch 'origin/develop' into ent-9735-integrar-plugin-de-inventario-de-solaris-en-agente-unix

This commit is contained in:
alejandro 2023-06-29 16:24:04 +02:00
commit e744e60da3
1303 changed files with 250634 additions and 103878 deletions

View File

@ -1,73 +0,0 @@
Name: xprobe2
Version: 0.3
Release: 2
Summary: Tool to detect OS remotely by TCP/IP fingerprinting
License: GPLv2
Group: Network/Security
URL: http://xprobe.sourceforge.net/
Packager: Sancho Lerena <slerena@gmail.com>
Source: http://dl.sf.net/xprobe/xprobe2-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}
Provides: %{name}-%{version}
Requires: libpcap
BuildRequires: gcc-c++ libpcap-devel
#This is for SUSE build service, to avoid enforce FHS paths
#!BuildIgnore: post-build-checks
%description
Xprobe is an alternative to some tools which are heavily dependent upon the
usage of the TCP protocol for remote active operating system fingerprinting.
Xprobe I combines various remote active operating system fingerprinting methods
using the ICMP protocol, which were discovered during the "ICMP Usage in
Scanning" research project, into a simple, fast, efficient and a powerful way
to detect an underlying operating system a targeted host is using.
Xprobe2 is an active operating system fingerprinting tool with a different
approach to operating system fingerprinting. Xprobe2 rely on fuzzy signature
matching, probabilistic guesses, multiple matches simultaneously, and a
signature database.
%prep
%setup
%build
./configure --with-libpcap-libraries=/usr/lib --with-libpcap-includes=/usr/include/pcap --mandir=%{_mandir} --disable-schemas-install
make
%install
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%post
ln -s /usr/local/bin/xprobe2 /usr/bin
%preun
%postun
%files
%defattr(755,root,root)
/usr/local/etc
/usr/local/etc/xprobe2
%defattr(644,root,root)
%doc AUTHORS CHANGELOG COPYING CREDITS README TODO docs/*
%doc /usr/share/man/man1/xprobe2.1.gz
/usr/local/etc/xprobe2/xprobe2.conf
%defattr(755,root,root)
/usr/local/bin/xprobe2
%changelog
* Fri Dec 18 2009 Sancho Lerena <slerena@gmail.com> 3.2-2
- A lot of changes to be ready for all RPM plattforms available on build.opensuse.org
* Tue Dec 08 2009 Sancho Lerena <slerena@gmail.com> 3.2-1
- First RPM Spec for SUSE Systems, based on CentOS Spec from Dag Wieers

View File

@ -1,62 +0,0 @@
Get the original xprobe2-0.3 from Sourceforge:
http://downloads.sourceforge.net/project/xprobe/xprobe2/Xprobe2%200.3/xprobe2-0.3.tar.gz
Uncompress it under, for example /tmp/xprobe2-0.3 directory
Copy the diff file at /tmp
Execute the patch command:
patch -p1 < ../xprobe2-0.3.diff.patch
This should look like:
patching file CHANGELOG
patching file config.status
patching file configure
patching file libs-external/USI++/src/config.h
patching file libs-external/USI++/src/config.log
patching file libs-external/USI++/src/config.status
patching file libs-external/USI++/src/ip.cc
patching file libs-external/USI++/src/Makefile
patching file libs-external/USI++/src/misc.cc
patching file libs-external/USI++/src/usi++/arp.h
patching file libs-external/USI++/src/usi++/config.h
patching file libs-external/USI++/src/usi++/datalink.h
patching file libs-external/USI++/src/usi++/icmp.h
patching file libs-external/USI++/src/usi++/if.h
patching file libs-external/USI++/src/usi++/ip.h
patching file libs-external/USI++/src/usi++/Layer2.h
patching file libs-external/USI++/src/usi++/README
patching file libs-external/USI++/src/usi++/RX.h
patching file libs-external/USI++/src/usi++/tcp.h
patching file libs-external/USI++/src/usi++/TX.h
patching file libs-external/USI++/src/usi++/TX_IP.h
patching file libs-external/USI++/src/usi++/udp.h
patching file libs-external/USI++/src/usi++/usi++
patching file libs-external/USI++/src/usi++/usi++.h
patching file libs-external/USI++/src/usi++/usi-structs.h
patching file libs-external/USI++/usi++/config.h
patching file libs-external/USI++/usi++/tcp.h
patching file Makefile
patching file src/config.h
patching file src/defines.h
patching file src/Makefile
patching file src/xplib/Makefile
patching file src/xpmodules/alive_probe/Makefile
patching file src/xpmodules/alive_probe/portscanner/Makefile
patching file src/xpmodules/alive_probe/ttl_calc/Makefile
patching file src/xpmodules/Makefile
patching file src/xpmodules/os_probe/icmp_addrmask/Makefile
patching file src/xpmodules/os_probe/icmp_echo_id/Makefile
patching file src/xpmodules/os_probe/icmp_inforeq/Makefile
patching file src/xpmodules/os_probe/icmp_port_unreach/Makefile
patching file src/xpmodules/os_probe/icmp_timestamp/Makefile
patching file src/xpmodules/os_probe/Makefile
patching file src/xpmodules/os_probe/smb/Makefile
patching file src/xpmodules/os_probe/snmp/Makefile
patching file src/xpmodules/os_probe/tcp_handshake/Makefile
patching file src/xpmodules/os_probe/tcp_rst/Makefile
Your patched code is now ready to be used.

View File

@ -15,7 +15,7 @@ LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
# define default variables # define default variables
[ "$TZ" ] || TZ="Europe/Madrid" [ "$TZ" ] || TZ="Europe/Madrid"
[ "$MYVER" ] || MYVER=57 [ "$MYVER" ] || MYVER=80
[ "$DBHOST" ] || DBHOST=127.0.0.1 [ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora [ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora [ "$DBUSER" ] || DBUSER=pandora
@ -27,6 +27,7 @@ LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0 [ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g") [ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
# Ansi color code variables # Ansi color code variables
red="\e[0;91m" red="\e[0;91m"
green="\e[0;92m" green="\e[0;92m"
@ -81,6 +82,10 @@ check_root_permissions () {
## Main ## Main
echo "Starting PandoraFMS External DB deployment EL8 ver. $S_VERSION" echo "Starting PandoraFMS External DB deployment EL8 ver. $S_VERSION"
if ! grep --version &>> $LOGFILE ; then echo 'Error grep is not detected on the system, grep tool is needed for installation.'; exit -1 ;fi
if ! sed --version &>> $LOGFILE ; then echo 'Error grep is not detected on the system, grep tool is needed for installation.'; exit -1 ;fi
# Centos Version # Centos Version
if [ ! "$(grep -Ei 'centos|rocky|Almalinux|Red Hat Enterprise' /etc/redhat-release)" ]; then if [ ! "$(grep -Ei 'centos|rocky|Almalinux|Red Hat Enterprise' /etc/redhat-release)" ]; then
printf "\n ${red}Error this is not a Centos/Rocky/Almalinux Base system, this installer is compatible with RHEL/Almalinux/Centos/Rockylinux systems only${reset}\n" printf "\n ${red}Error this is not a Centos/Rocky/Almalinux Base system, this installer is compatible with RHEL/Almalinux/Centos/Rockylinux systems only${reset}\n"
@ -174,7 +179,7 @@ execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
if [ "$MYVER" -eq '80' ] ; then if [ "$MYVER" -eq '80' ] ; then
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module" execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-24" "Installing Percona Server 80" execute_cmd "dnf install -y percona-server-server percona-xtrabackup-80" "Installing Percona Server 80"
fi fi
if [ "$MYVER" -ne '80' ] ; then if [ "$MYVER" -ne '80' ] ; then

View File

@ -89,6 +89,9 @@ check_root_permissions () {
## Main ## Main
echo "Starting PandoraFMS External DB deployment Ubuntu 22.04 ver. $S_VERSION" echo "Starting PandoraFMS External DB deployment Ubuntu 22.04 ver. $S_VERSION"
if ! grep --version &>> $LOGFILE ; then echo 'Error grep is not detected on the system, grep tool is needed for installation.'; exit -1 ;fi
if ! sed --version &>> $LOGFILE ; then echo 'Error grep is not detected on the system, grep tool is needed for installation.'; exit -1 ;fi
# Ubuntu Version # Ubuntu Version
if [ ! "$(grep -Ei 'Ubuntu' /etc/lsb-release)" ]; then if [ ! "$(grep -Ei 'Ubuntu' /etc/lsb-release)" ]; then
printf "\n ${red}Error this is not a Ubuntu system, this installer is compatible with Ubuntu systems only${reset}\n" printf "\n ${red}Error this is not a Ubuntu system, this installer is compatible with Ubuntu systems only${reset}\n"
@ -155,7 +158,7 @@ execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_
execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8" execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}" echo -en "${cyan}Installing Percona Server for MySQL8...${reset}"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server &>> "$LOGFILE" env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server percona-xtrabackup-80 &>> "$LOGFILE"
check_cmd_status "Error Installing MySql Server" check_cmd_status "Error Installing MySql Server"
#Configuring Database #Configuring Database

View File

@ -1,12 +1,19 @@
#!/bin/bash #!/bin/bash
#export PANDORA_SERVER_IP='newdemos.artica.es' && curl -sSL http://firefly.artica.es/projects/pandora_deploy_agent.sh | bash #export PANDORA_SERVER_IP='newdemos.artica.es' && curl -sSL http://firefly.pandorafms.com/projects/pandora_deploy_agent.sh | bash
# define variables # define variables
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='2022052301' S_VERSION='2023050901'
LOGFILE="/tmp/pandora-agent-deploy-$(date +%F).log" LOGFILE="/tmp/pandora-agent-deploy-$(date +%F).log"
#Check if possible to get os version
if [ ! -e /etc/os-release ]; then
echo ' > Imposible to determinate the OS version for this machine, please make sure you are intalling in a compatible OS'
echo ' > More info: https://pandorafms.com/manual/en/documentation/02_installation/01_installing#minimum_software_requirements'
exit -1
fi
# Ansi color code variables # Ansi color code variables
red="\e[0;91m" red="\e[0;91m"
green="\e[0;92m" green="\e[0;92m"
@ -42,14 +49,14 @@ check_cmd_status () {
echo "Error installing Pandora FMS Agent for detailed error please check log: $LOGFILE" echo "Error installing Pandora FMS Agent for detailed error please check log: $LOGFILE"
rm -rf $HOME/pandora_deploy_tmp/*.rpm* &>> $LOGFILE rm -rf $HOME/pandora_deploy_tmp/*.rpm* &>> $LOGFILE
exit 1 exit 1
else else
echo -e "${green}OK${reset}" echo -e "${green}OK${reset}"
return 0 return 0
fi fi
} }
check_repo_connection () { check_repo_connection () {
execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo" execute_cmd "ping -c 2 firefly.pandorafms.com" "Checking Community repo"
} }
check_root_permissions () { check_root_permissions () {
@ -65,9 +72,15 @@ check_root_permissions () {
fi fi
} }
install_tarball () {
tar xvzf $1
cd unix && ./pandora_agent_installer --install
}
install_autodiscover () { install_autodiscover () {
local arch=$1 local arch=$1
wget http://firefly.artica.es/projects/autodiscover-linux.zip wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip
unzip autodiscover-linux.zip unzip autodiscover-linux.zip
chmod +x $arch/autodiscover chmod +x $arch/autodiscover
mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover
@ -78,6 +91,9 @@ echo "Starting PandoraFMS Agent deployment ver. $S_VERSION"
execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define env variable PANDORA_SERVER_IP' execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define env variable PANDORA_SERVER_IP'
if ! grep --version &>> $LOGFILE ; then echo 'Error grep is not detected on the system, grep tool is needed for installation.'; exit -1 ;fi
if ! sed --version &>> $LOGFILE ; then echo 'Error sed is not detected on the system, sed tool is needed for installation.'; exit -1 ;fi
#Detect OS #Detect OS
os_name=$(grep ^PRETTY_NAME= /etc/os-release | cut -d '=' -f2 | tr -d '"') os_name=$(grep ^PRETTY_NAME= /etc/os-release | cut -d '=' -f2 | tr -d '"')
execute_cmd "echo $os_name" "OS detected: ${os_name}" execute_cmd "echo $os_name" "OS detected: ${os_name}"
@ -142,17 +158,20 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset} echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset}
# Insatall pandora agent # Insatall pandora agent
$package_manager_cmd install -y http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm &>> $LOGFILE $package_manager_cmd install -y http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm &>> $LOGFILE
echo -en "${cyan}Installing Pandora FMS agent...${reset}" echo -en "${cyan}Installing Pandora FMS agent...${reset}"
check_cmd_status 'Error installing Pandora FMS agent' check_cmd_status 'Error installing Pandora FMS agent'
[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
fi fi
if [[ $OS_RELEASE == 'debian' ]]; then if [[ $OS_RELEASE == 'debian' ]]; then
execute_cmd "apt update" 'Updating repos' execute_cmd "apt update" 'Updating repos'
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies' execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
execute_cmd 'wget http://firefly.artica.es/pandorafms/latest/Debian_Ubuntu/pandorafms.agent_linux_7.0NG.deb' 'Downloading Pandora FMS agent dependencies' execute_cmd 'wget http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz' 'Downloading Pandora FMS agent package'
execute_cmd 'apt install -y ./pandorafms.agent_linux_7.0NG.deb' 'Installing Pandora FMS agent' execute_cmd 'install_tarball pandorafms_agent_linux-7.0NG.tar.gz' 'Installing Pandora FMS agent'
[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
cd $HOME/pandora_deploy_tmp
fi fi
# Configuring Agente # Configuring Agente
@ -165,6 +184,7 @@ fi
[[ $PANDORA_AGENT_ALIAS ]] && sed -i "s/^#agent_alias.*$/agent_alias $PANDORA_AGENT_ALIAS/g" $PANDORA_AGENT_CONF [[ $PANDORA_AGENT_ALIAS ]] && sed -i "s/^#agent_alias.*$/agent_alias $PANDORA_AGENT_ALIAS/g" $PANDORA_AGENT_CONF
[[ $PANDORA_SECONDARY_GROUPS ]] && sed -i "s/^# secondary_groups.*$/secondary_groups $PANDORA_SECONDARY_GROUPS/g" $PANDORA_AGENT_CONF [[ $PANDORA_SECONDARY_GROUPS ]] && sed -i "s/^# secondary_groups.*$/secondary_groups $PANDORA_SECONDARY_GROUPS/g" $PANDORA_AGENT_CONF
[[ $TIMEZONE ]] && ln -sfn /usr/share/zoneinfo/$TIMEZONE /etc/localtime [[ $TIMEZONE ]] && ln -sfn /usr/share/zoneinfo/$TIMEZONE /etc/localtime
[[ $PANDORA_AGENT_SSL ]] && sed -i "s/^#server_ssl.*$/server_ssl $PANDORA_AGENT_SSL/g" $PANDORA_AGENT_CONF
#installing autodiscover #installing autodiscover
@ -194,4 +214,4 @@ execute_cmd '/etc/init.d/pandora_agent_daemon restart' 'Starting Pandora Agent'
cd cd
execute_cmd 'rm -rf $HOME/pandora_deploy_tmp' 'Cleaning up temporay files' execute_cmd 'rm -rf $HOME/pandora_deploy_tmp' 'Cleaning up temporay files'
echo -e "${green}PandoraFMS Agent installed and running, sending data to: $PANDORA_SERVER_IP${reset}" echo -e "${green}PandoraFMS Agent installed and running, sending data to: $PANDORA_SERVER_IP${reset}"

View File

@ -11,22 +11,32 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='2022050901' S_VERSION='2023050901'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables # define default variables
[ "$TZ" ] || TZ="Europe/Madrid" [ "$TZ" ] || TZ="Europe/Madrid"
[ "$DBHOST" ] || DBHOST=127.0.0.1 [ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$MYVER" ] || MYVER=80
[ "$DBNAME" ] || DBNAME=pandora [ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora [ "$DBUSER" ] || DBUSER=pandora
[ "$DBPASS" ] || DBPASS=pandora [ "$DBPASS" ] || DBPASS=pandora
[ "$DBPORT" ] || DBPORT=3306 [ "$DBPORT" ] || DBPORT=3306
[ "$DBROOTUSER" ] || DBROOTUSER=root
[ "$DBROOTPASS" ] || DBROOTPASS=pandora [ "$DBROOTPASS" ] || DBROOTPASS=pandora
[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0 [ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0 [ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0 [ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g") [ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
[ "$PANDORA_BETA" ] || PANDORA_BETA=0 [ "$PANDORA_BETA" ] || PANDORA_BETA=0
[ "$PANDORA_LTS" ] || PANDORA_LTS=1
#Check if possible to get os version
if [ ! -e /etc/os-release ]; then
echo ' > Imposible to determinate the OS version for this machine, please make sure you are intalling in a compatible OS'
echo ' > More info: https://pandorafms.com/manual/en/documentation/02_installation/01_installing#minimum_software_requirements'
exit -1
fi
# Ansi color code variables # Ansi color code variables
red="\e[0;91m" red="\e[0;91m"
@ -72,7 +82,7 @@ check_pre_pandora () {
export MYSQL_PWD=$DBPASS export MYSQL_PWD=$DBPASS
echo -en "${cyan}Checking environment ... ${reset}" echo -en "${cyan}Checking environment ... ${reset}"
rpm -qa | grep 'pandorafms_' &>> /dev/null && local fail=true rpm -qa | grep 'pandorafms_' | grep -v pandorafms_agent_* | grep -v "pandorawmic" &>> /dev/null && local fail=true
[ -d "$PANDORA_CONSOLE" ] && local fail=true [ -d "$PANDORA_CONSOLE" ] && local fail=true
[ -f /usr/bin/pandora_server ] && local fail=true [ -f /usr/bin/pandora_server ] && local fail=true
echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true
@ -82,7 +92,7 @@ check_pre_pandora () {
} }
check_repo_connection () { check_repo_connection () {
execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo" execute_cmd "ping -c 2 firefly.pandorafms.com" "Checking Community repo"
execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo" execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo"
} }
@ -102,6 +112,12 @@ check_root_permissions () {
## Main ## Main
echo "Starting PandoraFMS Community deployment ver. $S_VERSION" echo "Starting PandoraFMS Community deployment ver. $S_VERSION"
#check tools
if ! grep --version &>> $LOGFILE ; then echo 'Error grep is not detected on the system, grep tool is needed for installation.'; exit -1 ;fi
if ! sed --version &>> $LOGFILE ; then echo 'Error sed is not detected on the system, sed tool is needed for installation.'; exit -1 ;fi
if ! curl --version &>> $LOGFILE ; then echo 'Error curl is not detected on the system, curl tool is needed for installation.'; exit -1 ;fi
if ! ping -V &>> $LOGFILE ; then echo 'Error ping is not detected on the system, ping tool is needed for installation.'; exit -1 ;fi
# Centos Version # Centos Version
if [ ! "$(grep -i centos /etc/redhat-release)" ]; then if [ ! "$(grep -i centos /etc/redhat-release)" ]; then
printf "${red}Error this is not a Centos Base system, this installer is compatible with Centos systems only${reset}\n" printf "${red}Error this is not a Centos Base system, this installer is compatible with Centos systems only${reset}\n"
@ -115,7 +131,7 @@ os_name=$(grep ^PRETTY_NAME= /etc/os-release | cut -d '=' -f2 | tr -d '"')
execute_cmd "echo $os_name" "OS detected: ${os_name}" execute_cmd "echo $os_name" "OS detected: ${os_name}"
echo -en "${cyan}Check Centos Version...${reset}" echo -en "${cyan}Check Centos Version...${reset}"
[ $(sed -nr 's/VERSION_ID+=\s*"([0-9])"$/\1/p' /etc/os-release) -eq '7' ] [[ $(sed -nr 's/VERSION_ID+=\s*"([0-9])"$/\1/p' /etc/os-release) -eq '7' ]]
check_cmd_status 'Error OS version, Centos 7 is expected' check_cmd_status 'Error OS version, Centos 7 is expected'
# initialice logfile # initialice logfile
@ -130,7 +146,10 @@ check_root_permissions
[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora [ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
#advicing BETA PROGRAM #advicing BETA PROGRAM
[ "$PANDORA_BETA" -ne '0' ] && echo -e "${red}BETA version enable using nightly PandoraFMS packages${reset}" INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
echo -e $INSTALLING_VER
# Connectivity # Connectivity
check_repo_connection check_repo_connection
@ -174,7 +193,15 @@ execute_cmd "yum-config-manager --enable remi-php80" "Configuring PHP"
# Install percona Database # Install percona Database
#[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf #[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf
execute_cmd "yum 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 "yum install -y percona-server-server percona-xtrabackup-80" "Installing Percona Server 80"
fi
if [ "$MYVER" -ne '80' ] ; then
execute_cmd "yum install -y Percona-Server-server-57 percona-xtrabackup-24" "Installing Percona Server 57"
fi
# Console dependencies # Console dependencies
console_dependencies=" \ console_dependencies=" \
@ -259,7 +286,7 @@ console_dependencies=" \
libzstd \ libzstd \
openldap-clients \ openldap-clients \
chromium \ chromium \
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm" http://firefly.pandorafms.com/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies" execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
# Server dependencies # Server dependencies
@ -286,9 +313,9 @@ server_dependencies=" \
bind-utils \ bind-utils \
whois \ whois \
cpanminus \ cpanminus \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \ http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
https://firefly.artica.es/centos7/pandorawmic-1.0.0-1.x86_64.rpm" https://firefly.pandorafms.com/centos7/pandorawmic-1.0.0-1.x86_64.rpm"
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies" execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
# install cpan dependencies # install cpan dependencies
@ -297,13 +324,13 @@ execute_cmd "cpanm -i Thread::Semaphore" "Installing Thread::Semaphore"
# SDK VMware perl dependencies # SDK VMware perl dependencies
vmware_dependencies=" \ vmware_dependencies=" \
http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \ http://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \
perl-JSON \ perl-JSON \
perl-Archive-Zip \ perl-Archive-Zip \
openssl-devel \ openssl-devel \
perl-Crypt-CBC \ perl-Crypt-CBC \
perl-Digest-SHA \ perl-Digest-SHA \
http://firefly.artica.es/centos7/perl-Crypt-OpenSSL-AES-0.02-1.el7.x86_64.rpm" http://firefly.pandorafms.com/centos7/perl-Crypt-OpenSSL-AES-0.02-1.el7.x86_64.rpm"
execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl dependencies" execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl dependencies"
# Instant client Oracle # Instant client Oracle
@ -314,7 +341,7 @@ execute_cmd "yum install -y $oracle_dependencies || yum reinstall -y $oracle_dep
#ipam dependencies #ipam dependencies
ipam_dependencies=" \ ipam_dependencies=" \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \
perl(NetAddr::IP) \ perl(NetAddr::IP) \
perl(Sys::Syslog) \ perl(Sys::Syslog) \
perl(DBI) \ perl(DBI) \
@ -348,21 +375,32 @@ EO_CONFIG_TMP
#Configuring Database #Configuring Database
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
execute_cmd "systemctl start mysqld" "Starting database engine" execute_cmd "systemctl start mysqld" "Starting database engine"
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev) export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
echo """ if [ "$MYVER" -eq '80' ] ; then
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!'); echo """
UNINSTALL PLUGIN validate_password; SET PASSWORD FOR '$DBROOTUSER'@'localhost' = 'Pandor4!';
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$DBROOTPASS'); UNINSTALL COMPONENT 'file://component_validate_password';
""" | mysql --connect-expired-password -uroot &>> "$LOGFILE" SET PASSWORD FOR '$DBROOTUSER'@'localhost' = '$DBROOTPASS';
fi """ | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE"
export MYSQL_PWD=$DBROOTPASS fi
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 if [ "$MYVER" -ne '80' ] ; then
export MYSQL_PWD=$DBPASS echo """
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('Pandor4!');
UNINSTALL PLUGIN validate_password;
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('$DBROOTPASS');
""" | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE"fi
fi
export MYSQL_PWD=$DBROOTPASS
echo -en "${cyan}Creating Pandora FMS database...${reset}"
echo "create database $DBNAME" | mysql -u$DBROOTUSER -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 "CREATE USER \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
echo "ALTER USER \"$DBUSER\"@'%' IDENTIFIED WITH mysql_native_password BY \"$DBPASS\"" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
#Generating my.cnf #Generating my.cnf
cat > /etc/my.cnf << EO_CONFIG_F cat > /etc/my.cnf << EO_CONFIG_F
@ -401,6 +439,8 @@ query_cache_size = 64M
query_cache_min_res_unit = 2k query_cache_min_res_unit = 2k
query_cache_limit = 256K query_cache_limit = 256K
#skip-log-bin
sql_mode="" sql_mode=""
[mysqld_safe] [mysqld_safe]
@ -409,17 +449,35 @@ pid-file=/var/run/mysqld/mysqld.pid
EO_CONFIG_F EO_CONFIG_F
execute_cmd "systemctl restart mysqld" "Configuring database engine" if [ "$MYVER" -eq '80' ] ; then
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf
fi
execute_cmd "systemctl restart mysqld" "Configuring database engine"
execute_cmd "systemctl enable mysqld --now" "Enabling Database service"
fi
export MYSQL_PWD=$DBPASS
#Define packages #Define packages
if [ "$PANDORA_BETA" -eq '0' ] ; then #Define packages
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm" if [ "$PANDORA_LTS" -eq '1' ] ; then
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm" [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
elif [ "$PANDORA_BETA" -ne '0' ] ; then [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm"
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm" elif [ "$PANDORA_LTS" -ne '1' ] ; then
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://pandorafms.com/community/community-console-rpm-beta/" [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
fi
# if beta is enable
if [ "$PANDORA_BETA" -eq '1' ] ; then
PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.noarch.rpm"
PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
fi fi
# Downloading Pandora Packages # Downloading Pandora Packages
@ -526,6 +584,13 @@ sed -i -e "s|^dbpass.*|dbpass $DBPASS|g" $PANDORA_SERVER_CONF
sed -i -e "s/^dbport.*/dbport $DBPORT/g" $PANDORA_SERVER_CONF sed -i -e "s/^dbport.*/dbport $DBPORT/g" $PANDORA_SERVER_CONF
sed -i -e "s/^#.mssql_driver.*/mssql_driver $MS_ID/g" $PANDORA_SERVER_CONF sed -i -e "s/^#.mssql_driver.*/mssql_driver $MS_ID/g" $PANDORA_SERVER_CONF
#check fping
fping_bin=$(which fping)
execute_cmd "[ $fping_bin ]" "Check fping location: $fping_bin"
if [ "$fping_bin" != "" ]; then
sed -i -e "s|^fping.*|fping $fping_bin|g" $PANDORA_SERVER_CONF
fi
# Enable agent remote config # Enable agent remote config
sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF
@ -565,7 +630,16 @@ net.core.optmem_max = 81920
EO_KO EO_KO
[ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization" echo -en "${cyan}Applying Kernel optimization... ${reset}"
sysctl --system &>> $LOGFILE
if [ $? -ne 0 ]; then
echo -e "${red}Fail${reset}"
echo -e "${yellow}Your kernel could not be optimized, you may be running this script in a virtualized environment with no support for accessing the kernel.${reset}"
echo -e "${yellow}This system can be used for testing but is not recommended for a production environment.${reset}"
echo "$old_sysctl_file" > old_sysctl_file
else
echo -e "${green}OK${reset}"
fi
fi fi
# Fix pandora_server.{log,error} permissions to allow Console check them # Fix pandora_server.{log,error} permissions to allow Console check them
@ -652,7 +726,7 @@ cat > /etc/issue.net << EOF_banner
Welcome to Pandora FMS appliance on CentOS Welcome to Pandora FMS appliance on CentOS
------------------------------------------ ------------------------------------------
Go to Public http://$ipplublic/pandora_console$to to login web console Go to Public http://$ipplublic/pandora_console to login web console
$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}') $(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}')
You can find more information at http://pandorafms.com You can find more information at http://pandorafms.com
@ -673,4 +747,4 @@ execute_cmd "rm -rf $HOME/pandora_deploy_tmp" "Removing temporary files"
GREEN='\033[01;32m' GREEN='\033[01;32m'
NONE='\033[0m' NONE='\033[0m'
printf " -> Go to Public ${green}http://"$ipplublic"/pandora_console${reset} to manage this server" printf " -> Go to Public ${green}http://"$ipplublic"/pandora_console${reset} to manage this server"
ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v -e "172.1[0-9].0.1" | awk '{print $2}' | awk -v g=$GREEN -v n=$NONE -F '/' '{printf "\n -> Go to Local "g"http://"$1"/pandora_console"n" to manage this server \n -> Use these credentials to log in Pandora Console "g"[ User: admin / Password: pandora ]"n" \n"}' ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v -e "172.1[0-9].0.1" | awk '{print $2}' | awk -v g=$GREEN -v n=$NONE -F '/' '{printf "\n -> Go to Local "g"http://"$1"/pandora_console"n" to manage this server \n -> Use these credentials to log in Pandora Console "g"[ User: admin / Password: pandora ]"n" \n"}'

View File

@ -14,12 +14,12 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='202302201' S_VERSION='2023050901'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables # define default variables
[ "$TZ" ] || TZ="Europe/Madrid" [ "$TZ" ] || TZ="Europe/Madrid"
[ "$MYVER" ] || MYVER=57 [ "$MYVER" ] || MYVER=80
[ "$PHPVER" ] || PHPVER=8 [ "$PHPVER" ] || PHPVER=8
[ "$DBHOST" ] || DBHOST=127.0.0.1 [ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora [ "$DBNAME" ] || DBNAME=pandora
@ -35,10 +35,18 @@ LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
[ "$PANDORA_LTS" ] || PANDORA_LTS=1 [ "$PANDORA_LTS" ] || PANDORA_LTS=1
[ "$PANDORA_BETA" ] || PANDORA_BETA=0 [ "$PANDORA_BETA" ] || PANDORA_BETA=0
#Check if possible to get os version
if [ ! -e /etc/os-release ]; then
echo ' > Imposible to determinate the OS version for this machine, please make sure you are intalling in a compatible OS'
echo ' > More info: https://pandorafms.com/manual/en/documentation/02_installation/01_installing#minimum_software_requirements'
exit -1
fi
# Ansi color code variables # Ansi color code variables
red="\e[0;91m" red="\e[0;91m"
green="\e[0;92m" green="\e[0;92m"
cyan="\e[0;36m" cyan="\e[0;36m"
yellow="\e[33m"
reset="\e[0m" reset="\e[0m"
# Functions # Functions
@ -76,7 +84,7 @@ check_cmd_status () {
check_pre_pandora () { check_pre_pandora () {
echo -en "${cyan}Checking environment ... ${reset}" echo -en "${cyan}Checking environment ... ${reset}"
rpm -qa | grep -v "pandorawmic" | grep 'pandorafms_' &>> /dev/null && local fail=true rpm -qa | grep 'pandorafms_' | grep -v pandorafms_agent_* | grep -v "pandorawmic" &>> /dev/null && local fail=true
[ -d "$PANDORA_CONSOLE" ] && local fail=true [ -d "$PANDORA_CONSOLE" ] && local fail=true
[ -f /usr/bin/pandora_server ] && local fail=true [ -f /usr/bin/pandora_server ] && local fail=true
@ -90,7 +98,7 @@ check_pre_pandora () {
} }
check_repo_connection () { check_repo_connection () {
execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo" execute_cmd "ping -c 2 firefly.pandorafms.com" "Checking Community repo"
execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo" execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo"
} }
@ -121,6 +129,12 @@ installing_docker () {
## Main ## Main
echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION" echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION"
#check tools
if ! grep --version &>> $LOGFILE ; then echo 'Error grep is not detected on the system, grep tool is needed for installation.'; exit -1 ;fi
if ! sed --version &>> $LOGFILE ; then echo 'Error sed is not detected on the system, sed tool is needed for installation.'; exit -1 ;fi
if ! curl --version &>> $LOGFILE ; then echo 'Error curl is not detected on the system, curl tool is needed for installation.'; exit -1 ;fi
if ! ping -V &>> $LOGFILE ; then echo 'Error ping is not detected on the system, ping tool is needed for installation.'; exit -1 ;fi
# Centos Version # Centos Version
if [ ! "$(grep -Ei 'centos|rocky|Almalinux|Red Hat Enterprise' /etc/redhat-release)" ]; then if [ ! "$(grep -Ei 'centos|rocky|Almalinux|Red Hat Enterprise' /etc/redhat-release)" ]; then
printf "\n ${red}Error this is not a Centos/Rocky/Almalinux Base system, this installer is compatible with RHEL/Almalinux/Centos/Rockylinux systems only${reset}\n" printf "\n ${red}Error this is not a Centos/Rocky/Almalinux Base system, this installer is compatible with RHEL/Almalinux/Centos/Rockylinux systems only${reset}\n"
@ -129,8 +143,8 @@ fi
echo -en "${cyan}Check Centos Version...${reset}" echo -en "${cyan}Check Centos Version...${reset}"
[ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ] [[ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ]]
check_cmd_status 'Error OS version, RHEL/Almalinux/Centos/Rockylinux 8+ is expected' check_cmd_status 'Error OS version, RHEL/Almalinux/Centos/Rockylinux 8.x is expected'
#Detect OS #Detect OS
os_name=$(grep ^PRETTY_NAME= /etc/os-release | cut -d '=' -f2 | tr -d '"') os_name=$(grep ^PRETTY_NAME= /etc/os-release | cut -d '=' -f2 | tr -d '"')
@ -149,8 +163,8 @@ check_root_permissions
#advicing BETA PROGRAM #advicing BETA PROGRAM
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}" INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}" [ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
echo -e $INSTALLING_VER echo -e $INSTALLING_VER
# Connectivity # Connectivity
@ -238,7 +252,7 @@ execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
if [ "$MYVER" -eq '80' ] ; then if [ "$MYVER" -eq '80' ] ; then
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module" execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-24" "Installing Percona Server 80" execute_cmd "dnf install -y percona-server-server percona-xtrabackup-80" "Installing Percona Server 80"
fi fi
if [ "$MYVER" -ne '80' ] ; then if [ "$MYVER" -ne '80' ] ; then
@ -327,10 +341,11 @@ console_dependencies=" \
mod_ssl \ mod_ssl \
libzstd \ libzstd \
openldap-clients \ openldap-clients \
chromium \ http://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ http://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \ http://firefly.pandorafms.com/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm" http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
http://firefly.pandorafms.com/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies" execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
# Server dependencies # Server dependencies
@ -356,9 +371,9 @@ server_dependencies=" \
java \ java \
bind-utils \ bind-utils \
whois \ whois \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \ http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
https://firefly.artica.es/centos8/pandorawmic-1.0.0-1.x86_64.rpm" https://firefly.pandorafms.com/centos8/pandorawmic-1.0.0-1.x86_64.rpm"
execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies" execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
# SDK VMware perl dependencies # SDK VMware perl dependencies
@ -372,8 +387,8 @@ vmware_dependencies=" \
perl-Math-Random-ISAAC \ perl-Math-Random-ISAAC \
perl-JSON \ perl-JSON \
perl-Crypt-SSLeay \ perl-Crypt-SSLeay \
http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm \ http://firefly.pandorafms.com/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm \
http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm" http://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm"
execute_cmd "dnf install -y $vmware_dependencies" "Installing SDK VMware perl dependencies" execute_cmd "dnf install -y $vmware_dependencies" "Installing SDK VMware perl dependencies"
# Instant client Oracle # Instant client Oracle
@ -384,7 +399,7 @@ execute_cmd "dnf install -y $oracle_dependencies" "Installing Oracle Instant cli
#ipam dependencies #ipam dependencies
ipam_dependencies=" \ ipam_dependencies=" \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \
perl(NetAddr::IP) \ perl(NetAddr::IP) \
perl(Sys::Syslog) \ perl(Sys::Syslog) \
perl(DBI) \ perl(DBI) \
@ -406,6 +421,7 @@ setenforce 0 &>> "$LOGFILE"
sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config &>> "$LOGFILE" sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config &>> "$LOGFILE"
systemctl disable firewalld --now &>> "$LOGFILE" systemctl disable firewalld --now &>> "$LOGFILE"
# Adding standar cnf for initial setup. # Adding standar cnf for initial setup.
cat > /etc/my.cnf << EO_CONFIG_TMP cat > /etc/my.cnf << EO_CONFIG_TMP
[mysqld] [mysqld]
@ -505,20 +521,20 @@ export MYSQL_PWD=$DBPASS
#Define packages #Define packages
if [ "$PANDORA_LTS" -eq '1' ] ; then if [ "$PANDORA_LTS" -eq '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm" [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm" [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm" [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm"
elif [ "$PANDORA_LTS" -ne '1' ] ; then elif [ "$PANDORA_LTS" -ne '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm" [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm" [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
fi fi
# if beta is enable # if beta is enable
if [ "$PANDORA_BETA" -eq '1' ] ; then if [ "$PANDORA_BETA" -eq '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm" PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://pandorafms.com/community/community-console-rpm-beta/" PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.noarch.rpm"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
fi fi
# Downloading Pandora Packages # Downloading Pandora Packages
@ -630,6 +646,13 @@ sed -i -e "s|^dbpass.*|dbpass $DBPASS|g" $PANDORA_SERVER_CONF
sed -i -e "s/^dbport.*/dbport $DBPORT/g" $PANDORA_SERVER_CONF sed -i -e "s/^dbport.*/dbport $DBPORT/g" $PANDORA_SERVER_CONF
sed -i -e "s/^#.mssql_driver.*/mssql_driver $MS_ID/g" $PANDORA_SERVER_CONF sed -i -e "s/^#.mssql_driver.*/mssql_driver $MS_ID/g" $PANDORA_SERVER_CONF
#check fping
fping_bin=$(which fping)
execute_cmd "[ $fping_bin ]" "Check fping location: $fping_bin"
if [ "$fping_bin" != "" ]; then
sed -i -e "s|^fping.*|fping $fping_bin|g" $PANDORA_SERVER_CONF
fi
# Enable agent remote config # Enable agent remote config
sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF
@ -645,6 +668,9 @@ EOF_ENV
# Kernel optimization # Kernel optimization
if [ "$SKIP_KERNEL_OPTIMIZATIONS" -eq '0' ] ; then if [ "$SKIP_KERNEL_OPTIMIZATIONS" -eq '0' ] ; then
old_sysctl_file=$(cat /etc/sysctl.conf)
cat >> /etc/sysctl.conf <<EO_KO cat >> /etc/sysctl.conf <<EO_KO
# Pandora FMS Optimization # Pandora FMS Optimization
@ -671,7 +697,17 @@ net.core.optmem_max = 81920
EO_KO EO_KO
[ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization" echo -en "${cyan}Applying Kernel optimization... ${reset}"
sysctl --system &>> $LOGFILE
if [ $? -ne 0 ]; then
echo -e "${red}Fail${reset}"
echo -e "${yellow}Your kernel could not be optimized, you may be running this script in a virtualized environment with no support for accessing the kernel.${reset}"
echo -e "${yellow}This system can be used for testing but is not recommended for a production environment.${reset}"
echo "$old_sysctl_file" > old_sysctl_file
else
echo -e "${green}OK${reset}"
fi
fi fi
# Fix pandora_server.{log,error} permissions to allow Console check them # Fix pandora_server.{log,error} permissions to allow Console check them
@ -758,7 +794,7 @@ cat > /etc/issue.net << EOF_banner
Welcome to Pandora FMS appliance on RHEL/Rocky Linux 8 Welcome to Pandora FMS appliance on RHEL/Rocky Linux 8
------------------------------------------ ------------------------------------------
Go to Public http://$ipplublic/pandora_console$to to login web console Go to Public http://$ipplublic/pandora_console to login web console
$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}') $(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}')
You can find more information at http://pandorafms.com You can find more information at http://pandorafms.com
@ -779,4 +815,4 @@ execute_cmd "rm -rf $HOME/pandora_deploy_tmp" "Removing temporary files"
GREEN='\033[01;32m' GREEN='\033[01;32m'
NONE='\033[0m' NONE='\033[0m'
printf " -> Go to Public ${green}http://"$ipplublic"/pandora_console${reset} to manage this server" printf " -> Go to Public ${green}http://"$ipplublic"/pandora_console${reset} to manage this server"
ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v -e "172.1[0-9].0.1" | awk '{print $2}' | awk -v g=$GREEN -v n=$NONE -F '/' '{printf "\n -> Go to Local "g"http://"$1"/pandora_console"n" to manage this server \n -> Use these credentials to log in Pandora Console "g"[ User: admin / Password: pandora ]"n" \n"}' ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v -e "172.1[0-9].0.1" | awk '{print $2}' | awk -v g=$GREEN -v n=$NONE -F '/' '{printf "\n -> Go to Local "g"http://"$1"/pandora_console"n" to manage this server \n -> Use these credentials to log in Pandora Console "g"[ User: admin / Password: pandora ]"n" \n"}'

View File

@ -17,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
WORKDIR=/opt/pandora/deploy WORKDIR=/opt/pandora/deploy
S_VERSION='202302201' S_VERSION='2023050901'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
rm -f $LOGFILE &> /dev/null # remove last log before start rm -f $LOGFILE &> /dev/null # remove last log before start
@ -37,6 +37,12 @@ rm -f $LOGFILE &> /dev/null # remove last log before start
[ "$PANDORA_BETA" ] || PANDORA_BETA=0 [ "$PANDORA_BETA" ] || PANDORA_BETA=0
[ "$PANDORA_LTS" ] || PANDORA_LTS=1 [ "$PANDORA_LTS" ] || PANDORA_LTS=1
#Check if possible to get os version
if [ ! -e /etc/os-release ]; then
echo ' > Imposible to determinate the OS version for this machine, please make sure you are intalling in a compatible OS'
echo ' > More info: https://pandorafms.com/manual/en/documentation/02_installation/01_installing#minimum_software_requirements'
exit -1
fi
# Ansi color code variables # Ansi color code variables
red="\e[0;91m" red="\e[0;91m"
@ -90,7 +96,7 @@ check_pre_pandora () {
} }
check_repo_connection () { check_repo_connection () {
execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo" execute_cmd "ping -c 2 firefly.pandorafms.com" "Checking Community repo"
execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo" execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo"
} }
@ -125,6 +131,12 @@ installing_docker () {
## Main ## Main
echo "Starting PandoraFMS Community deployment Ubuntu 22.04 ver. $S_VERSION" echo "Starting PandoraFMS Community deployment Ubuntu 22.04 ver. $S_VERSION"
#check tools
if ! grep --version &>> $LOGFILE ; then echo 'Error grep is not detected on the system, grep tool is needed for installation.'; exit -1 ;fi
if ! sed --version &>> $LOGFILE ; then echo 'Error sed is not detected on the system, sed tool is needed for installation.'; exit -1 ;fi
if ! curl --version &>> $LOGFILE ; then echo 'Error curl is not detected on the system, curl tool is needed for installation.'; exit -1 ;fi
if ! ping -V &>> $LOGFILE ; then echo 'Error ping is not detected on the system, ping tool is needed for installation.'; exit -1 ;fi
# Ubuntu Version # Ubuntu Version
if [ ! "$(grep -Ei 'Ubuntu' /etc/lsb-release)" ]; then if [ ! "$(grep -Ei 'Ubuntu' /etc/lsb-release)" ]; then
printf "\n ${red}Error this is not a Ubuntu system, this installer is compatible with Ubuntu systems only${reset}\n" printf "\n ${red}Error this is not a Ubuntu system, this installer is compatible with Ubuntu systems only${reset}\n"
@ -133,7 +145,7 @@ fi
echo -en "${cyan}Check Ubuntu Version...${reset}" echo -en "${cyan}Check Ubuntu Version...${reset}"
[ $(sed -nr 's/VERSION_ID+=\s*"([0-9][0-9].[0-9][0-9])"$/\1/p' /etc/os-release) == "22.04" ] [[ $(sed -nr 's/VERSION_ID+=\s*"([0-9][0-9].[0-9][0-9])"$/\1/p' /etc/os-release) == "22.04" ]]
check_cmd_status 'Error OS version, Ubuntu 22.04 is expected' check_cmd_status 'Error OS version, Ubuntu 22.04 is expected'
#Detect OS #Detect OS
@ -153,8 +165,8 @@ check_root_permissions
#advicing BETA PROGRAM #advicing BETA PROGRAM
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}" INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}" [ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
echo -e $INSTALLING_VER echo -e $INSTALLING_VER
# Connectivity # Connectivity
@ -273,14 +285,16 @@ server_dependencies=" \
libencode-perl \ libencode-perl \
cron \ cron \
libgeo-ip-perl \ libgeo-ip-perl \
arping \
snmp-mibs-downloader \
openjdk-8-jdk " openjdk-8-jdk "
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies" execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
execute_cmd "installing_docker" "Installing Docker for debug" execute_cmd "installing_docker" "Installing Docker for debug"
# wmic and pandorawmic # wmic and pandorawmic
execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/wmic" "Downloading wmic" execute_cmd "curl -O https://firefly.pandorafms.com/pandorafms/utils/bin/wmic" "Downloading wmic"
execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic" execute_cmd "curl -O https://firefly.pandorafms.com/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic"
echo -en "${cyan}Installing wmic and pandorawmic...${reset}" echo -en "${cyan}Installing wmic and pandorawmic...${reset}"
chmod +x pandorawmic wmic &>> "$LOGFILE" && \ chmod +x pandorawmic wmic &>> "$LOGFILE" && \
cp -a wmic /usr/bin/ &>> "$LOGFILE" && \ cp -a wmic /usr/bin/ &>> "$LOGFILE" && \
@ -291,7 +305,7 @@ check_cmd_status "Error Installing phanromjs"
echo -en "${cyan}Installing phantomjs...${reset}" echo -en "${cyan}Installing phantomjs...${reset}"
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
export OPENSSL_CONF=/etc/ssl export OPENSSL_CONF=/etc/ssl
curl -LSs -O "https://firefly.artica.es/pandorafms/utils/$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \ curl -LSs -O "https://firefly.pandorafms.com/pandorafms/utils/$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \
tar xvjf "$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \ tar xvjf "$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \
mv $PHANTOM_JS/bin/phantomjs /usr/bin &>> "$LOGFILE" && \ mv $PHANTOM_JS/bin/phantomjs /usr/bin &>> "$LOGFILE" && \
/usr/bin/phantomjs --version &>> "$LOGFILE" /usr/bin/phantomjs --version &>> "$LOGFILE"
@ -303,8 +317,9 @@ ln -s /usr/bin/fping /usr/sbin/fping &>> "$LOGFILE"
# Chrome # Chrome
rm -f /usr/bin/chromium-browser &>> "$LOGFILE" rm -f /usr/bin/chromium-browser &>> "$LOGFILE"
execute_cmd "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" "Downloading google chrome" CHROME_VERSION=google-chrome-stable_110.0.5481.177-1_amd64.deb
execute_cmd "apt install -y ./google-chrome-stable_current_amd64.deb" "Intalling google chrome" execute_cmd "wget https://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/${CHROME_VERSION}" "Downloading google chrome"
execute_cmd "apt install -y ./${CHROME_VERSION}" "Intalling google chrome"
execute_cmd "ln -s /usr/bin/google-chrome /usr/bin/chromium-browser" "Creating /usr/bin/chromium-browser Symlink" execute_cmd "ln -s /usr/bin/google-chrome /usr/bin/chromium-browser" "Creating /usr/bin/chromium-browser Symlink"
# SDK VMware perl dependencies # SDK VMware perl dependencies
@ -320,7 +335,7 @@ vmware_dependencies="\
libsoap-lite-perl \ libsoap-lite-perl \
libmodule-build-perl" libmodule-build-perl"
execute_cmd "apt install -y $vmware_dependencies" "Installing VMware SDK dependencies" execute_cmd "apt install -y $vmware_dependencies" "Installing VMware SDK dependencies"
execute_cmd "wget https://firefly.artica.es/pandorafms/utils/VMware-vSphere-Perl-SDK-7.0.0-16453907.x86_64.tar.gz" "Downloading VMware SDK" execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/VMware-vSphere-Perl-SDK-7.0.0-16453907.x86_64.tar.gz" "Downloading VMware SDK"
echo -en "${cyan}Installing VMware SDK...${reset}" echo -en "${cyan}Installing VMware SDK...${reset}"
tar xvzf VMware-vSphere-Perl-SDK-7.0.0-16453907.x86_64.tar.gz &>> "$LOGFILE" tar xvzf VMware-vSphere-Perl-SDK-7.0.0-16453907.x86_64.tar.gz &>> "$LOGFILE"
cd vmware-vsphere-cli-distrib/ &>> "$LOGFILE" cd vmware-vsphere-cli-distrib/ &>> "$LOGFILE"
@ -385,7 +400,7 @@ execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_
execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8" execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}" echo -en "${cyan}Installing Percona Server for MySQL8...${reset}"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server &>> "$LOGFILE" env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server percona-xtrabackup-80 &>> "$LOGFILE"
check_cmd_status "Error Installing MySql Server" check_cmd_status "Error Installing MySql Server"
@ -455,19 +470,19 @@ execute_cmd "systemctl restart mysql" "Configuring and restarting database engin
#Define packages #Define packages
if [ "$PANDORA_LTS" -eq '1' ] ; then if [ "$PANDORA_LTS" -eq '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_server-7.0NG.tar.gz" [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/LTS/pandorafms_server-7.0NG.tar.gz"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_console-7.0NG.tar.gz" [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/LTS/pandorafms_console-7.0NG.tar.gz"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_agent_linux-7.0NG.tar.gz" [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/LTS/pandorafms_agent_linux-7.0NG.tar.gz"
elif [ "$PANDORA_LTS" -ne '1' ] ; then elif [ "$PANDORA_LTS" -ne '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_server-7.0NG.tar.gz" [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_server-7.0NG.tar.gz"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_console-7.0NG.tar.gz" [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_console-7.0NG.tar.gz"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz" [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
fi fi
if [ "$PANDORA_BETA" -eq '1' ] ; then if [ "$PANDORA_BETA" -eq '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz" PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz" PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz" PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
fi fi
# Downloading Pandora Packages # Downloading Pandora Packages
@ -678,7 +693,16 @@ net.core.optmem_max = 81920
EO_KO EO_KO
[ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization" echo -en "${cyan}Applying Kernel optimization... ${reset}"
sysctl --system &>> $LOGFILE
if [ $? -ne 0 ]; then
echo -e "${red}Fail${reset}"
echo -e "${yellow}Your kernel could not be optimized, you may be running this script in a virtualized environment with no support for accessing the kernel.${reset}"
echo -e "${yellow}This system can be used for testing but is not recommended for a production environment.${reset}"
echo "$old_sysctl_file" > old_sysctl_file
else
echo -e "${green}OK${reset}"
fi
fi fi
# Fix pandora_server.{log,error} permissions to allow Console check them # Fix pandora_server.{log,error} permissions to allow Console check them
@ -775,7 +799,7 @@ cat > /etc/issue.net << EOF_banner
Welcome to Pandora FMS appliance on Ubuntu Welcome to Pandora FMS appliance on Ubuntu
------------------------------------------ ------------------------------------------
Go to Public http://$ipplublic/pandora_console$to to login web console Go to Public http://$ipplublic/pandora_console to login web console
$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}') $(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}')
You can find more information at http://pandorafms.com You can find more information at http://pandorafms.com
@ -796,4 +820,4 @@ execute_cmd "rm -rf $WORKDIR" "Removing temporary files"
GREEN='\033[01;32m' GREEN='\033[01;32m'
NONE='\033[0m' NONE='\033[0m'
printf " -> Go to Public ${green}http://"$ipplublic"/pandora_console${reset} to manage this server" printf " -> Go to Public ${green}http://"$ipplublic"/pandora_console${reset} to manage this server"
ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v -e "172.1[0-9].0.1" | awk '{print $2}' | awk -v g=$GREEN -v n=$NONE -F '/' '{printf "\n -> Go to Local "g"http://"$1"/pandora_console"n" to manage this server \n -> Use these credentials to log in Pandora Console "g"[ User: admin / Password: pandora ]"n" \n"}' ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v -e "172.1[0-9].0.1" | awk '{print $2}' | awk -v g=$GREEN -v n=$NONE -F '/' '{printf "\n -> Go to Local "g"http://"$1"/pandora_console"n" to manage this server \n -> Use these credentials to log in Pandora Console "g"[ User: admin / Password: pandora ]"n" \n"}'

View File

@ -8,265 +8,134 @@ RUN dnf install -y --setopt=tsflags=nodocs \
dnf-utils \ dnf-utils \
http://rpms.remirepo.net/enterprise/remi-release-8.rpm http://rpms.remirepo.net/enterprise/remi-release-8.rpm
RUN dnf module reset -y php && dnf module install -y php:remi-7.4 RUN dnf module reset -y php && dnf module install -y php:remi-8.0
RUN dnf config-manager --set-enabled powertools RUN dnf config-manager --set-enabled powertools
# Install console dependencies # Install console dependencies
RUN dnf install -y --setopt=tsflags=nodocs \ RUN dnf install -y --setopt=tsflags=nodocs \
php \ php \
php-mcrypt \php-cli \ postfix \
php-gd \ php-mcrypt \
php-curl \ php-cli \
php-session \ php-gd \
php-mysqlnd \ php-curl \
php-ldap \ php-session \
php-zip \ php-mysqlnd \
php-zlib \ php-ldap \
php-fileinfo \ php-zip \
php-gettext \ php-zlib \
php-snmp \ php-fileinfo \
php-mbstring \ php-gettext \
php-pecl-zip \ php-snmp \
php-xmlrpc \ php-mbstring \
libxslt \ php-pecl-zip \
wget \ php-xmlrpc \
php-xml \ libxslt \
httpd \ wget \
mod_php \ php-xml \
atk \ httpd \
avahi-libs \ mod_php \
cairo \ atk \
cups-libs \ avahi-libs \
fribidi \ cairo \
gd \ cups-libs \
gdk-pixbuf2 \ fribidi \
ghostscript \ gd \
graphite2 \ gdk-pixbuf2 \
graphviz \ ghostscript \
gtk2 \ graphite2 \
harfbuzz \ graphviz \
hicolor-icon-theme \ gtk2 \
hwdata \ harfbuzz \
jasper-libs \ hicolor-icon-theme \
lcms2 \ hwdata \
libICE \ jasper-libs \
libSM \ lcms2 \
libXaw \ libICE \
libXcomposite \ libSM \
libXcursor \ libXaw \
libXdamage \ libXcomposite \
libXext \ libXcursor \
libXfixes \ libXdamage \
libXft \ libXext \
libXi \ libXfixes \
libXinerama \ libXft \
libXmu \ libXi \
libXrandr \ libXinerama \
libXrender \ libXmu \
libXt \ libXrandr \
libXxf86vm \ libXrender \
libcroco \ libXt \
libdrm \ libXxf86vm \
libfontenc \ libcroco \
libglvnd \ libdrm \
libglvnd-egl \ libfontenc \
libglvnd-glx \ libglvnd \
libpciaccess \ libglvnd-egl \
librsvg2 \ libglvnd-glx \
libthai \ libpciaccess \
libtool-ltdl \ librsvg2 \
libwayland-client \ libthai \
libwayland-server \ libtool-ltdl \
libxshmfence \ libwayland-client \
mesa-libEGL \ libwayland-server \
mesa-libGL \ libxshmfence \
mesa-libgbm \ mesa-libEGL \
mesa-libglapi \ mesa-libGL \
pango \ mesa-libgbm \
pixman \ mesa-libglapi \
nfdump \ pango \
xorg-x11-fonts-75dpi \ pixman \
xorg-x11-fonts-misc \ xorg-x11-fonts-75dpi \
poppler-data \ xorg-x11-fonts-misc \
php-yaml poppler-data \
php-yaml \
libzstd \
openldap-clients \
http://firefly.artica.es/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm
RUN mkdir -p /run/php-fpm/ ; chown -R root:apache /run/php-fpm/ RUN mkdir -p /run/php-fpm/ ; chown -R root:apache /run/php-fpm/
# Not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts # Not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts
# Install server dependencies # Install server dependencies
RUN dnf install -y --setopt=tsflags=nodocs \
RUN dnf install -y --setopt=tsflags=nodocs \ perl \
GeoIP \ vim \
GeoIP-GeoLite-data \ fping \
dwz \ perl-IO-Compress \
efi-srpm-macros \ nmap \
ghc-srpm-macros \ sudo \
go-srpm-macros \ perl-Time-HiRes \
ocaml-srpm-macros \ nfdump \
openblas-srpm-macros \ net-snmp-utils \
perl \ "perl(NetAddr::IP)" \
perl-Algorithm-Diff \ "perl(Sys::Syslog)" \
perl-Archive-Tar \ "perl(DBI)" \
perl-Archive-Zip \ "perl(XML::Simple)" \
perl-Attribute-Handlers \ "perl(Geo::IP)" \
perl-B-Debug \ "perl(IO::Socket::INET6)" \
perl-CPAN \ "perl(XML::Twig)" \
perl-CPAN-Meta \ expect \
perl-CPAN-Meta-Requirements \ openssh-clients \
perl-CPAN-Meta-YAML \ java \
perl-Compress-Bzip2 \ bind-utils \
perl-Config-Perl-V \ whois \
perl-DBD-MySQL \ libnsl \
perl-DBI \ http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
perl-DB_File \ https://firefly.artica.es/centos8/pandorawmic-1.0.0-1.x86_64.rpm ; dnf clean all
perl-Data-Dump \
perl-Data-OptList \
perl-Data-Section \
perl-Devel-PPPort \
perl-Devel-Peek \
perl-Devel-SelfStubber \
perl-Devel-Size \
perl-Digest-HMAC \
perl-Digest-SHA \
perl-Encode-Locale \
perl-Encode-devel \
perl-Env \
perl-ExtUtils-CBuilder \
perl-ExtUtils-Command \
perl-ExtUtils-Embed \
perl-ExtUtils-Install \
perl-ExtUtils-MM-Utils \
perl-ExtUtils-MakeMaker \
perl-ExtUtils-Manifest \
perl-ExtUtils-Miniperl \
perl-ExtUtils-ParseXS \
perl-File-Fetch \
perl-File-HomeDir \
perl-File-Listing \
perl-File-Which \
perl-Filter \
perl-Filter-Simple \
perl-Geo-IP \
perl-HTML-Parser \
perl-HTML-Tagset \
perl-HTML-Tree \
perl-HTTP-Cookies \
perl-HTTP-Date \
perl-HTTP-Message \
perl-HTTP-Negotiate \
perl-IO-HTML \
perl-IO-Socket-INET6 \
perl-IO-Zlib \
perl-IO-stringy \
perl-IPC-Cmd \
perl-IPC-SysV \
perl-IPC-System-Simple \
perl-JSON \
perl-JSON-PP \
perl-LWP-MediaTypes \
perl-Locale-Codes \
perl-Locale-Maketext \
perl-Locale-Maketext-Simple \
perl-MRO-Compat \
perl-Math-BigInt \
perl-Math-BigInt-FastCalc \
perl-Math-BigRat \
perl-Memoize \
perl-Module-Build \
perl-Module-CoreList \
perl-Module-CoreList-tools \
perl-Module-Load \
perl-Module-Load-Conditional \
perl-Module-Loaded \
perl-Module-Metadata \
perl-NTLM \
perl-Net-HTTP \
perl-Net-Ping \
perl-NetAddr-IP \
perl-Package-Generator \
perl-Params-Check \
perl-Params-Util \
perl-Perl-OSType \
perl-PerlIO-via-QuotedPrint \
perl-Pod-Checker \
perl-Pod-Html \
perl-Pod-Parser \
perl-SelfLoader \
perl-Socket6 \
perl-Software-License \
perl-Sub-Exporter \
perl-Sub-Install \
perl-Sys-Syslog \
perl-Test \
perl-Test-Harness \
perl-Test-Simple \
perl-Text-Balanced \
perl-Text-Diff \
perl-Text-Glob \
perl-Text-Template \
perl-Thread-Queue \
perl-Time-Piece \
perl-TimeDate \
perl-Try-Tiny \
perl-Unicode-Collate \
perl-WWW-RobotRules \
perl-XML-NamespaceSupport \
perl-XML-Parser \
perl-XML-SAX \
perl-XML-SAX-Base \
perl-XML-Simple \
perl-XML-Twig \
perl-autodie \
perl-bignum \
perl-devel \
perl-encoding \
perl-experimental \
perl-inc-latest \
perl-libnetcfg \
perl-libwww-perl \
perl-local-lib \
perl-open \
perl-perlfaq \
perl-srpm-macros \
perl-utils \
perl-version \
python-srpm-macros \
python3-pyparsing \
python3-rpm-macros \
qt5-srpm-macros \
redhat-rpm-config \
rust-srpm-macros \
systemtap-sdt-devel \
perl-TermReadKey \
perl \
perl-DBD-MySQL \
perl-DBI \
initscripts \
vim \
fping \
perl-IO-Compress \
perl-Time-HiRes \
perl-Math-Complex \
libnsl \
mysql \
java \
net-snmp-utils \
net-tools \
nmap-ncat \
nmap \
net-snmp-utils \
sudo \
expect \
openssh-clients \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm
# Install utils # Install utils
RUN dnf install -y supervisor chromium crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs RUN dnf install -y supervisor mysql chromium crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs
# SDK VMware perl dependencies # SDK VMware perl dependencies
RUN dnf install -y http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm http://firefly.artica.es/centos8/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm perl-Net-HTTP perl-libwww-perl openssl-devel perl-Crypt-CBC perl-Bytes-Random-Secure perl-Crypt-Random-Seed perl-Math-Random-ISAAC perl-JSON http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm RUN dnf install -y http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm http://firefly.artica.es/centos8/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm perl-Net-HTTP perl-libwww-perl openssl-devel perl-Crypt-CBC perl-Bytes-Random-Secure perl-Crypt-Random-Seed perl-Math-Random-ISAAC perl-JSON http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm
# Instant client Oracle # Instant client Oracle
RUN dnf install -y https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm RUN dnf install -y https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm
# Install IPAM dependencies
RUN dnf install -y "perl(NetAddr::IP)" "perl(Sys::Syslog)" "perl(DBI)" "perl(XML::Simple)" "perl(Geo::IP)" "perl(IO::Socket::INET6)" "perl(XML::Twig)" "perl(DBD::mysql)" --setopt=tsflags=nodocs
EXPOSE 80 443 41121 162/udp EXPOSE 80 443 41121 162/udp

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, AIX version # Version 7.0NG.772, 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.769, FreeBSD Version # Version 7.0NG.772, 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.769, HP-UX Version # Version 7.0NG.772, 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.769, GNU/Linux # Version 7.0NG.772, 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.769, GNU/Linux # Version 7.0NG.772, 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.769, Solaris Version # Version 7.0NG.772, 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.769 # Version 7.0NG.772
# 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

@ -2018,7 +2018,7 @@ sub pandora_agent_run () {
$Xml = $xml_header . $Xml . "</agent_data>"; $Xml = $xml_header . $Xml . "</agent_data>";
# Save XML data file # Save XML data file
my $temp_file = $Conf{'temporal'} . '/' . $Conf{'agent_name'} . '.' . time () . '.data'; my $temp_file = $Conf{'temporal'} . '/' . md5($Conf{'agent_name'}) . '.' . time () . '.data';
if (-l $temp_file && !unlink($temp_file)) { if (-l $temp_file && !unlink($temp_file)) {
error ("File '$temp_file' already exists as a symlink and could not be removed: $!"); error ("File '$temp_file' already exists as a symlink and could not be removed: $!");
return 1; return 1;

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.769, AIX version # Version 7.0NG.772, 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.769 # Version 7.0NG.772
# 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.769, HPUX Version # Version 7.0NG.772, 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.769 # Version 7.0NG.772
# 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.769 # Version 7.0NG.772
# 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.769 # Version 7.0NG.772
# 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.769, Solaris version # Version 7.0NG.772, 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.769, AIX version # Version 7.0NG.772, 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.769-230313 Version: 7.0NG.772-230629
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.769-230313" pandora_version="7.0NG.772-230629"
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.769" VERSION="7.0NG.772"
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.769" onConclusion="none">pandorafms_src.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.772" 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.769" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.772" 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.769</string> <key>CFBundleVersion</key> <string>7.0NG.772</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.769 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string> <key>CFBundleGetInfoString</key> <string>7.0NG.772 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.769</string> <key>CFBundleShortVersionString</key> <string>7.0NG.772</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.769, GNU/Linux # Version 7.0NG.772, 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.769, FreeBSD Version # Version 7.0NG.772, 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.769, HP-UX Version # Version 7.0NG.772, 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,31 +1,31 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux # Version 7.0NG.772
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2004-2023 Pandora FMS
# http://www.pandorafms.com # https://pandorafms.com
# General Parameters # General Parameters
# ================== # ==================
server_ip localhost server_ip localhost
server_path /var/spool/pandora/data_in server_path /var/spool/pandora/data_in
temporal /tmp temporal /tmp
logfile /var/log/pandora/pandora_agent.log logfile /var/log/pandora/pandora_agent.log
#include /etc/pandora/pandora_agent_alt.conf #include /etc/pandora/pandora_agent_alt.conf
#broker_agent name_agent #broker_agent name_agent
# Interval in seconds, 300 by default # Interval in seconds, 300 by default (5 minutes)
interval 300 interval 300
# Debug mode renames XML in the temp folder and continues running # Debug mode renames XML in the temp folder and continues running
debug 0 debug 0
# Optional. UDP Server to receive orders from outside # Optional. UDP Server to receive orders from outside
# By default is disabled, set 1 to enable # By default is disabled, set 1 to enable
# Set port (41122 by default) # Set port (41122 by default)
# Set address to restrict who can order a agent restart (0.0.0.0 = anybody) # Set address to restrict who can order a agent restart (0.0.0.0 = anybody)
#
udp_server 0 udp_server 0
udp_server_port 41122 udp_server_port 41122
udp_server_auth_address 0.0.0.0 udp_server_auth_address 0.0.0.0
@ -33,12 +33,13 @@ udp_server_auth_address 0.0.0.0
#process_xeyes_start xeyes #process_xeyes_start xeyes
#process_xeyes_stop killall xeyes #process_xeyes_stop killall xeyes
# By default, agent takes machine name # By default, agent takes hostname
#agent_name adama #agent_name adama
# To define agent name by specific command, define 'agent_name_cmd'. # To define agent name by specific command, define 'agent_name_cmd'.
# (In the following example, agent name is 'hostname_IP') # (In the following example, agent name is 'hostname_IP')
# If set to __rand__ the agent will generate a random name. # If set to __rand__ the agent will generate a random name, used by default to generate a unique name
#agent_name_cmd LANG=C; /bin/echo -n `hostname`; /bin/echo -n "_"; /bin/echo `/sbin/ifconfig eth0 | /bin/grep 'inet addr' | /usr/bin/awk '{print $2;}' | /usr/bin/cut -d: -f2` #agent_name_cmd LANG=C; /bin/echo -n `hostname`; /bin/echo -n "_"; /bin/echo `/sbin/ifconfig eth0 | /bin/grep 'inet addr' | /usr/bin/awk '{print $2;}' | /usr/bin/cut -d: -f2`
agent_name_cmd __rand__ agent_name_cmd __rand__
@ -52,7 +53,7 @@ agent_name_cmd __rand__
#agent_alias_cmd #agent_alias_cmd
# Agent description # Agent description
#description This is a demo agent for Linux #description This is an agent running Linux
# Group assigned for this agent (descriptive, p.e: Servers) # Group assigned for this agent (descriptive, p.e: Servers)
group Servers group Servers
@ -78,20 +79,19 @@ address auto
# Those parameters define the geographical position of the agent # Those parameters define the geographical position of the agent
# gis_exec: Call a script that returns a string with a fixed # gis_exec: Call a script that returns a string with a fixed
# format of latitude,longitude,altitude # format of latitude, longitude, altitude. Used for custom integration with GIS
# i.e.: 41.377,-5.105,2.365 # i.e.: 41.377,-5.105,2.365
#gis_exec /tmp/gis.sh #gis_exec /mypath/my_gis_script.sh
# This sets the GIS coordinates as fixed values: # This sets the GIS coordinates as fixed values:
# latitude
#latitude 0 #latitude 0
# longitude
#longitude 0 #longitude 0
# altitude
#altitude 0 #altitude 0
#GPS Position description #GPS Position description
#position_description Madrid, centro #position_description Madrid, centro
# By default agent try to take default encoding defined in host. # By default agent try to take default encoding defined in host.
@ -133,7 +133,8 @@ transfer_mode tentacle
# is much more safe # is much more safe
#cron_mode #cron_mode
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version) # If set to 1 allows the agent to be configured via the web console (Only use this in Enterprise version)
# when is set to 1, local .conf file changes are overwritten. Set to 0 if you want to edit the .conf file
remote_config 0 remote_config 0
# Default 0, set to 1 to avoid module executions and report to server # Default 0, set to 1 to avoid module executions and report to server
@ -157,7 +158,7 @@ remote_config 0
# Number of threads to execute modules in parallel # Number of threads to execute modules in parallel
#agent_threads 1 #agent_threads 1
# User the agent will run as # User the agent will run as. By default uses root, but could be configured to run as other user
#pandora_user pandora #pandora_user pandora
# Enable or disable XML buffer. # Enable or disable XML buffer.
@ -177,9 +178,9 @@ temporal_max_files 1024
# Agent mode: Learn (default), No-learn, Autodisable # Agent mode: Learn (default), No-learn, Autodisable
# agent_mode autodisable # agent_mode autodisable
# eHorus agent configuration file path: # Pandora RC (former eHorus) agent configuration file path.
# The agent will create a custom field named eHorusID that contains # The agent will create a custom field named eHorusID that contains
# the eHorus agent's identifying key # the PandoraRC agent's identifying key
ehorus_conf /etc/ehorus/ehorus_agent.conf ehorus_conf /etc/ehorus/ehorus_agent.conf
# Secondary groups. You can select several groups separated by comma. # Secondary groups. You can select several groups separated by comma.
@ -272,10 +273,22 @@ module_plugin autodiscover --default
# Plugin for inventory on the agent. # Plugin for inventory on the agent.
#module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route #module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
# Log collection modules. Only for enterprise version, this will collect log files for forensic analysis. # Log collection modules. This will collect log files for forensic analysis and store everything
# This is for LOG monitoring, only on enterprise version # This is for LOG monitoring. Different than log monitoring.
#module_plugin grep_log_module /var/log/messages Syslog \.\* #module_plugin grep_log_module /var/log/messages Syslog \.\*
# Another samples of monitoring modules
# Command snapshot
#module_begin
#module_name process_table
#module_type generic_data_string
#module_exec ps aux
#module_description Command snapshot of running processes
#module_group System
#module_end
#module_begin #module_begin
#module_name HTTPD_Status #module_name HTTPD_Status
#module_type generic_proc #module_type generic_proc

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux # Version 7.0NG.772, 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.769, NetBSD Version # Version 7.0NG.772, 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.769, Solaris Version # Version 7.0NG.772, 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

@ -1008,9 +1008,17 @@ use Sys::Hostname;
use File::Basename; use File::Basename;
use File::Copy; use File::Copy;
use IO::Socket; use IO::Socket;
use Sys::Syslog;
use Time::Local; use Time::Local;
eval {
require Sys::Syslog;
Sys::Syslog->import();
};
if ($@) {
print ("[INFO] Could not import Sys::Syslog module\n\n");
}
BEGIN { push @INC, '/usr/lib/perl5'; } BEGIN { push @INC, '/usr/lib/perl5'; }
# Agent XML data # Agent XML data
@ -1022,8 +1030,8 @@ 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.769'; use constant AGENT_VERSION => '7.0NG.772';
use constant AGENT_BUILD => '230313'; use constant AGENT_BUILD => '230629';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -1413,7 +1421,7 @@ sub start_log (;$) {
$Conf{'logfile'} = '/var/log/pandora/pandora_agent.log' unless defined ($Conf{'logfile'}); $Conf{'logfile'} = '/var/log/pandora/pandora_agent.log' unless defined ($Conf{'logfile'});
# Open it # Open it
if ($Conf{'logfile'} eq 'syslog') { if ($Conf{'logfile'} eq 'syslog' && eval { Sys::Syslog->can('openlog') }) {
openlog('pandora_agent', 'nowait', 'daemon'); openlog('pandora_agent', 'nowait', 'daemon');
} else { } else {
open ($LogFileFH, "> $Conf{'logfile'}") or error ("Could not open log file $Conf{'logfile'} for writing: $!."); open ($LogFileFH, "> $Conf{'logfile'}") or error ("Could not open log file $Conf{'logfile'} for writing: $!.");
@ -1425,16 +1433,13 @@ sub start_log (;$) {
# Rotates the agent logfile. # Rotates the agent logfile.
################################################################################ ################################################################################
sub rotate_log () { sub rotate_log () {
if ($Conf{'logfile'} eq 'syslog') { if ($Conf{'logfile'} eq 'syslog' && eval { Sys::Syslog->can('syslog') }) {
# No action needed # No action needed.
return; return;
} else { }else {
if ($Conf{'logrotate'} < 0){ if ($Conf{'logrotate'} < 0){
$Conf{'logrotate'} = DEFAULT_LOG_ROTATE; $Conf{'logrotate'} = DEFAULT_LOG_ROTATE;
} }
if ($Conf{'logfile'} eq 'syslog') {
return;
}
# Rotate file # Rotate file
$LogFileIdx = ($LogFileIdx+1) % $Conf{'logrotate'}; $LogFileIdx = ($LogFileIdx+1) % $Conf{'logrotate'};
@ -1451,7 +1456,7 @@ sub rotate_log () {
# Close the agent logfile and stop logging. # Close the agent logfile and stop logging.
################################################################################ ################################################################################
sub stop_log () { sub stop_log () {
if ($Conf{'logfile'} eq 'syslog') { if ($Conf{'logfile'} eq 'syslog' && eval { Sys::Syslog->can('closelog') }) {
closelog(); closelog();
} else { } else {
close ($LogFileFH); close ($LogFileFH);
@ -1466,7 +1471,7 @@ sub log_message ($$;$) {
if (defined ($dest)) { if (defined ($dest)) {
print $dest strftime ('%Y/%m/%d %H:%M:%S', localtime ()) . " - [$source] - $msg\n"; print $dest strftime ('%Y/%m/%d %H:%M:%S', localtime ()) . " - [$source] - $msg\n";
} elsif ($Conf{'logfile'} eq 'syslog') { } elsif ($Conf{'logfile'} eq 'syslog' && eval { Sys::Syslog->can('syslog') }) {
syslog('info', $msg); syslog('info', $msg);
} else { } else {
#Trying to write into log file to test its writable #Trying to write into log file to test its writable
@ -3749,6 +3754,7 @@ sub module_plugin ($) {
# Do not save the output if there was an error # Do not save the output if there was an error
if ($? != 0) { if ($? != 0) {
log_message ('error', "plugin execution '". $command ."' exited with error code " . $?);
return (); return ();
} }
@ -4376,7 +4382,7 @@ while (1) {
$Xml = $xml_header . $Xml . "</agent_data>"; $Xml = $xml_header . $Xml . "</agent_data>";
# Save XML data file # Save XML data file
my $temp_file = $Conf{'temporal'} . '/' . $Conf{'agent_name'} . '.' . time () . '.data'; my $temp_file = $Conf{'temporal'} . '/' . md5($Conf{'agent_name'}) . '.' . time () . '.data';
error ("File '$temp_file' already exists as a symlink and could not be removed: $!") if (-l $temp_file && !unlink($temp_file)); error ("File '$temp_file' already exists as a symlink and could not be removed: $!") if (-l $temp_file && !unlink($temp_file));
open (TEMP_FILE, "> $temp_file") || error ("Could not write XML data file: $!"); open (TEMP_FILE, "> $temp_file") || error ("Could not write XML data file: $!");
print TEMP_FILE $Xml; print TEMP_FILE $Xml;

View File

@ -3,8 +3,8 @@
# #
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.769 %define version 7.0NG.772
%define release 230313 %define release 230629
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,8 +3,8 @@
# #
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.769 %define version 7.0NG.772
%define release 230313 %define release 230629
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -9,8 +9,8 @@
# 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.769" PI_VERSION="7.0NG.772"
PI_BUILD="230313" PI_BUILD="230629"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -6,21 +6,22 @@
# #
# (c) A. Kevin Rojas <kevin.rojas@pandorafms.com> # (c) A. Kevin Rojas <kevin.rojas@pandorafms.com>
# #
# Edited in 2023 by Alejandro Sánchez <alejandro.sanchez@pandorafms.com>
#
# TO DO LIST: # TO DO LIST:
# - Enable child services detection (Windows) # - Enable child services detection (Windows)
# - Make CPU/Memory usage available for child services (Windows) # - Make CPU/Memory usage available for child services (Windows)
# #
################################################### ###################################################
try: try:
from sys import argv from sys import argv
from sys import stderr from sys import stderr
from sys import exit from sys import exit
import psutil
from subprocess import Popen from subprocess import Popen
from subprocess import PIPE from subprocess import PIPE
from subprocess import DEVNULL from subprocess import DEVNULL
from subprocess import getstatusoutput from subprocess import getstatusoutput
import psutil
except ModuleNotFoundError as err: except ModuleNotFoundError as err:
print("{} error: {}. Exiting...".format(argv[0], err), file=stderr) print("{} error: {}. Exiting...".format(argv[0], err), file=stderr)
exit(1) exit(1)
@ -28,99 +29,100 @@ except ModuleNotFoundError as err:
module_list = [] module_list = []
VERSION = "1.2" VERSION = "1.2"
def win_service(servicelist, option=False, memcpu=False):
######################################################################################### modules_default = []
# Powershell class modules_percentage=[]
######################################################################################### ## take all services
class PSCheck: services=psutil.win_service_iter()
@staticmethod for service in services:
def check_service(servicename, option=False, memcpu=False): if service.name() in servicelist:
"""Check services with powershell by parsing their DisplayName. Returns a dict\ serv=service.as_dict()
list with the name of the service and a boolean with its status.\n if serv['status']=='running':
Requires service name (case insensitive).""" value=1
pscall = Popen(["powershell", "Get-Service", "-Name", "'*"+ str(servicename) + "*'",
"|", "Select-Object", "-ExpandProperty", "Name"],
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
result = pscall.communicate()
result = str(result[0]).strip().split("\n")
procname = ''
if result != '':
output = []
for element in result:
if element != '':
# Get process name
procname = PSCheck.get_serviceprocess(element)
# Get process status
parstatus = PSCheck.getstatus(element)
if memcpu and parstatus == 1:
usage = get_memcpu(str(procname), str(element))
output += usage
# Generate module with name and status
parent = service_module(str(element), parstatus)
output += parent
if option:
children = PSCheck.getchildren(element, memcpu)
if isinstance(children, list) and len(children) > 1:
for child in children:
output += child
else:
output += children
else:
next
if output and element and procname:
return ({"name" : element, "process" : procname, "modules": output})
else: else:
return (None) value=0
@staticmethod ## create module for each service
def getchildren(servicename, memcpu=False): parent = build_module("Service " + str(serv['name']) + " - Status", value,"generic_proc")
"""Gets Dependent services of a given Windows service""" modules_default +=parent
pschild = Popen(["powershell", "Get-Service", "-Name '" + str(servicename) +
"' -DS", "|", "Select-Object", "-ExpandProperty", "Name"], # memory and cpu percentage
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True) if memcpu:
children = pschild.communicate()[0].strip() ## process
kids = [] srv_pid = service.pid()
for child in (children.split("\n") if children != "" else []): process = psutil.Process(srv_pid)
status = PSCheck.getstatus(child) proc_name = process.name()
kids += service_module(str(child), status, "Service " + str(servicename) + " - Status") ##cpu
if status: value_cpu=process.cpu_percent(interval=0.5)
if memcpu: parent = build_module("Service " + str(proc_name) + " - CPU usage", value_cpu,"generic_data")
kidsusage = get_memcpu(str(child)) parent[0].update([("unit","%"),("module_parent",str(serv['name']))])
for usage in kidsusage: modules_percentage +=parent
kids += usage ##mem
value_mem=process.memory_percent()
parent = build_module("Service " + str(proc_name) + " - Memory usage", value_mem,"generic_data")
parent[0].update([("unit","%"),("module_parent",str(serv['name']))])
modules_percentage +=parent
for module in modules_default:
print_module(module, 1)
if memcpu:
for module in modules_percentage:
print_module(module, 1)
def lnx_service(services_list, memcpu=False):
"""Creates modules for Linux servers"""
modules = []
sysctl = getstatusoutput("command -v systemctl")[0]
servic = getstatusoutput("command -v service")[0]
for srvc in services_list:
status = None
if sysctl == 0:
### Systemd available
syscall = Popen(["systemctl", "show", "-pLoadState", "-pActiveState", srvc], stdout=PIPE,
stdin=DEVNULL, universal_newlines=True)
result = syscall.communicate()
srvstatus = result[0].strip().lower().split("\n")
if srvstatus[0] == "loadstate=not-found":
next
else:
if srvstatus[1] == "activestate=active":
modules += build_module("Service " + srvc + " - Status", 1, "generic_proc")
status = 1
elif srvstatus[1] == "activestate=inactive":
modules += build_module("Service " +srvc+ " - Status", 0, "generic_proc")
status = 0
elif sysctl != 0 and servic == 0:
### Systemd not available, switch to service command
syscall = Popen(["service", srvc, "status"], stdout=PIPE,
stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
result = syscall.communicate()[0].lower()
if "is running" in result:
modules += build_module("Service " + srvc + " - Status", 1, "generic_proc")
status = 1
elif "is stopped" in result:
modules += build_module("Service " +srvc+ " - Status", 0, "generic_proc")
status = 0
else: else:
next next
return kids else:
print("No systemd or service commands available. Exiting...", file=stderr)
@staticmethod exit()
def getstatus(servicename): if status:
"""Gets the status of a given Windows service""" module_list.append(srvc)
running = Popen(["powershell", "Get-Service", "-Name '" + str(servicename) + if memcpu:
"' |", "Select-Object", "-ExpandProperty", "Status"], modules += get_memcpu(srvc, None)
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
status = running.communicate()[0].strip() for m in modules:
return int(status == "Running") print_module(m, 1)
@staticmethod
def get_serviceprocess(servicename):
"""Gets name of the process of the service"""
service = psutil.win_service_get(servicename)
srv_pid = service.pid()
process = psutil.Process(srv_pid)
proc_name = process.name()
return proc_name
######################################################################################### def build_module(name, value, module_type, parent=None):
# Services creation
#########################################################################################
def service_module(name, value, parent=None):
#print ("service_module BEGIN "+str(now(0,1))) #print ("service_module BEGIN "+str(now(0,1)))
module = [{ module = [{
"name" : "Service "+ name + " - Status", "name" : name ,
"type" : "generic_proc", "type" : module_type,
"value" : value, "value" : value,
"module_parent" : parent, "module_parent" : parent,
}] }]
@ -167,74 +169,6 @@ def proc_percentbyname(procname): ############# 03/03/2020
next next
#print ("proc_percentbyname END "+str(now(0,1))) #print ("proc_percentbyname END "+str(now(0,1)))
return [sum(memory),sum(cpu)] return [sum(memory),sum(cpu)]
def win_service(servicelist, option=False, memcpu=False):
"""Creates modules for Windows servers."""
modules = []
for srvc in servicelist:
if srvc and len(srvc) > 2:
output = PSCheck.check_service(srvc, option, memcpu)
if output is not None and output["modules"]:
modules += PSCheck.check_service(srvc.strip(), option, memcpu)["modules"]
module_list.append(srvc)
#winprocess = output["name"]
#if memcpu == True:
# modules += get_memcpu(winprocess) ## Only available for parent service ATM.
else:
next
else:
next
for module in modules:
print_module(module, 1)
def lnx_service(services_list, memcpu=False):
"""Creates modules for Linux servers"""
modules = []
sysctl = getstatusoutput("command -v systemctl")[0]
servic = getstatusoutput("command -v service")[0]
for srvc in services_list:
status = None
if sysctl == 0:
### Systemd available
syscall = Popen(["systemctl", "show", "-pLoadState", "-pActiveState", srvc], stdout=PIPE,
stdin=DEVNULL, universal_newlines=True)
result = syscall.communicate()
srvstatus = result[0].strip().lower().split("\n")
if srvstatus[0] == "loadstate=not-found":
next
else:
if srvstatus[1] == "activestate=active":
modules += service_module(srvc, 1)
status = 1
elif srvstatus[1] == "activestate=inactive":
modules += service_module(srvc, 0)
status = 0
elif sysctl != 0 and servic == 0:
### Systemd not available, switch to service command
syscall = Popen(["service", srvc, "status"], stdout=PIPE,
stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
result = syscall.communicate()[0].lower()
if "is running" in result:
modules += service_module(srvc, 1)
status = 1
elif "is stopped" in result:
modules += service_module(srvc, 0)
status = 0
else:
next
else:
print("No systemd or service commands available. Exiting...", file=stderr)
exit()
if status:
module_list.append(srvc)
if memcpu:
modules += get_memcpu(srvc, None)
for m in modules:
print_module(m, 1)
######################################################################################### #########################################################################################
# print_module function # print_module function
######################################################################################### #########################################################################################
@ -356,6 +290,7 @@ def main():
service_list = ["MySQL", "postgresql", "pgsql", "oracle", "MSSQL", "IISADMIN", service_list = ["MySQL", "postgresql", "pgsql", "oracle", "MSSQL", "IISADMIN",
"apache", "nginx", "W3svc", "NTDS", "Netlogon", "DNS", "MSExchangeADTopology", "apache", "nginx", "W3svc", "NTDS", "Netlogon", "DNS", "MSExchangeADTopology",
"MSExchangeServiceHost", "MSExchangeSA", "MSExchangeTransport"] "MSExchangeServiceHost", "MSExchangeSA", "MSExchangeTransport"]
discover(OS, service_list) discover(OS, service_list)
elif psutil.LINUX: elif psutil.LINUX:
OS = "Linux" OS = "Linux"

View File

@ -22,6 +22,11 @@
use strict; use strict;
use File::Basename; use File::Basename;
use Scalar::Util qw(looks_like_number); use Scalar::Util qw(looks_like_number);
BEGIN {
eval {
require MIME::Base64;
};
}
# Output format (module or log_module). # Output format (module or log_module).
my $Output = 'module'; my $Output = 'module';
@ -65,6 +70,37 @@ if ( (defined ($ENV{GREP_LOG_TMP})) && (-d $ENV{GREP_LOG_TMP}) ) {
$Idx_dir=$ENV{GREP_LOG_TMP}; $Idx_dir=$ENV{GREP_LOG_TMP};
} }
# Define encode_base64 if it is not available via MIME::Base64.
my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub {
my ($str, $endl) = @_;
my @ALPHABET = ('A'..'Z', 'a'..'z', 0..9, '+', '/');
my $str_len = length($str);
my $str_base64 = '';
for (my $i = 0; $i < $str_len; $i += 3) {
my $chunk = substr($str, $i, 3);
my $chunk_len = length($chunk);
my $num = 0;
$num |= ord(substr($chunk, 0, 1)) << 16 if ($chunk_len >= 1);
$num |= ord(substr($chunk, 1, 1)) << 8 if ($chunk_len >= 2);
$num |= ord(substr($chunk, 2, 1)) if ($chunk_len == 3);
my $enc_1 = ($num & 0xfc0000) >> 18;
my $enc_2 = ($num & 0x03f000) >> 12;
my $enc_3 = ($num & 0x000fc0) >> 6;
my $enc_4 = ($num & 0x00003f);
$str_base64 .= $ALPHABET[$enc_1];
$str_base64 .= $ALPHABET[$enc_2];
$str_base64 .= $chunk_len >= 2 ? $ALPHABET[$enc_3] : '=';
$str_base64 .= $chunk_len == 3 ? $ALPHABET[$enc_4] : '=';
}
return $str_base64;
};
######################################################################################## ########################################################################################
# Erase blank spaces before and after the string # Erase blank spaces before and after the string
######################################################################################## ########################################################################################
@ -335,11 +371,13 @@ sub print_log ($) {
my $output = "<log_module>\n"; my $output = "<log_module>\n";
$output .= "<source><![CDATA[" . $Module_name . "]]></source>\n"; $output .= "<source><![CDATA[" . $Module_name . "]]></source>\n";
$output .= "<data><![CDATA["; $output .= "<data><![CDATA[";
my $tmp = '';
foreach my $line (@kdata) { foreach my $line (@kdata) {
my $processed_line = $line; foreach my $content (@{$data->{$line}}) {
$processed_line =~ s/\]\]/]]]]><![CDATA[/g; $tmp .= $content;
$output .= $processed_line; }
} }
$output .= &$encode_sub($tmp, '');
$output .= "]]></data>"; $output .= "]]></data>";
$output .= "</log_module>\n"; $output .= "</log_module>\n";

View File

@ -22,6 +22,11 @@
use strict; use strict;
use File::Basename; use File::Basename;
BEGIN {
eval {
require MIME::Base64;
};
}
# Output format (module or log_module). # Output format (module or log_module).
my $Output = 'log_module'; my $Output = 'log_module';
@ -53,6 +58,37 @@ my $Idx_size = 0;
# Regular expression to be matched # Regular expression to be matched
my $Reg_exp = ''; my $Reg_exp = '';
# Define encode_base64 if it is not available via MIME::Base64.
my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub {
my ($str, $endl) = @_;
my @ALPHABET = ('A'..'Z', 'a'..'z', 0..9, '+', '/');
my $str_len = length($str);
my $str_base64 = '';
for (my $i = 0; $i < $str_len; $i += 3) {
my $chunk = substr($str, $i, 3);
my $chunk_len = length($chunk);
my $num = 0;
$num |= ord(substr($chunk, 0, 1)) << 16 if ($chunk_len >= 1);
$num |= ord(substr($chunk, 1, 1)) << 8 if ($chunk_len >= 2);
$num |= ord(substr($chunk, 2, 1)) if ($chunk_len == 3);
my $enc_1 = ($num & 0xfc0000) >> 18;
my $enc_2 = ($num & 0x03f000) >> 12;
my $enc_3 = ($num & 0x000fc0) >> 6;
my $enc_4 = ($num & 0x00003f);
$str_base64 .= $ALPHABET[$enc_1];
$str_base64 .= $ALPHABET[$enc_2];
$str_base64 .= $chunk_len >= 2 ? $ALPHABET[$enc_3] : '=';
$str_base64 .= $chunk_len == 3 ? $ALPHABET[$enc_4] : '=';
}
return $str_base64;
};
############################################################################### ###############################################################################
# SUB error_msg # SUB error_msg
# Print an error message and exit. # Print an error message and exit.
@ -213,11 +249,9 @@ sub print_log (@) {
if ($Output eq 'log_module') { if ($Output eq 'log_module') {
my $output = "<log_module>\n"; my $output = "<log_module>\n";
$output .= "<source><![CDATA[" . $Module_name . "]]></source>\n"; $output .= "<source><![CDATA[" . $Module_name . "]]></source>\n";
$output .= "<encoding>base64</encoding>\n";
$output .= "<data><![CDATA["; $output .= "<data><![CDATA[";
foreach my $line (@data) { $output .= &$encode_sub(join('', @data), '');
$line =~ s/\]\]/]]]]><![CDATA[/g;
$output .= $line;
}
$output .= "]]></data>"; $output .= "]]></data>";
$output .= "</log_module>\n"; $output .= "</log_module>\n";

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:1a0d742e4e1944a599fe7609544719c82ab560590784f0a82733fdba8a7964a3 oid sha256:ad4d006cf2662a57f2e062b5adbfe8702d2147ec4c4d3dc9a1019938fe7d5b22
size 7630848 size 16557020

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes} {Yes}
AppName AppName
{Pandora FMS Windows Agent v7.0NG.769} {Pandora FMS Windows Agent v7.0NG.772}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{230313} {230629}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -520,7 +520,7 @@ Pandora_Module::getXml () {
if (this->module_type == TYPE_LOG) { if (this->module_type == TYPE_LOG) {
module_xml = "<log_module>\n\t<source><![CDATA["; module_xml = "<log_module>\n\t<source><![CDATA[";
module_xml += this->module_name; module_xml += this->module_name;
module_xml += "]]></source>\n\t<data><![CDATA["; module_xml += "]]></source>\n\t<encoding>base64</encoding>\n\t<data><![CDATA[";
if (this->data_list && this->data_list->size () > 1) { if (this->data_list && this->data_list->size () > 1) {
list<Pandora_Data *>::iterator iter; list<Pandora_Data *>::iterator iter;
@ -532,25 +532,19 @@ Pandora_Module::getXml () {
data = *iter; data = *iter;
try { try {
data_clean = strreplace (this->getDataOutput (data), data_clean += this->getDataOutput(data);
"%", "%%" );
data_clean = strreplace (data_clean, "]]>", "]]><![CDATA[");
} catch (Module_Exception e) { } catch (Module_Exception e) {
continue; continue;
} }
module_xml += data_clean;
} }
} else { } else {
data = data_list->front (); data = data_list->front ();
try { try {
data_clean = strreplace (this->getDataOutput (data), "%", "%%" ); data_clean = this->getDataOutput (data);
data_clean = strreplace (data_clean, "]]>", "]]><![CDATA[");
module_xml += data_clean;
} catch (Module_Exception e) { } catch (Module_Exception e) {
} }
} }
module_xml += base64Encode(data_clean);
module_xml += "]]></data></log_module>"; module_xml += "]]></data></log_module>";
/* Clean up */ /* Clean up */

View File

@ -12,6 +12,14 @@ use warnings;
use File::Basename; use File::Basename;
BEGIN { push @INC, '/usr/lib/perl5'; } BEGIN { push @INC, '/usr/lib/perl5'; }
# NOTE: The binary compiled with PAR::Packer for Pandora FMS doesn't work well
# with JSON:XS, probably because JSON::Backend::XS is defined in the __DATA__
# section of JSON.pm and that doesn't work well with PAR::Filter. If this
# becomes a bottleneck, a workaround would be possible (e.g., redefining
# JSON::Backend::XS here).
BEGIN { $ENV{PERL_JSON_BACKEND} = 'JSON::PP' };
use PandoraFMS::PluginTools; use PandoraFMS::PluginTools;
use PandoraFMS::Omnishell; use PandoraFMS::Omnishell;
@ -90,4 +98,4 @@ if ($@) {
exit 0; exit 0;
} }
exit 0; exit 0;

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.769 Build 230313") #define PANDORA_VERSION ("7.0NG.772 Build 230629")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -24,6 +24,8 @@
#include <sstream> #include <sstream>
#include <stdexcept> #include <stdexcept>
#include <cstring> // for strchr #include <cstring> // for strchr
#include <vector>
#include <iterator>
using namespace Pandora; using namespace Pandora;
@ -56,6 +58,54 @@ Pandora_Strutils::trim (const string str) {
return result; return result;
} }
/**
* Encode the given string to base64.
* Based on: https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64
*
* @param str String to be encoded.
*
* @return The base64 encoded string.
*/
string
Pandora_Strutils::base64Encode(string str) {
string base64_str;
std::uint32_t temp;
const static char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
std::vector<std::uint8_t> buffer(begin(str), end(str));
base64_str.reserve(((buffer.size() / 3) + (buffer.size() % 3 > 0)) * 4);
std::vector<std::uint8_t>::iterator cursor = buffer.begin();
for(size_t idx = 0; idx < buffer.size() / 3; idx++) {
temp = (*cursor++) << 16;
temp += (*cursor++) << 8;
temp += (*cursor++);
base64_str.append(1, alphabet[(temp & 0x00FC0000) >> 18]);
base64_str.append(1, alphabet[(temp & 0x0003F000) >> 12]);
base64_str.append(1, alphabet[(temp & 0x00000FC0) >> 6]);
base64_str.append(1, alphabet[(temp & 0x0000003F)]);
}
switch(buffer.size() % 3){
case 1:
temp = (*cursor++) << 16;
base64_str.append(1, alphabet[(temp & 0x00FC0000) >> 18]);
base64_str.append(1, alphabet[(temp & 0x0003F000) >> 12]);
base64_str.append(2, '=');
break;
case 2:
temp = (*cursor++) << 16;
temp += (*cursor++) << 8;
base64_str.append(1, alphabet[(temp & 0x00FC0000) >> 18]);
base64_str.append(1, alphabet[(temp & 0x0003F000) >> 12]);
base64_str.append(1, alphabet[(temp & 0x00000FC0) >> 6]);
base64_str.append(1, '=');
break;
}
return base64_str;
}
/** /**
* Convert an unicode string to a ANSI string. * Convert an unicode string to a ANSI string.
* *

View File

@ -44,6 +44,7 @@ namespace Pandora_Strutils {
string trim (const string str); string trim (const string str);
string base64Encode(string str);
string strUnicodeToAnsi (LPCWSTR s); string strUnicodeToAnsi (LPCWSTR s);
wstring strAnsiToUnicode (LPCSTR s); wstring strAnsiToUnicode (LPCSTR s);
string inttostr (const int i); string inttostr (const int i);

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.769(Build 230313))" VALUE "ProductVersion", "(7.0NG.772(Build 230629))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -99,7 +99,7 @@ Pandora_Wmi::isServiceRunning (string service_name) {
string query; string query;
char *state; char *state;
string str_state; string str_state;
int retval; int retval = -1;
query = "SELECT * FROM Win32_Service WHERE Name = \"" + service_name + "\""; query = "SELECT * FROM Win32_Service WHERE Name = \"" + service_name + "\"";
@ -112,23 +112,27 @@ Pandora_Wmi::isServiceRunning (string service_name) {
FOR_EACH (quickfix, quickfixes, NULL) { FOR_EACH (quickfix, quickfixes, NULL) {
dhGetValue (L"%s", &state, quickfix, dhGetValue (L"%s", &state, quickfix,
L".State"); L".State");
str_state = state; if (retval == -1) {
if (str_state == "Running") { str_state = state;
retval = 1; if (str_state == "Running") {
} retval = 1;
else { }
retval = 0; else {
retval = 0;
}
} }
dhFreeString (state); dhFreeString (state);
return retval;
} NEXT_THROW (quickfix); } NEXT_THROW (quickfix);
} catch (string errstr) { } catch (string errstr) {
pandoraLog ("isServiceRunning error. %s", errstr.c_str ()); pandoraLog ("isServiceRunning error. %s", errstr.c_str ());
} }
pandoraDebug ("Service %s not found.", service_name.c_str ()); if (retval == -1) {
return 0; pandoraDebug ("Service %s not found.", service_name.c_str ());
return 0;
}
return retval;
} }
/** /**
@ -1261,7 +1265,7 @@ Pandora_Wmi::getSystemAddress () {
CDispPtr wmi_svc = NULL, nic_info = NULL; CDispPtr wmi_svc = NULL, nic_info = NULL;
VARIANT ip_addresses; VARIANT ip_addresses;
char *caption = NULL, *mac_address = NULL; char *caption = NULL, *mac_address = NULL;
string ret = ""; string str_addr, ret = "";
try { try {
@ -1274,12 +1278,12 @@ Pandora_Wmi::getSystemAddress () {
dhGetValue (L"%v", &ip_addresses, nic_info_item, dhGetValue (L"%v", &ip_addresses, nic_info_item,
L".IPAddress"); L".IPAddress");
if (&ip_addresses != NULL) if (&ip_addresses != NULL && ret == "")
{ {
ret = getIPs(&ip_addresses); str_addr = getIPs(&ip_addresses);
if(ret != "0.0.0.0") { if (str_addr != "0.0.0.0") {
break; ret = str_addr;
} }
} }
} NEXT_THROW (nic_info_item); } NEXT_THROW (nic_info_item);
} catch (string errstr) { } catch (string errstr) {

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.769-230313 Version: 7.0NG.772-230629
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.769-230313" pandora_version="7.0NG.772-230629"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.
@ -185,7 +185,7 @@ if (isset($config['force_instant_logout']) === true
header_remove('Set-Cookie'); header_remove('Set-Cookie');
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
if ($config['auth'] === 'saml') { if ($config['auth'] === 'saml' && empty($public_hash) === true) {
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php'; include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
$as = new SimpleSAML_Auth_Simple('PandoraFMS'); $as = new SimpleSAML_Auth_Simple('PandoraFMS');
$as->logout(); $as->logout();

View File

@ -9,15 +9,16 @@
], ],
"config": { "config": {
"platform": { "platform": {
"php": "8.0.0" "php": "8.0.2"
} }
}, },
"require": { "require": {
"mpdf/mpdf": "^8.0.15", "mpdf/mpdf": "^8.0.15",
"swiftmailer/swiftmailer": "^6.0", "swiftmailer/swiftmailer": "^6.0",
"amphp/parallel-functions": "^1.0", "amphp/parallel-functions": "^1.0",
"chrome-php/chrome": "^1.7.1", "chrome-php/chrome": "^1.8.1",
"artica/phpchartjs": "^1.0" "artica/phpchartjs": "^1.0",
"tinymce/tinymce": "^6.4"
}, },
"repositories": { "repositories": {
"phpchartjs": { "phpchartjs": {

File diff suppressed because it is too large Load Diff

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.
@ -259,6 +259,14 @@ function agents_modules_load_js()
return results[1]; return results[1];
} }
} }
function select_selected () {
// $('#id_agents2 option').each(function(){
// if($(this).attr('selected') === 'selected'){
// $(this).prop('selected', true);
// }
// });
}
</script> </script>
<?php <?php
} }
@ -645,7 +653,7 @@ function mainAgentsModules()
} }
if ($config['pure'] != 1) { if ($config['pure'] != 1) {
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" class="w100p">'; $show_filters = '<form method="post" action="index.php?sec=view&sec2=extensions/agents_modules" class="w100p">';
$show_filters .= '<table class="filter-table-adv w100p no-border" cellpadding="4" cellspacing="4">'; $show_filters .= '<table class="filter-table-adv w100p no-border" cellpadding="4" cellspacing="4">';
$show_filters .= '<tr>'; $show_filters .= '<tr>';
$show_filters .= '<td width="33%">'.$filter_type.'</td>'; $show_filters .= '<td width="33%">'.$filter_type.'</td>';
@ -666,8 +674,9 @@ function mainAgentsModules()
'srcbutton', 'srcbutton',
false, false,
[ [
'icon' => 'search', 'icon' => 'search',
'mode' => 'mini', 'mode' => 'mini',
'onclick' => 'select_selected()',
], ],
true true
), ),
@ -729,16 +738,31 @@ function mainAgentsModules()
if (isset($modules_selected[0]) === true && $modules_selected[0]) { if (isset($modules_selected[0]) === true && $modules_selected[0]) {
$all_modules = []; $all_modules = [];
foreach ($modules_selected as $key => $value) { foreach ($modules_selected as $key => $value) {
$name = modules_get_agentmodule_name($value); if ((int) $value > 0) {
$sql = "SELECT id_agente_modulo $name = modules_get_agentmodule_name($value);
FROM tagente_modulo $sql = "SELECT id_agente_modulo
WHERE nombre = '".$name."';"; FROM tagente_modulo
WHERE nombre = '".$name."';";
$result_sql = db_get_all_rows_sql($sql); $result_sql = db_get_all_rows_sql($sql);
if (is_array($result_sql)) { if (is_array($result_sql)) {
foreach ($result_sql as $key => $value) { foreach ($result_sql as $key => $value) {
$all_modules[$value['id_agente_modulo']] = io_safe_output($name); $all_modules[$value['id_agente_modulo']] = io_safe_output($name);
}
}
} else {
$name = $value;
$sql = "SELECT id_agente_modulo
FROM tagente_modulo
WHERE nombre = '".$name."';";
$result_sql = db_get_all_rows_sql($sql);
if (is_array($result_sql)) {
foreach ($result_sql as $key => $value) {
$all_modules[$value['id_agente_modulo']] = io_safe_output($name);
}
} }
} }
} }
@ -838,7 +862,7 @@ function mainAgentsModules()
echo '<tr>'; echo '<tr>';
echo "<th width='140px' class='pdd_r_10px align_right'>".__('Agents').' / '.__('Modules').'</th>'; echo "<th width='40px' class='pdd_r_10px align_left'>".__('Agents').' / '.__('Modules').'</th>';
if ($hor_offset > 0) { if ($hor_offset > 0) {
$new_hor_offset = ($hor_offset - $block); $new_hor_offset = ($hor_offset - $block);
@ -958,7 +982,7 @@ function mainAgentsModules()
foreach ($module['id'] as $module_id) { foreach ($module['id'] as $module_id) {
if (!$match && array_key_exists($module_id, $agent_modules)) { if (!$match && array_key_exists($module_id, $agent_modules)) {
echo "<td class='center'>"; echo "<td class='center' style='text-align:left;'>";
$win_handle = dechex(crc32($module_id.$module['name'])); $win_handle = dechex(crc32($module_id.$module['name']));
$graph_type = return_graphtype(modules_get_agentmodule_type($module_id)); $graph_type = return_graphtype(modules_get_agentmodule_type($module_id));
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."', 800, 480)"; $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."', 800, 480)";

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
@ -136,7 +136,7 @@ function dbmgr_extension_main()
__( __(
"This is an advanced extension to interface with %s database directly from WEB console "This is an advanced extension to interface with %s database directly from WEB console
using native SQL sentences. Please note that <b>you can damage</b> your %s installation using native SQL sentences. Please note that <b>you can damage</b> your %s installation
if you don't know </b>exactly</b> what are you are doing, if you don't know </b>exactly</b> what you are doing,
this means that you can severily damage your setup using this extension. this means that you can severily damage your setup using this extension.
This extension is intended to be used <b>only by experienced users</b> This extension is intended to be used <b>only by experienced users</b>
with a depth knowledge of %s internals.", with a depth knowledge of %s internals.",

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2
@ -240,7 +240,28 @@ function pandora_files_repo_operation()
} }
// Header. // Header.
ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader); ui_print_standard_header(
__('Files repository'),
'images/extensions.png',
false,
'',
false,
$onheader,
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('Files repository'),
],
]
);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/'; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php'; include_once $full_extensions_dir.'files_repo/functions_files_repo.php';

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License // modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -0,0 +1,7 @@
# /etc/httpd/conf/httpd.conf -> AllowOverride All -> service httpd restart
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

View File

@ -0,0 +1,66 @@
<?php
// Allow Grafana proxy
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, X-Grafana-Org-Id, X-Grafana-NoCache, X-DS-Authorization');
// Get all request headers
$headers = apache_request_headers();
// Check if user and password has been sent
if ($headers['Authorization']) {
$headers['X-DS-Authorization'] = $headers['Authorization'];
}
if ($headers['X-DS-Authorization']) {
include_once '../../include/config.php';
global $config;
include_once $config['homedir'].'/include/functions_config.php';
include_once $config['homedir'].'/include/functions.php';
list($user, $password) = explode(':', base64_decode($headers['X-DS-Authorization']));
// Check user login
$user_in_db = process_user_login($user, $password, true);
if ($user_in_db !== false) {
// Check user ACL
if (check_acl($user_in_db, 0, 'AR')) {
$result_array = [
'code' => 200,
'message' => 'Access granted',
];
} else {
$result_array = [
'code' => 403,
'message' => 'Access forbidden',
];
}
} else {
$result_array = [
'code' => 401,
'message' => 'Unauthorized',
];
}
} else {
// OPTIONS request automatically works
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
$result_array = [
'code' => 200,
'message' => 'Options request accepted',
];
} else {
$result_array = [
'code' => 401,
'message' => 'Unauthorized',
];
}
}
// Numeric data in array must be numeric data in json (not text)
$result = json_encode($result_array, JSON_NUMERIC_CHECK);
echo $result;

View File

@ -0,0 +1,139 @@
<?php
// Allow Grafana proxy.
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, X-Grafana-Org-Id, X-Grafana-NoCache, X-DS-Authorization');
// Get all request headers.
$headers = apache_request_headers();
$result_array = [];
// Check if user and password has been sent.
if ($headers['Authorization']) {
// Get all POST data sent.
$payload = json_decode(file_get_contents('php://input'), true);
include_once '../../include/config.php';
global $config;
include_once $config['homedir'].'/include/functions_config.php';
include_once $config['homedir'].'/include/functions.php';
list($user, $password) = explode(':', base64_decode($headers['Authorization']));
// Check user login
$user_in_db = process_user_login($user, $password, true);
if ($user_in_db !== false) {
// Check user ACL
if (check_acl($user_in_db, 0, 'AR')) {
include_once $config['homedir'].'/include/functions_db.php';
include_once $config['homedir'].'/include/functions_graph.php';
// Get graph data for each Grafana target
foreach ($payload['targets'] as $target) {
$sql_results = [];
$result_data = [];
// Decode target data sent by datasource plugin in Grafana
$target_data = json_decode($target['target'], true);
if ($target_data['module']) {
// Get module name as target if not defined in Grafana.
if (!$target_data['target']) {
$target_data['target'] = io_safe_output(db_get_value_sql('SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = '.$target_data['module']));
}
$target_data['interval'] = db_get_value_sql('SELECT module_interval FROM tagente_modulo WHERE id_agente_modulo = '.$target_data['module']);
$params = [
'agent_module_id' => $target_data['module'],
'period' => (strtotime($payload['range']['to']) - strtotime($payload['range']['from'])),
'date' => strtotime($payload['range']['to']),
'return_data' => 1,
'show_unknown' => true,
'fullscale' => (bool) $target_data['tip'],
'time_interval' => $target_data['interval'],
];
// Get all data.
$data = grafico_modulo_sparse($params);
$unknown_timestamps = [];
// Set unknown data as null.
foreach ($data['unknown1']['data'] as $d) {
if (($d[1] == 1 && !$params['fullscale']) || ($d[1] == 0 && $params['fullscale'])) {
$result_data[] = [
null,
$d[0],
];
}
$unknown_timestamps[] = $d[0];
}
// Get each data if not in unknown timestamps
foreach ($data['sum1']['data'] as $d) {
if ($d[1] != false && !in_array($d[0], $unknown_timestamps)) {
$result_data[] = [
$d[1],
$d[0],
];
}
}
// Sort all data by utimestamp (Grafana needs it).
usort(
$result_data,
function ($a, $b) {
return $a[1] > $b[1] ? 1 : -1;
}
);
$rows = [];
foreach ($result_data as $k => $v) {
if (($result_data[$k][0] !== $result_data[($k - 1)][0]
|| $result_data[$k][0] !== $result_data[($k + 1)][0])
|| ($result_data[($k - 1)][0] === null
&& $result_data[$k][0] !== null
&& $result_data[$k][1] != (strtotime($payload['range']['to']) * 1000))
|| ($result_data[($k - 1)][0] === $result_data[$k][0] && $result_data[$k][1] == (strtotime($payload['range']['to']) * 1000))
) {
$rows[] = $result_data[$k];
}
}
if (!$params['fullscale']) {
$target_data['target'] .= ' (avg)';
}
// Set all target info and data
$result_array[] = [
'type' => 'table',
'target' => $target_data['target'],
'refId' => $target_data['target'],
'columns' => [
[
'text' => $target_data['target'],
],
[
'text' => 'Time',
'type' => 'time',
],
],
'datapoints' => array_values($rows),
];
}
}
}
}
}
// Numeric data in array must be numeric data in json (not text).
$result = json_encode($result_array, JSON_NUMERIC_CHECK);
echo $result;

View File

@ -0,0 +1,87 @@
<?php
// Allow Grafana proxy
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, X-Grafana-Org-Id, X-Grafana-NoCache, X-DS-Authorization');
// Get all request headers
$headers = apache_request_headers();
$result_array = [];
// Check if user and password has been sent
if ($headers['Authorization']) {
// Get all POST data sent
$payload = json_decode(file_get_contents('php://input'), true);
include_once '../../include/config.php';
global $config;
include_once $config['homedir'].'/include/functions_config.php';
include_once $config['homedir'].'/include/functions.php';
list($user, $password) = explode(':', base64_decode($headers['Authorization']));
// Check user login
$user_in_db = process_user_login($user, $password, true);
if ($user_in_db !== false) {
// Check user ACL
if (check_acl($user_in_db, 0, 'AR')) {
include_once $config['homedir'].'/include/functions_db.php';
// If search is for groups
if ($payload['type'] == 'group') {
// Include group ALL
$result_array[] = [
'value' => 0,
'text' => 'All',
];
// Get groups that match the search
$sql = 'SELECT nombre, id_grupo id FROM tgrupo WHERE LOWER(nombre) LIKE LOWER("%'.io_safe_input($payload['search']).'%")';
// If search is for agents
} else if ($payload['type'] == 'agent') {
// Get agents that match the search
$sql = 'SELECT a.alias nombre, a.id_agente id FROM tagente a, tgrupo g WHERE a.disabled = 0 AND a.id_grupo = g.id_grupo AND LOWER(a.alias) LIKE LOWER("%'.io_safe_input($payload['search']).'%")';
// If search group is not all, add extra filter
if ($payload['extra'] != 0) {
$sql .= ' AND g.id_grupo = "'.io_safe_input($payload['extra']).'"';
}
// If search is for modules
} else if ($payload['type'] == 'module') {
// Get modules that match the search (not string)
$sql = 'SELECT m.nombre nombre, m.id_agente_modulo id FROM tagente_modulo m, tagente a, ttipo_modulo t WHERE m.disabled = 0 AND m.id_agente = a.id_agente AND t.id_tipo = m.id_tipo_modulo AND a.id_agente = "'.io_safe_input($payload['extra']).'" AND LOWER(m.nombre) LIKE LOWER("%'.io_safe_input($payload['search']).'%") AND t.nombre NOT LIKE "%string"';
}
// Run query
$sql_results = db_get_all_rows_sql($sql);
foreach ($sql_results as $sql_result) {
// If search is for groups, only add those with permissions
if ($payload['type'] == 'group') {
if (check_acl($user_in_db, $sql_result['id'], 'AR')) {
$result_array[] = [
'value' => $sql_result['id'],
'text' => io_safe_output($sql_result['nombre']),
];
}
} else {
$result_array[] = [
'value' => $sql_result['id'],
'text' => io_safe_output($sql_result['nombre']),
];
}
}
}
}
}
$result = json_encode($result_array, JSON_UNESCAPED_UNICODE);
echo $result;

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.
@ -31,7 +31,7 @@ global $config;
check_login(); check_login();
// ACL Check. // ACL Check.
if (!check_acl($config['id_user'], 0, 'AR')) { if (check_acl($config['id_user'], 0, 'AR') === 0 && check_acl($config['id_user'], 0, 'RR') === 0) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
'Trying to access Module Groups view' 'Trying to access Module Groups view'

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.
@ -140,25 +140,26 @@ function quickShell()
ui_print_error_message(__('WebService engine has not been started, please check documentation.')); ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
$wiz->printForm( $wiz->printForm(
[ [
'form' => [ 'form' => [
'method' => 'POST', 'method' => 'POST',
'action' => '#', 'action' => '#',
], 'id' => 'retry_form',
'inputs' => [
[
'class' => 'w100p',
'arguments' => [
'name' => 'submit',
'label' => __('Retry'),
'type' => 'submit',
'attributes' => ['icon' => 'next'],
'return' => true,
],
],
], ],
] ]
); );
html_print_action_buttons(
html_print_submit_button(
__('Retry'),
'submit',
false,
[
'icon' => 'next',
'form' => 'retry_form',
],
true
)
);
return; return;
} }
@ -168,6 +169,7 @@ function quickShell()
'action' => '#', 'action' => '#',
'class' => 'wizard', 'class' => 'wizard',
'method' => 'post', 'method' => 'post',
'id' => 'connect_form',
], ],
'inputs' => [ 'inputs' => [
[ [
@ -198,19 +200,24 @@ function quickShell()
'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);", 'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);",
], ],
], ],
[
'arguments' => [
'type' => 'submit',
'label' => __('Connect'),
'attributes' => ['icon' => 'cog'],
],
],
], ],
], ],
false, false,
true true
); );
html_print_action_buttons(
html_print_submit_button(
__('Connect'),
'submit',
false,
[
'icon' => 'cog',
'form' => 'connect_form',
],
true
)
);
return; return;
} }
@ -434,84 +441,95 @@ function quickShellSettings()
} }
// Form. Using old style. // Form. Using old style.
echo '<fieldset>'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Quickshell').'</legend>'; echo '<legend>'.__('Quickshell').'</legend>';
$t = new StdClass(); $t = new StdClass();
$t->data = []; $t->data = [];
$t->width = '100%'; $t->width = '100%';
$t->class = 'databox filters'; $t->class = 'filter-table-adv';
$t->data = []; $t->data = [];
$t->style = []; $t->style = [];
$t->style[0] = 'font-weight: bold; width: 40%;'; $t->style[0] = 'width: 50%;';
$t->data[0][0] = __('Gotty path'); $t->data[0][] = html_print_label_input_block(
$t->data[0][1] = html_print_input_text( __('Gotty path'),
'gotty', html_print_input_text(
$config['gotty'], 'gotty',
'', $config['gotty'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[1][0] = __('Gotty host'); $t->data[0][] = html_print_label_input_block(
$t->data[1][1] = html_print_input_text( __('Gotty host'),
'gotty_host', html_print_input_text(
$config['gotty_host'], 'gotty_host',
'', $config['gotty_host'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[2][0] = __('Gotty ssh port'); $t->data[1][] = html_print_label_input_block(
$t->data[2][1] = html_print_input_text( __('Gotty ssh port'),
'gotty_ssh_port', html_print_input_text(
$config['gotty_ssh_port'], 'gotty_ssh_port',
'', $config['gotty_ssh_port'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[3][0] = __('Gotty telnet port'); $t->data[1][] = html_print_label_input_block(
$t->data[3][1] = html_print_input_text( __('Gotty telnet port'),
'gotty_telnet_port', html_print_input_text(
$config['gotty_telnet_port'], 'gotty_telnet_port',
'', $config['gotty_telnet_port'],
30, '',
100, 30,
true 100,
true
)
); );
$hidden = new StdClass(); $hidden = new stdClass();
$hidden->data = []; $hidden->data = [];
$hidden->width = '100%'; $hidden->width = '100%';
$hidden->class = 'databox filters'; $hidden->class = 'filter-table-adv';
$hidden->data = []; $hidden->data = [];
$hidden->style[0] = 'font-weight: bold;width: 40%;'; $hidden->style[0] = 'width: 50%;';
$hidden->data[0][0] = __('Gotty user'); $hidden->data[0][] = html_print_label_input_block(
$hidden->data[0][1] = html_print_input_text( __('Gotty user'),
'gotty_user', html_print_input_text(
$config['gotty_user'], 'gotty_user',
'', $config['gotty_user'],
30, '',
100, 30,
true 100,
true
)
); );
$hidden->data[1][0] = __('Gotty password'); $hidden->data[0][] = html_print_label_input_block(
$hidden->data[1][1] = html_print_input_password( __('Gotty password'),
'gotty_pass', html_print_input_password(
io_output_password($config['gotty_pass']), 'gotty_pass',
'', io_output_password($config['gotty_pass']),
30, '',
100, 30,
true 100,
true
)
); );
$hidden->data[1][1] .= ui_print_reveal_password('gotty_pass', true);
html_print_table($t); html_print_table($t);

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.
@ -186,10 +186,6 @@ function pandora_realtime_graphs()
$table->data[] = $data; $table->data[] = $data;
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
echo snmp_browser_print_container(true, '100%', '60%', 'none');
}
// Print the relative path to AJAX calls. // Print the relative path to AJAX calls.
html_print_input_hidden('rel_path', get_parameter('rel_path', '')); html_print_input_hidden('rel_path', get_parameter('rel_path', ''));
@ -224,7 +220,7 @@ function pandora_realtime_graphs()
false, false,
'', '',
'white-box-content', 'white-box-content',
'box-flat white_table_graph fixed_filter_bar' 'box-flat white_table_graph fixed_filter_bar top_0px_important mrgn_btn_35px_imp'
); );
$chart[time()]['graph'] = '0'; $chart[time()]['graph'] = '0';
@ -266,6 +262,16 @@ function pandora_realtime_graphs()
] ]
); );
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
html_print_div(
[
'class' => 'white_box',
'id' => 'graph_snmp_interface',
'content' => snmp_browser_print_container(true, '100%', '60%', '', false, false),
]
);
}
// echo $canvas; // echo $canvas;
// Define a custom action to save // Define a custom action to save
// the OID selected in the SNMP browser to the form. // the OID selected in the SNMP browser to the form.
@ -280,10 +286,10 @@ function pandora_realtime_graphs()
); );
html_print_input_hidden('incremental_base', '0'); html_print_input_hidden('incremental_base', '0');
echo '<script type="text/javascript" src="'.ui_get_full_url('include/javascript/pandora_snmp_browser.js').'"></script>'; echo '<script type="text/javascript" src="'.ui_get_full_url('include/javascript/pandora_snmp_browser.js').'?v='.$config['current_package'].'"></script>';
echo '<script type="text/javascript" src="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.js').'"></script>'; echo '<script type="text/javascript" src="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.js').'?v='.$config['current_package'].'"></script>';
if ($config['style'] !== 'pandora_black') { if ($config['style'] !== 'pandora_black') {
echo '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.css').'"></style>'; echo '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.css').'?v='.$config['current_package'].'"></style>';
} }
// Store servers timezone offset to be retrieved from js. // Store servers timezone offset to be retrieved from js.

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.
@ -453,7 +453,7 @@ function resource_exportation_extension_main()
true true
) )
); );
$table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', ['mode' => 'link'], true); $table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr("report");', ['mode' => 'link'], true);
$table->data[1][] = html_print_label_input_block( $table->data[1][] = html_print_label_input_block(
__('Visual console'), __('Visual console'),
@ -465,7 +465,7 @@ function resource_exportation_extension_main()
true true
) )
); );
$table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', ['mode' => 'link'], true); $table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr("visual_console");', ['mode' => 'link'], true);
if ($hook_enterprise === true) { if ($hook_enterprise === true) {
add_rows_for_enterprise($table->data); add_rows_for_enterprise($table->data);

View File

@ -10,13 +10,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.

View File

@ -10,13 +10,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.

View File

@ -1,5 +1,28 @@
START TRANSACTION; START TRANSACTION;
CREATE TABLE IF NOT EXISTS `tconsole` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_console` BIGINT NOT NULL DEFAULT 0,
`description` TEXT,
`version` TINYTEXT,
`last_execution` INT UNSIGNED NOT NULL DEFAULT 0,
`console_type` TINYINT NOT NULL DEFAULT 0,
`timezone` TINYTEXT,
`public_url` TEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
ALTER TABLE `tuser_task_scheduled` ADD COLUMN `id_console` BIGINT NOT NULL DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `ssh_status` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `db_status` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `replication_status` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `replication_delay` BIGINT DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `master` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `utimestamp` BIGINT DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `mysql_version` VARCHAR(10) DEFAULT '';
ALTER TABLE `tdatabase` ADD COLUMN `pandora_version` VARCHAR(10) DEFAULT '';
UPDATE tconfig_os SET `icon_name` = 'linux@os.svg' WHERE `id_os` = 1; UPDATE tconfig_os SET `icon_name` = 'linux@os.svg' WHERE `id_os` = 1;
UPDATE tconfig_os SET `icon_name` = 'solaris@os.svg' WHERE `id_os` = 2; UPDATE tconfig_os SET `icon_name` = 'solaris@os.svg' WHERE `id_os` = 2;
UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3; UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3;
@ -155,4 +178,23 @@ INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`, `filename`, `path`) VALUES
(20, 'zoom_en_graficas.png', 'images/tips/'), (20, 'zoom_en_graficas.png', 'images/tips/'),
(22, 'politica_de_pass.png', 'images/tips/'); (22, 'politica_de_pass.png', 'images/tips/');
ALTER TABLE `tusuario` ADD COLUMN `show_tips_startup` TINYINT UNSIGNED NOT NULL DEFAULT 1;
CREATE TABLE IF NOT EXISTS `tfavmenu_user` (
`id` INT NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(255) NOT NULL,
`id_element` TEXT,
`url` TEXT NOT NULL,
`label` VARCHAR(255) NOT NULL,
`section` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`));
ALTER TABLE `tnetflow_filter` ADD COLUMN `netflow_monitoring` TINYINT UNSIGNED NOT NULL default 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_max` INTEGER NOT NULL default 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_critical` float(20,2) NOT NULL default 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_warning` float(20,2) NOT NULL default 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `netflow_monitoring_interval` INT UNSIGNED NOT NULL DEFAULT 300;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('legacy_database_ha', 1);
COMMIT; COMMIT;

View File

@ -0,0 +1,43 @@
START TRANSACTION;
ALTER TABLE tpolicy_group_agents CONVERT TO CHARACTER SET UTF8MB4;
ALTER TABLE tevent_sound CONVERT TO CHARACTER SET UTF8MB4;
ALTER TABLE tsesion_filter CONVERT TO CHARACTER SET UTF8MB4;
CREATE TABLE IF NOT EXISTS `tsesion_filter` (
`id_filter` INT NOT NULL AUTO_INCREMENT,
`id_name` TEXT NULL,
`text` TEXT NULL,
`period` TEXT NULL,
`ip` TEXT NULL,
`type` TEXT NULL,
`user` TEXT NULL,
PRIMARY KEY (`id_filter`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tsesion_filter_log_viewer` (
`id_filter` INT NOT NULL AUTO_INCREMENT,
`id_name` TEXT NULL,
`id_group_filter` TEXT NULL,
`id_search_mode` INT NULL,
`order` VARCHAR(45) NULL,
`search` VARCHAR(255) NULL,
`group_id` INT NULL,
`date_range` TINYINT NULL,
`start_date_defined` VARCHAR(45) NULL,
`start_date_time` VARCHAR(45) NULL,
`start_date_date` VARCHAR(45) NULL,
`start_date_date_range` VARCHAR(45) NULL,
`start_date_time_range` VARCHAR(45) NULL,
`end_date_date_range` VARCHAR(45) NULL,
`end_date_time_range` VARCHAR(45) NULL,
`agent` VARCHAR(255) NULL,
`source` VARCHAR(255) NULL,
`display_mode` INT NULL,
`capture_model` INT NULL,
`graph_type` INT NULL,
PRIMARY KEY (`id_filter`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
ALTER TABLE `talert_template_module_actions` ADD COLUMN `recovered` TINYINT NOT NULL DEFAULT 0;
COMMIT;

View File

@ -0,0 +1,88 @@
START TRANSACTION;
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'You&#x20;know&#x20;reports&#x20;of&#x20;Availability?','They&#x20;are&#x20;very&#x20;useful&#x20;as&#x20;they&#x20;tell&#x20;you&#x20;how&#x20;long&#x20;&#40;%&#41;&#x20;a&#x20;check&#x20;has&#x20;been&#x20;in&#x20;different&#x20;states&#x20;over&#x20;a&#x20;period&#x20;of&#x20;time,&#x20;say&#x20;a&#x20;week.&#x20;It&#x20;offers&#x20;complete&#x20;raw&#x20;data&#x20;of&#x20;what&#x20;has&#x20;been&#x20;done&#x20;in&#x20;enough&#x20;detail&#x20;to&#x20;convince&#x20;a&#x20;vendor&#x20;or&#x20;customer.','',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'informe_disponibiliad.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Did&#x20;you&#x20;know&#x20;that&#x20;you&#x20;can&#x20;monitor&#x20;websites?','In&#x20;a&#x20;simple&#x20;way&#x20;through&#x20;standard&#x20;or&#x20;transactional&#x20;HTTP&#x20;checks&#x20;through&#x20;centralized&#x20;WUX&#x20;transactions,&#x20;or&#x20;decentralized&#x20;with&#x20;the&#x20;UX&#x20;agent&#x20;plugin.','https://pandorafms.com/manual/en/documentation/03_monitoring/06_web_monitoring',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'monitorizar_web.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Did&#x20;you&#x20;know&#x20;that&#x20;each&#x20;user&#x20;can&#x20;have&#x20;their&#x20;own&#x20;Time&#x20;Zone?','Different&#x20;time&#x20;zones&#x20;can&#x20;be&#x20;established&#x20;for&#x20;each&#x20;user,&#x20;so&#x20;that&#x20;it&#x20;interprets&#x20;the&#x20;data&#x20;taking&#x20;into&#x20;account&#x20;the&#x20;time&#x20;difference.&#x20;Pandora&#x20;FMS&#x20;can&#x20;also&#x20;have&#x20;servers&#x20;and&#x20;agents&#x20;in&#x20;different&#x20;time&#x20;zones.&#x20;All&#x20;over&#x20;the&#x20;world!','',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'usuario_zona_horaria.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Does&#x20;your&#x20;network&#x20;lose&#x20;packets?','You&#x20;can&#x20;measure&#x20;the&#x20;packet&#x20;loss&#x20;in&#x20;your&#x20;network&#x20;using&#x20;an&#x20;agent&#x20;and&#x20;a&#x20;free&#x20;plugin&#x20;called&#x20;&ldquo;Packet&#x20;Loss&rdquo;.&#x20;This&#x20;is&#x20;especially&#x20;useful&#x20;on&#x20;Wi-Fi&#x20;networks&#x20;or&#x20;networks&#x20;shared&#x20;with&#x20;many&#x20;users.&#x20;We&#x20;wrote&#x20;an&#x20;article&#x20;on&#x20;our&#x20;blog&#x20;talking&#x20;about&#x20;it,&#x20;check&#x20;it&#x20;out','https://pandorafms.com/blog/packet-loss/',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'tu_red_pierde_paquetes.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Console&#x20;Internal&#x20;Audit','The&#x20;console&#x20;logs&#x20;all&#x20;relevant&#x20;activities&#x20;of&#x20;each&#x20;user&#x20;connected&#x20;to&#x20;the&#x20;console.&#x20;This&#x20;includes&#x20;the&#x20;application&#x20;of&#x20;configurations,&#x20;validation&#x20;of&#x20;events&#x20;and&#x20;alerts,&#x20;connection&#x20;and&#x20;disconnection,&#x20;and&#x20;hundreds&#x20;of&#x20;other&#x20;operations.&#x20;Security&#x20;in&#x20;Pandora&#x20;FMS&#x20;has&#x20;always&#x20;been&#x20;one&#x20;of&#x20;the&#x20;design&#x20;characteristics&#x20;of&#x20;its&#x20;architecture.','https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#log_de_auditoria',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'auditoria.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Two-factor&#x20;authentication','It&#x20;is&#x20;possible&#x20;to&#x20;activate&#x20;&#40;and&#x20;force&#x20;its&#x20;use&#x20;to&#x20;all&#x20;users&#41;&#x20;a&#x20;double&#x20;authentication&#x20;system&#x20;&#40;using&#x20;Google&#x20;Auth&#41;&#x20;so&#x20;that&#x20;any&#x20;user&#x20;authenticates&#x20;in&#x20;addition&#x20;to&#x20;a&#x20;password,&#x20;with&#x20;a&#x20;single-use&#x20;token&#x20;system,&#x20;giving&#x20;the&#x20;system&#x20;much&#x20;more&#x20;security.','https://pandorafms.com/manual/en/documentation/04_using/12_console_setup?s%5B%5D%3Dgoogle%26s%5B%5D%',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'politica_de_pass.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Visual&#x20;consoles:&#x20;heat&#x20;maps','The&#x20;console&#x20;allows&#x20;a&#x20;series&#x20;of&#x20;data&#x20;to&#x20;be&#x20;integrated&#x20;into&#x20;a&#x20;personalized&#x20;background,&#x20;which,&#x20;depending&#x20;on&#x20;their&#x20;value,&#x20;is&#x20;represented&#x20;with&#x20;one&#x20;color&#x20;or&#x20;another,&#x20;in&#x20;real&#x20;time.&#x20;The&#x20;applications&#x20;are&#x20;endless,&#x20;it&#x20;just&#x20;depends&#x20;on&#x20;your&#x20;imagination.','https://pandorafms.com/manual/en/documentation/04_using/05_data_presentation_visual_maps#mapa_de_cal',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'mapa_de_calor.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Network&#x20;links&#x20;in&#x20;the&#x20;visual&#x20;console','There&#x20;is&#x20;a&#x20;visual&#x20;console&#x20;element&#x20;called&#x20;&ldquo;Network&#x20;link&rdquo;&#x20;that&#x20;allows&#x20;to&#x20;visually&#x20;show&#x20;the&#x20;union&#x20;of&#x20;two&#x20;network&#x20;interfaces,&#x20;their&#x20;status&#x20;and&#x20;the&#x20;upload/download&#x20;traffic,&#x20;in&#x20;a&#x20;very&#x20;visual&#x20;way.','https://pandorafms.com/manual/en/documentation/04_using/05_data_presentation_visual_maps#enlace_de_red',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'enlaces_consola_visual.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Google&#x20;Sheet&#x20;','Do&#x20;you&#x20;know&#x20;that&#x20;you&#x20;can&#x20;get&#x20;the&#x20;value&#x20;of&#x20;a&#x20;cell&#x20;from&#x20;a&#x20;Google&#x20;Sheet&#x20;spreadsheet?&#x20;We&#x20;use&#x20;the&#x20;API&#x20;to&#x20;request&#x20;the&#x20;data&#x20;through&#x20;a&#x20;remote&#x20;plugin.&#x20;It&#039;s&#x20;perfect&#x20;for&#x20;building&#x20;business&#x20;dashboards,&#x20;getting&#x20;real-time&#x20;alerts,&#x20;and&#x20;creating&#x20;your&#x20;own&#x20;custom&#x20;reports.','https://pandorafms.com/library/google-sheets-plugin/',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'google_sheets.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Availability&#x20;graphs','Similar&#x20;to&#x20;availability&#x20;reports,&#x20;but&#x20;much&#x20;more&#x20;visual,&#x20;they&#x20;offer&#x20;detailed&#x20;status&#x20;of&#x20;a&#x20;monitor&#x20;over&#x20;time.&#x20;They&#x20;can&#x20;be&#x20;grouped&#x20;with&#x20;another&#x20;module&#x20;to&#x20;offer&#x20;final&#x20;data&#x20;taking&#x20;into&#x20;account&#x20;the&#x20;high&#x20;availability&#x20;of&#x20;a&#x20;service.&#x20;They&#x20;are&#x20;perfect&#x20;for&#x20;use&#x20;in&#x20;reports&#x20;to&#x20;suppliers&#x20;and/or&#x20;customers.','https://pandorafms.com/manual/en/documentation/04_using/08_data_presentation_reports#grafico_de_disp',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'graficas_disponibilidad.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Full&#x20;resolution&#x20;graphics','Pandora&#x20;FMS&#x20;and&#x20;other&#x20;tools,&#x20;when&#x20;they&#x20;have&#x20;to&#x20;display&#x20;a&#x20;graph,&#x20;obtain&#x20;the&#x20;data&#x20;from&#x20;the&#x20;data&#x20;source&#x20;and&#x20;then&#x20;&ldquo;simplify&rdquo;&#x20;the&#x20;graph,&#x20;since&#x20;if&#x20;the&#x20;data&#x20;series&#x20;has&#x20;10,000&#x20;elements&#x20;and&#x20;the&#x20;graph&#x20;is&#x20;only&#x20;300&#x20;pixels&#x20;wide,&#x20;they&#x20;cannot&#x20;fit&#x20;all&#x20;of&#x20;them.&#x20;,&#x20;so&#x20;those&#x20;10,000&#x20;points&#x20;are&#x20;&ldquo;simplified&rdquo;&#x20;into&#x20;only&#x20;300.&#x20;However,&#x20;when&#x20;simplifying,&#x20;&ldquo;detail&rdquo;&#x20;is&#x20;lost&#x20;in&#x20;the&#x20;graph,&#x20;and&#x20;of&#x20;course&#x20;we&#x20;cannot&#x20;&ldquo;zoom&#x20;in&rdquo;.&#x20;Pandora&#x20;FMS&#x20;graphs&#x20;allow&#x20;you&#x20;to&#x20;display&#x20;and&#x20;use&#x20;all&#x20;the&#x20;data&#x20;in&#x20;a&#x20;graph,&#x20;which&#x20;we&#x20;call&#x20;&quot;TIP&quot;&#x20;that&#x20;shows&#x20;all&#x20;the&#x20;overlapping&#x20;points&#x20;and&#x20;also&#x20;allows&#x20;you&#x20;not&#x20;to&#x20;lose&#x20;resolution&#x20;when&#x20;zooming.','',1);
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'dark&#x20;mode','Do&#x20;you&#x20;know&#x20;that&#x20;there&#x20;is&#x20;a&#x20;dark&#x20;mode&#x20;in&#x20;Pandora&#x20;FMS?&#x20;An&#x20;administrator&#x20;can&#x20;activate&#x20;it&#x20;at&#x20;a&#x20;global&#x20;level&#x20;from&#x20;the&#x20;visual&#x20;configuration&#x20;options&#x20;or&#x20;any&#x20;user&#x20;at&#x20;an&#x20;individual&#x20;level,&#x20;in&#x20;the&#x20;user&#x20;options.','',1);
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Remote&#x20;monitoring&#x20;of&#x20;SNMP&#x20;devices','Network&#x20;devices&#x20;such&#x20;as&#x20;switches,&#x20;APs,&#x20;routers,&#x20;and&#x20;firewalls&#x20;can&#x20;be&#x20;remotely&#x20;monitored&#x20;using&#x20;the&#x20;SNMP&#x20;protocol.&#x20;It&#x20;is&#x20;enough&#x20;to&#x20;know&#x20;your&#x20;IP,&#x20;the&#x20;SNMP&#x20;community&#x20;and&#x20;launch&#x20;an&#x20;SNMP&#x20;wizard&#x20;from&#x20;the&#x20;console.','https://pandorafms.com/manual/en/documentation/03_monitoring/03_remote_monitoring#monitorizacion_snmp',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'monitorizar_snmp.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Monitoring&#x20;JMX&#x20;&#40;Tomcat,&#x20;Websphere,&#x20;Weblogic,&#x20;Jboss,&#x20;Apache&#x20;Kafka,&#x20;Jetty,&#x20;GlassFish&hellip;&#41;','There&#x20;is&#x20;an&#x20;Enterprise&#x20;plugin&#x20;that&#x20;is&#x20;used&#x20;to&#x20;monitor&#x20;any&#x20;JMX&#x20;technology.&#x20;It&#x20;can&#x20;be&#x20;used&#x20;locally&#x20;&#40;as&#x20;a&#x20;local&#x20;plugin&#41;&#x20;or&#x20;remotely&#x20;with&#x20;the&#x20;plugin&#x20;server.','https://pandorafms.com/library/jmx-monitoring/',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'monitorizar_con_jmx.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Monitor&#x20;routes&#x20;from&#x20;one&#x20;IP&#x20;to&#x20;another','There&#x20;is&#x20;a&#x20;special&#x20;plugin&#x20;that&#x20;is&#x20;used&#x20;to&#x20;visually&#x20;monitor&#x20;the&#x20;routes&#x20;from&#x20;one&#x20;IP&#x20;to&#x20;another&#x20;in&#x20;a&#x20;visual&#x20;and&#x20;dynamic&#x20;way,&#x20;as&#x20;it&#x20;changes&#x20;over&#x20;time.','https://pandorafms.com/manual/en/documentation/03_monitoring/03_remote_monitoring#monitorizacion_de_rutas',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'monitorizar_desde_ip.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'planned&#x20;stops','It&#x20;is&#x20;possible&#x20;to&#x20;define,&#x20;at&#x20;the&#x20;agent&#x20;level&#x20;and&#x20;at&#x20;the&#x20;module&#x20;level,&#x20;periods&#x20;in&#x20;which&#x20;the&#x20;alerts&#x20;and/or&#x20;the&#x20;collected&#x20;data&#x20;are&#x20;ignored.&#x20;It&#x20;is&#x20;perfect&#x20;for&#x20;planning&#x20;service&#x20;stops&#x20;or&#x20;disconnection&#x20;of&#x20;monitored&#x20;systems.&#x20;It&#x20;also&#x20;affects&#x20;SLA&#x20;reporting,&#x20;preventing&#x20;those&#x20;time&#x20;intervals&#x20;from&#x20;being&#x20;taken&#x20;into&#x20;account.','https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#paradas_de_servicio_planificadas',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'paradas_planificadas.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Customize&#x20;alert&#x20;emails','Did&#x20;you&#x20;know&#x20;that&#x20;Pandora&#x20;alert&#x20;emails&#x20;can&#x20;be&#x20;customized?&#x20;You&#x20;only&#x20;have&#x20;to&#x20;edit&#x20;the&#x20;default&#x20;HTML&#x20;code&#x20;of&#x20;the&#x20;email&#x20;type&#x20;alert&#x20;actions.','https://pandorafms.com/manual/en/documentation/04_using/01_alerts#editing_an_action',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'personalizar_los_emails.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'password&#x20;policy','The&#x20;Pandora&#x20;FMS&#x20;console&#x20;has&#x20;a&#x20;credential&#x20;policy&#x20;management&#x20;system,&#x20;to&#x20;reinforce&#x20;local&#x20;security&#x20;&#40;in&#x20;addition&#x20;to&#x20;allowing&#x20;external&#x20;authentication&#x20;against&#x20;LDAP,&#x20;Active&#x20;Directory&#x20;or&#x20;SAML&#41;.&#x20;Through&#x20;this&#x20;system&#x20;we&#x20;can&#x20;force&#x20;password&#x20;changes&#x20;every&#x20;X&#x20;days,&#x20;save&#x20;a&#x20;history&#x20;of&#x20;passwords&#x20;used&#x20;or&#x20;prevent&#x20;the&#x20;use&#x20;of&#x20;certain&#x20;passwords,&#x20;among&#x20;other&#x20;actions.','https://pandorafms.com/manual/en/documentation/04_using/12_console_setup?s%5B%5D%3Dcontrase%25C3%25B',1);
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Automatic&#x20;agent&#x20;provision&#x20;system','The&#x20;agent&#x20;self-provisioning&#x20;system&#x20;allows&#x20;an&#x20;agent&#x20;recently&#x20;entered&#x20;into&#x20;the&#x20;system&#x20;to&#x20;automatically&#x20;apply&#x20;changes&#x20;to&#x20;their&#x20;configuration&#x20;&#40;such&#x20;as&#x20;moving&#x20;them&#x20;from&#x20;group,&#x20;assigning&#x20;them&#x20;certain&#x20;values&#x20;in&#x20;custom&#x20;fields&#41;&#x20;and&#x20;of&#x20;course&#x20;applying&#x20;certain&#x20;monitoring&#x20;policies.&#x20;It&#x20;is&#x20;one&#x20;of&#x20;the&#x20;most&#x20;powerful&#x20;functionalities,&#x20;aimed&#x20;at&#x20;managing&#x20;very&#x20;large&#x20;system&#x20;parks.','https://pandorafms.com/manual/start?id=en/documentation/02_installation/05_configuration_agents#conf',1);
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Automatic&#x20;agent&#x20;provision&#x20;system','The&#x20;agent&#x20;self-provisioning&#x20;system&#x20;allows&#x20;an&#x20;agent&#x20;recently&#x20;entered&#x20;into&#x20;the&#x20;system&#x20;to&#x20;automatically&#x20;apply&#x20;changes&#x20;to&#x20;their&#x20;configuration&#x20;&#40;such&#x20;as&#x20;moving&#x20;them&#x20;from&#x20;group,&#x20;assigning&#x20;them&#x20;certain&#x20;values&#x20;in&#x20;custom&#x20;fields&#41;&#x20;and&#x20;of&#x20;course&#x20;applying&#x20;certain&#x20;monitoring&#x20;policies.&#x20;It&#x20;is&#x20;one&#x20;of&#x20;the&#x20;most&#x20;powerful&#x20;functionalities,&#x20;aimed&#x20;at&#x20;managing&#x20;very&#x20;large&#x20;system&#x20;parks.','https://pandorafms.com/manual/start?id=en/documentation/02_installation/05_configuration_agents#conf',1);
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Automatic&#x20;agent&#x20;provision&#x20;system','The&#x20;agent&#x20;self-provisioning&#x20;system&#x20;allows&#x20;an&#x20;agent&#x20;recently&#x20;entered&#x20;into&#x20;the&#x20;system&#x20;to&#x20;automatically&#x20;apply&#x20;changes&#x20;to&#x20;their&#x20;configuration&#x20;&#40;such&#x20;as&#x20;moving&#x20;them&#x20;from&#x20;group,&#x20;assigning&#x20;them&#x20;certain&#x20;values&#x20;in&#x20;custom&#x20;fields&#41;&#x20;and&#x20;of&#x20;course&#x20;applying&#x20;certain&#x20;monitoring&#x20;policies.&#x20;It&#x20;is&#x20;one&#x20;of&#x20;the&#x20;most&#x20;powerful&#x20;functionalities,&#x20;aimed&#x20;at&#x20;managing&#x20;very&#x20;large&#x20;system&#x20;parks.','https://pandorafms.com/manual/start?id=en/documentation/02_installation/05_configuration_agents#conf',1);
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'ARP&#x20;tables','Do&#x20;you&#x20;know&#x20;that&#x20;there&#x20;is&#x20;an&#x20;inventory&#x20;module&#x20;to&#x20;get&#x20;the&#x20;ARP&#x20;tables&#x20;from&#x20;your&#x20;windows&#x20;servers?&#x20;It&#x20;is&#x20;easy&#x20;to&#x20;install&#x20;and&#x20;can&#x20;give&#x20;you&#x20;very&#x20;detailed&#x20;information&#x20;about&#x20;your&#x20;equipment.','https://pandorafms.com/library/arp-table-windows-local/',1);
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Using&#x20;custom&#x20;icons&#x20;in&#x20;visual&#x20;consoles','Thanks&#x20;to&#x20;the&#x20;custom&#x20;icons,&#x20;you&#x20;can&#x20;create&#x20;highly&#x20;customized&#x20;views,&#x20;such&#x20;as&#x20;the&#x20;one&#x20;in&#x20;the&#x20;image,&#x20;which&#x20;represents&#x20;racks&#x20;with&#x20;the&#x20;types&#x20;of&#x20;servers&#x20;in&#x20;the&#x20;order&#x20;they&#x20;are&#x20;placed&#x20;within&#x20;the&#x20;rack.&#x20;Perfect&#x20;for&#x20;a&#x20;technician&#x20;to&#x20;know&#x20;exactly&#x20;what&#x20;machine&#x20;is&#x20;failing.&#x20;It&#x20;couldn&#039;t&#x20;be&#x20;more&#x20;visual,&#x20;hence&#x20;the&#x20;name.','https://pandorafms.com/manual/start?id=en/documentation/04_using/05_data_presentation_visual_maps',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'iconos_personalizados.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Use&#x20;Telegram&#x20;with&#x20;Pandora&#x20;FMS','Perfect&#x20;to&#x20;receive&#x20;alerts&#x20;with&#x20;embedded&#x20;graphics&#x20;and&#x20;thus&#x20;customize&#x20;the&#x20;reception&#x20;of&#x20;notices&#x20;individually&#x20;or&#x20;in&#x20;a&#x20;common&#x20;channel&#x20;with&#x20;more&#x20;people.','https://pandorafms.com/library/telegram-bot-cli/',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'telegram_con_pandora.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Zoom&#x20;on&#x20;data&#x20;graphs','Do&#x20;you&#x20;know&#x20;that&#x20;Pandora&#x20;FMS&#x20;allows&#x20;you&#x20;to&#x20;zoom&#x20;in&#x20;on&#x20;a&#x20;part&#x20;of&#x20;the&#x20;graph.&#x20;With&#x20;that&#x20;you&#x20;will&#x20;expand&#x20;the&#x20;information&#x20;of&#x20;the&#x20;graph.&#x20;If&#x20;you&#x20;are&#x20;looking&#x20;at&#x20;a&#x20;graph&#x20;for&#x20;a&#x20;month&#x20;and&#x20;you&#x20;zoom&#x20;in,&#x20;you&#x20;will&#x20;be&#x20;able&#x20;to&#x20;see&#x20;the&#x20;data&#x20;for&#x20;that&#x20;interval.&#x20;If&#x20;you&#x20;use&#x20;a&#x20;graph&#x20;with&#x20;full&#x20;resolution&#x20;data&#x20;&#40;we&#x20;call&#x20;them&#x20;TIP&#x20;graphs&#41;&#x20;you&#x20;will&#x20;be&#x20;able&#x20;to&#x20;see&#x20;the&#x20;detail&#x20;of&#x20;each&#x20;piece&#x20;of&#x20;data,&#x20;even&#x20;if&#x20;your&#x20;graph&#x20;has&#x20;thousands&#x20;of&#x20;samples.','',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'zoom_en_graficas.png','images/tips/');
ALTER TABLE `tnetwork_component` ADD COLUMN `target_ip` VARCHAR(255) NOT NULL DEFAULT '';
UPDATE `tnetwork_component`
SET module_enabled=1
WHERE name='Cisco&#x20;_nameOID_&#x20;power&#x20;state';
ALTER TABLE `tlayout_data`
ADD COLUMN `recursive_group` TINYINT NOT NULL DEFAULT '0' AFTER `fill_color`;
ALTER TABLE `tlayout_template_data`
ADD COLUMN `recursive_group` TINYINT NOT NULL DEFAULT '0' AFTER `fill_color`;
ALTER TABLE `tusuario`
ADD COLUMN `metaconsole_section` VARCHAR(255) NOT NULL DEFAULT 'Default' AFTER `data_section`;
ALTER TABLE `tusuario`
ADD COLUMN `metaconsole_data_section` VARCHAR(255) NOT NULL DEFAULT '' AFTER `metaconsole_section`;
ALTER TABLE `tusuario`
ADD COLUMN `metaconsole_default_event_filter` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `default_event_filter`;
UPDATE tconfig SET value = 'Renaissance' WHERE token LIKE 'lts_name';
COMMIT;

View File

@ -0,0 +1,5 @@
START TRANSACTION;
DELETE FROM tconfig WHERE token = 'refr';
COMMIT;

Binary file not shown.

View File

@ -127,9 +127,9 @@ if (check_login()) {
case 'infomodal': case 'infomodal':
if ($open) { if ($open) {
echo '<p>'.__('The Update Manager client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()).'</p>'.'<p>'.__('<b>OpenSource version updates are automated packages generated each week. These updates come WITHOUT ANY warranty or support. If your system is corrupted or a feature stops working properly, you will need to recover a backup by yourself.</b>').'</p>'.'<p>'.__('The Enterprise version comes with a different update system, with fully tested, professionally-supported packages, and our support team is there to help you in case of problems or queries. Update Manager is another feature present in the Enterprise version and not included in the OpenSource version. There are lots of advanced business-oriented features contained in %s Enterprise Edition. For more information visit <a href="http://pandorafms.com">pandorafms.com</a>', get_product_name()).'</p>'; echo '<p>'.__('The Update Manager client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()).'</p>'.'<p>'.__('<b>OpenSource version updates are automated packages generated each week. These updates come WITHOUT ANY warranty or support. If your system is corrupted or a feature stops working properly, you will need to recover a backup by yourself.</b>').'</p>'.'<p>'.__('The Enterprise version comes with a different update system, with fully tested, professionally-supported packages, and our support team is there to help you in case of problems or queries. Update Manager is another feature present in the Enterprise version and not included in the OpenSource version. There are lots of advanced business-oriented features contained in %s Enterprise Edition. For more information visit <a href="https://pandorafms.com">pandorafms.com</a>', get_product_name()).'</p>';
} else { } else {
echo '<p>'.__('The new <a href="http://updatemanager.sourceforge.net">Update Manager</a> client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()).'</p>'.'<p>'.__('The Update Manager is one of the most advanced features on the %s Enterprise Edition. For more information visit <a href="http://pandorafms.com">http://pandorafms.com</a>.', get_product_name()).'</p>'.'<p>'.__('Update Manager sends anonymous information about %s usage (number of agents and modules running). To disable it, please remove the remote server address from the Update Manager plugin setup.', get_product_name()).'</p>'; echo '<p>'.__('The new <a href="http://updatemanager.sourceforge.net">Update Manager</a> client is included on %s. It helps system administrators update their %s automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.', get_product_name(), get_product_name()).'</p>'.'<p>'.__('The Update Manager is one of the most advanced features on the %s Enterprise Edition. For more information visit <a href="https://pandorafms.com">https://pandorafms.com</a>.', get_product_name()).'</p>'.'<p>'.__('Update Manager sends anonymous information about %s usage (number of agents and modules running). To disable it, please remove the remote server address from the Update Manager plugin setup.', get_product_name()).'</p>';
} }
break; break;

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -9,12 +9,12 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas, http://www.artica.es * Copyright (c) 2007-2023 Pandora FMS, http://www.pandorafms.com
* This code is NOT free software. This code is NOT licenced under GPL2 licence * This code is NOT free software. This code is NOT licenced under GPL2 licence
* You cannnot redistribute it without written permission of copyright holder. * You cannnot redistribute it without written permission of copyright holder.
* ============================================================================ * ============================================================================

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -1,9 +1,9 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // Pandora FMS - https://pandorafms.com
// ================================================== // ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas // Copyright (c) 2005-2023 Pandora FMS
// Please see http://pandorafms.org for full contribution list // Please see https://pandorafms.com/community/ for full contribution list
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License // modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 // as published by the Free Software Foundation; version 2

View File

@ -9,13 +9,13 @@
* @license See below * @license See below
* *
* ______ ___ _______ _______ ________ * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __| * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ | * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2007-2023 Artica Soluciones Tecnologicas * Copyright (c) 2007-2023 Pandora FMS
* Please see http://pandorafms.org for full contribution list * Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2. * as published by the Free Software Foundation for version 2.

Some files were not shown because too many files have changed in this diff Show More