Pandora FMS community forums
Bugfix for line 473 NetworkServer.pm and CentOS 7 installation notes - Printable Version

+- Pandora FMS community forums (http://pandorafms.org/forum)
+-- Forum: Pandora FMS (http://pandorafms.org/forum/forum-3.html)
+--- Forum: Help for new users in Pandora FMS (http://pandorafms.org/forum/forum-10.html)
+--- Thread: Bugfix for line 473 NetworkServer.pm and CentOS 7 installation notes (/thread-14747.html)



Bugfix for line 473 NetworkServer.pm and CentOS 7 installation notes - mrbalvanie - 01-14-2020

I'm just getting started with Pandora FMS, but I have a couple notes others may find helpful. First is a bug I found and think I've fixed.

Reviewing my error log, I saw this:
==> /var/log/pandora/pandora_server.error <==
Use of uninitialized value in string eq at /usr/lib/perl5/PandoraFMS/NetworkServer.pm line 473.

To correct it, I changed line 473 from:
if ($module->{'custom_string_2'} eq "inherited" ) {

to 
if ((defined $module->{'custom_string_2'}) && ($module->{'custom_string_2'} eq "inherited" )) {

Second, I think there are a few steps that were skipped when describing a CentOS 7 install, but I tried to keep my steps as I went through it so that others doing a similar install may find whatever they missed here.

#Installation steps I took. Some of these can be consolidated, but this is the order I did them in.
yum -y install mod_ssl openssl httpd vim screen
openssl genrsa -out ca.key 2048
openssl req -new -key ca.key -out ca.csr
openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt

cp ca.crt /etc/pki/tls/certs
cp ca.key /etc/pki/tls/private/ca.key
cp ca.csr /etc/pki/tls/private/ca.csr
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

systemctl enable httpd
#Confirm you have http and https service available
yum -y install epel-release yum-utils
yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php73
echo "[artica_pandorafms]
name=CentOS7 - PandoraFMS official repo
baseurl=http://firefly.artica.es/centos7
gpgcheck=0
enabled=1" > /etc/yum.repos.d/pandorafms.repo
yum makecache
yum -y install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd
yum -y install graphviz libxslt make mariadb mariadb-server mod_php net-snmp net-tools nmap pandorafms_console pandorafms_server perl-CPAN perl-DBD-mysql perl-DBI perl-Encode-Locale perl-HTML-Tree perl-IO-Socket-INET6 perl-libwww-perl perl-NetAddr-IP perl-SNMP perl-Socket6 perl-XML-SAX perl-XML-Simple perl-XML-Twig php php-cli php-common php-curl php-gd php-ldap php-mbstring php-mysql php-mysqlnd php-ocache php-mccrypt php-pear php-pear-DB php-snmp php-xml php-xmlrpc php-zip sudo xorg-x11-fonts-75dpi xorg-x11-fonts-misc xprobe2
systemctl start mariadb
systemctl enable mariadb

#Set your root password here and go with the defaults unless you have a reason not to.
mysql_secure_installation

hostnamectl set-hostname pandorafms.yourdomain.com
yum -y install net-tools
systemctl enable mariadb.service
sed -i 's/PrivateTmp=true/PrivateTmp=false/g' /etc/systemd/system/multi-user.target.wants/httpd.service
setenforce 0
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config
chmod -R 777 /var/www/html/pandora_console/include
systemctl restart httpd
systemctl status httpd

yum -y install traceroute bind-utils
echo "vim /var/www/html/pandora_console/include/config.php /etc/pandora/pandora_server.conf and make sure passwords for pandora database are correct."
tar xvjf phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 /usr/local/share/
ln -sf /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
yum -y install nfdump
echo "[Unit]
Description=Pandora FMS server daemon
After=network.target network-online.target remote-fs.target basic.target

[Service]
Type=forking
ExecStart=/usr/bin/pandora_server /etc/pandora/pandora_server.conf -D

[Install]
WantedBy=multi-user.target" > /usr/lib/systemd/system/pandora_server.service
systemctl enable pandora_server
systemctl start pandora_server
systemctl status pandora_server


RE: Bugfix for line 473 NetworkServer.pm and CentOS 7 installation notes - Diego.M - 01-15-2020

Hello mrbalvanie,

Which version of Pandora FMS are you in? I wanted to check the bug you told us about and correct it if necessary. I'm glad you found the solution to the problem.

Greetings
Diego


RE: Bugfix for line 473 NetworkServer.pm and CentOS 7 installation notes - mrbalvanie - 01-15-2020

[quote pid='30618' dateline='1579076448']
version of Pandora FMS are you in?
[/quote]

I went to Update Manager - Update Manager Online and it says:
The latest version of package installed is:

PC191218

I installed this from the current download in the last few days so it should be pretty current. Let me know if that isn't what you're looking for.


RE: Bugfix for line 473 NetworkServer.pm and CentOS 7 installation notes - Diego.M - 01-16-2020

Hello mrbalvanie,

That's not the version, but the build, which is basically the date you updated the machine. I guess by this date the version you have will be 741, although I would like you to confirm it. To see the version correctly, take a look at the footer of the console, you should have something like this:

Pandora FMS v7.0NG.742 - PC200115 - MR 32

Thank you for your cooperation!
Diego


RE: Bugfix for line 473 NetworkServer.pm and CentOS 7 installation notes - mrbalvanie - 01-16-2020

(01-16-2020, 08:13 AM)Diego.M Wrote: Hello mrbalvanie,

That's not the version, but the build, which is basically the date you updated the machine. I guess by this date the version you have will be 741, although I would like you to confirm it. To see the version correctly, take a look at the footer of the console, you should have something like this:

Pandora FMS v7.0NG.742 - PC200115 - MR 32

Thank you for your cooperation!
Diego

Thanks, it is Pandora FMS v7.0NG.742 - Build PC191218 - MR 34


RE: Bugfix for line 473 NetworkServer.pm and CentOS 7 installation notes - Diego.M - 01-17-2020

Hello mrbalvanie,

Thank you very much, we will check the bug and try to fix it in the next versions.

Greetings
Diego