Pandora: Pandora Upgrade 6.0 to 7.0

From Pandora FMS Wiki
Jump to: navigation, search

1 Quick guide to upgrade your Pandora FMS ISO version from 6.0 to 7.0

1.1 Introduction

Pandora FMS is made up of three parts.

- Pandora FMS Console

- Database

- Pandora FMS Server

If it were an update to a lower version, which does not need a database update, eg 6.1 SP2 to 6.1 SP3, no action is taken on the database, only the Console and Server packages need to be updated.

1.2 Pre-upgrade

Before updating Pandora FMS, back up all important elements, in this case, the database, the server's configuration file, and the console. In this example all the elements are saved in the /home/artica/Backup directory.

[[email protected] ~]# rpm -qa | grep pandora
pandorafms_console_enterprise-6.0SP5-1.noarch
pandorafms_server-6.0SP5-1.noarch
pandorafms_console-6.0SP5-1.noarch
[[email protected] ~]# mkdir /home/artica/Backup
[[email protected] ~]# mysqldump -uroot -ppandora pandora > /home/artica/Backup/backup6.sql
[[email protected] ~]# cp -R /var/www/html/pandora_console/ /home/artica/Backup/
[[email protected] ~]# cp /etc/pandora/pandora_server.conf /home/artica/Backup/


Once the backup is complete, stop the Pandora FMS server and the Tentacle server:


[[email protected] ~]# /etc/init.d/pandora_server stop
[[email protected] ~]# /etc/init.d/tentacle_serverd stop

1.3 Upgrading the Console

Template warning.png

To Enterprise users: before proceeding with the update, request a new version 7 license from the Ártica ST sales department.

 


To update the console, first upgrade the rpm packages that have been installed. Use the following command:

[[email protected] tmp]# rpm -U --force pandorafms_console-7.0NG-1.noarch.rpm pandorafms_console_enterprise-7.0NG-1.noarch.rpm 

If you are using the OpenSource version, only update the pandorafms_console-7.0NG-1.noarch.rpm package, that can be downloaded from Sourceforge.

For Pandora FMS Enterprise users, the Enterprise package can be downloaded from Ártica ST Support website.

1.4 Upgrading the Database

If it is a major release such as when upgrading from version 6.0 to 7.0, then the database scheme also needs updating. Migration scripts will be added when installing the new Console version.

To that end, use the following command:

[[email protected] tmp]# cat /var/www/html/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | mysql -uroot -ppandora -D pandora

After executing this migration script, the database should be successfully updated and it should be ready to work on version 7.0

For users of the OpenSource version only, if applying the migration script results in a 1060 error, read the next section. Otherwise your database is ready and updated to the 7.0 version.

Error:

ERROR 1060(42S21) at line 1256: Duplicate column name 'dynamic_next' 

1.4.1 Resolution of error 1060

The steps detailed on this point are only needed in case where a database migration on the Pandora FMS Open Source version returns the following error:

ERROR 1060(42S21) at line 1256: Duplicate column name 'dynamic_next'

Pandora FMS Enterprise users must skip this entire point.

Run the following queries on your Pandora FMS Open Source database:

ALTER TABLE tmetaconsole_agent ADD COLUMN `cascade_protection_module` int(10) default '0';
ALTER TABLE tmetaconsole_agent ADD COLUMN `alias` VARCHAR(600) not null DEFAULT ;
ALTER TABLE tmetaconsole_agent ADD COLUMN `alias_as_name` int(2) unsigned default '0';

UPDATE `tmetaconsole_agent` SET tmetaconsole_agent.alias = tmetaconsole_agent.nombre;

ALTER TABLE twidget_dashboard MODIFY options LONGTEXT NOT NULL default "";

ALTER TABLE trecon_task ADD `alias_as_name` int(2) unsigned default '0';
ALTER TABLE trecon_task ADD `snmp_enabled` int(2) unsigned default '0';
ALTER TABLE trecon_task ADD `vlan_enabled` int(2) unsigned default '0';

UPDATE twidget_dashboard SET id_widget = (SELECT id FROM twidget WHERE unique_name = 'graph_module_histogram') WHERE id_widget = (SELECT id FROM twidget WHERE unique_name = 'graph_availability');
DELETE FROM twidget WHERE unique_name = 'graph_availability';

ALTER TABLE tbackup ADD COLUMN `filepath` varchar(512) NOT NULL DEFAULT "";

Once done, the database should be ready and totally upgraded to the 7.0 version.

1.4.2 Database not starting after performing a system upgrade with yum/apt-get

Upgrading processes with yum/apt-get can cause some file permissions to be modified. To fix this issue, modify the owner of the mysqld.log file to mysql:mysql, running the following command:

chown mysql:mysql /var/log/mysqld.log

The command may be slightly different depending on the distribution and version, since the path to the log file might change.

1.5 Upgrading the Server

Once the console and the database are updated, the last step is to perform the server upgrade.

For Pandora FMS OpenSource version, the update is performed similarly to earlier versions. Just download the appropriate package from Sourceforge and update it with the command:

[[email protected] tmp]# rpm -U --force pandorafms_server-7.0NG-1.noarch.rpm

For Pandora FMS Enterprise version, the Enterprise package is installed as binary.

After updating the Pandora FMS OpenSource package (Sourceforge), install Pandora FMS Enterprise version package (Ártica ST):

[[email protected] tmp]# rpm -U --force pandorafms_server-7.0NG-1.noarch.rpm
An existing version of pandora_server.conf is found.
Do not forget to start Tentacle Server daemon if you want to receive
data using tentacle
[[email protected] tmp]# tar -xvzf pandorafms_server_enterprise_7.0NG_x86_64.tar.gz
pandora_server/pandora_server
pandora_server/pandora_server_installer
pandora_server/PandoraFMS-Enterprise/bin/braa
pandora_server/PandoraFMS-Enterprise/bin/pandora_db
pandora_server/PandoraFMS-Enterprise/bin/braa
pandora_server/PandoraFMS-Enterprise/bin/pandora_manage
pandora_server/README
[[email protected] tmp]# cd pandora_server/
[[email protected] pandora_server]# ./pandora_server_installer --install
Pandora FMS Server Enterprise installer for GENERIC. (c) 2014-2016 Artica ST.


>Installing the Pandora FMS Server Enterprise binary to /usr/bin...
>Installing the pandora_exec binary to /usr/bin...
>Copying missing perl libraries to the /usr/lib/perl5/PandoraFMS...
>Copying missing scripts to /usr/share/pandora_server/util...
>Installing the tentacle_server binary to /usr/bin...
>Copying extra encoding definitions to /usr/share/pandora_server/enc...
>Installing the pandora_db binary to /usr/bin...
>Installing the pandora_manage binary to /usr/bin...
>Installing the pandora_revent binary to /usr/bin...
>Installing the pandora_encrypt_db binary to /usr/bin...
>Installing the braa binary to /usr/bin...
>Installing the enterprise recon scripts...
>Executing Pandora Server Open installation script...
>...

Pandora FMS Server Installer 7.0NG 170324 (c) 2008-2016 Artica ST
This program is licensed under GPL2 Terms. http://pandorafms.com  

GENERIC distribution detected
Creating common Pandora FMS directories
uid=500(pandora) gid=0(root) grupos=0(root) 

User pandora does exist, make sure the SSH directories are correct
Giving proper permission to /var/spool/pandora
Creating setup directory in /etc/pandora
cp conf/pandora_server.conf.new /etc/pandora
Installing Pandora Server manual
Copying the daemon script into /etc/init.d
Linking startup script to /etc/rc.d/rc5.d/S90pandora_server
ln: creating symbolic link «/etc/rc.d/rc5.d/S90pandora_server»: El fichero ya existe
Creating logrotate.d entry for Pandora FMS log management
Copying the daemon script into /etc/init.d
Linking startup script to /etc/rc.d/rc5.d/S80tentacle_serverd
Installing Tentacle Server manual
Creating Pandora FMS distribution directory in /usr/share/pandora_server
Creating the Cron script to run Pandora DB tool each hour

Now you have to edit your /etc/pandora/pandora_server.conf file to change the database password (default is   pandora) with the one set in include/config.php of your Pandora FMS Console.
After setting password you can start your Pandora FMS Server!!

>...
>Installed Open Pandora Server
>Adding pandora_db to the crontab...

Restart Pandora FMS Server.

When the updating process is finished, the packages installed on your system will be this:

[[email protected] pandora_server]# rpm -qa | grep pandora
pandorafms_console-7.0NG-1.noarch
pandorafms_console_enterprise-7.0NG-1.noarch
pandorafms_server-7.0NG-1.noarch

At this point, Enterprise users should access the web console and enter the new license provided by Ártica ST.

Now restart the stopped processes.

[[email protected] ~]# /etc/init.d/pandora_server start

Pandora FMS Server 7.0NG Build 170324 Copyright (c) 2004-2015 ArticaST
This program is OpenSource, licensed under the terms of GPL License version 2.
You can download latest versions and documentation at http://www.pandorafms.org

[*] Backgrounding Pandora FMS Server process.

Pandora Server is now running with PID 8407

[[email protected] ~]# /etc/init.d/tentacle_serverd start


Template warning.png

If the mysql socket is not installed in its default installation point, modify in the server's /etc/pandora/pandora_server.conf the dbhost parameter with the ip 127.0.0.1 instead of localhost.

 


2 Quick guide to migrate features from Pandora FMS 6.0 to version 7.0

Some of the major features that have been changed in version 7.0 NG, as well as the actions to be carried out are these:

2.1 Network Maps

In Pandora FMS 7.0 NG, the classic network maps have been improved and updated. This means that all the previous network maps will be lost during migration and they must be created once again. In the new version, you may link the union between different monitored device interfaces.

Mig1.JPG
Mig2.JPG

These connections must be configured via the network recon itself, but in case it is not executed, and you have to set the connections manually, it can be done like this:

Mig3.JPG

2.2 L2 Recon tasks

The standard Recon task (Network sweep) includes the function that was carried out by the custom SNMP L2 Recon script. This script will still work on version 7.0 NG after version migration, although the embedded changes within Network Sweep mode that improve interface links between different network devices will not be incorporated into the SNMP L2 Recon script.

Mig4.JPG

2.3 Renaming agents

This is a feature that clients have been requesting. In previous versions this change had to be performed on the console and the config file, making it a tedious task depending on the number of elements to be modified.

To solve this problem a new element known as Alias has been developed. From now on, two elements will coexist when naming an agent, the name as sole identifier and the alias.

Mig5.JPG

On installations migrated from version 6 to version 7, this element remains the same:

Mig6.JPG

From now on, if you want to modify the visible agent name, just modify the Alias to see it displayed on all views:

Mig7.JPG
Mig8.JPG

Agent name calculation on agents created from now on on version 7.0NG will be done through a set of random sentences. That means that if there are two machines with the same hostname, there will be two agents with different agent names but the same Alias on Pandora FMS console.

If you wish to avoid this situation (e.g., if the agent software and vmware plugin is installed in the Pandora FMS environment on VMs and you wish to have the data from both sources on the same logic agent) you may indicate the agent to behave as in previous versions and create an agent with the same Alias and agent Name. To do this, enter the following parameters in the agent software's config file:


#agent_name 5fa9bdc9ad26a4d0e87d0f0d15ed786c3bd487441b2d5e8d7c42b90e8389797d
#agent_name_cmd __rand__

That way, the agent will be created with the same name as always, and with the information received from both sources. You may still change the alias from the console if necessary and the information will appear as usual.

In case you update the agent or satellite servers the config files in use need to be saved, if not, and they are deleted, a new randomly-labeled agent will be generated and the stored history data will be lost, unless the two parameters above are entered in the new configuration.

2.4 New Pandora FMS agents

The default information Pandora FMS agents report from now on has been changed and unified in Pandora FMS 7.0 NG version.

These are the new modules that will generate reports:

Linux agent

Mig9.JPG


Windows agent

Mig10.JPG


Agents will keep the same configuration in their modules after migration, provided it is not a new agent. Modules included in version 7.0 will not be added automatically.

Here is the configuration you have to add in the above mentioned case:

Linux agent

# Could change depending on linux distro and vmstat command version
module_begin
module_name CPU Load
module_type generic_data
module_interval 1
module_exec vmstat 1 2 | tail -1 | awk '{ print $13 }'
module_max 100
module_min 0
module_description User CPU Usage (%)
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_unit %
module_group System
module_end

# Could change depending on linux distro and vmstat command version
module_begin
module_name CPU IOWait
module_type generic_data
module_interval 1
module_exec vmstat 1 2 | tail -1 | awk '{ print $16 }'
module_min_warning 10
module_min_critical 16
module_unit %
module_description Too much IOwait means IO bottleneck and performance problems. Check also LoadAVG.
module_group System
module_end

# Get load average
module_begin
module_name Load Average
module_type generic_data
module_exec cat /proc/loadavg | cut -d -f1
module_description Average process in CPU (Last minute)
module_group System
module_end

# Basic info about TCP Connection
module_begin
module_name TCP_Connections
module_type generic_data
module_exec netstat -an | grep tcp | grep -v LIST | wc -l
module_description Total number of TCP connections active
module_group Networking
module_end

# This plugin detects all disk and report used space (%)
module_plugin pandora_df_used
# This plugin detects system free memory and used swap (in %)
module_plugin pandora_mem_used
# This plugin will get the network usage (bytes/sec)
module_plugin pandora_netusage

Windows agent

# CPU Load using WMI 
module_begin
module_name CPU Load
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Processor
module_wmicolumn LoadPercentage
module_max 100
module_min 0
module_description User CPU Usage (%)
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_unit %
module_group System
module_end

# Basic info about TCP Connection
module_begin
module_name TCP_Connections
module_type generic_data 
module_exec netstat -an | find /c /v "estab"
module_description Total number of TCP connections active
module_group Networking
module_end

# Example plugin to retrieve drive usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df_percent_used.vbs"

# Example plugin to retrieve memory usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\mem_percent_used.vbs"

# Example plugin to retrieve network usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\network.vbs"

2.5 Update Manager / Rolling Release

Pandora FMS 0.7 NG enables users to make database changes thanks to OUM packets that are subsequently distributed. Go to the Update Manager Online or Offline section, depending whether there is a connection or not.

Template warning.png

Offline updating is only available in Pandora FMS Enterprise versions.

 



2.5.1 Update Manager Online

Go to this section via Update Manager > Update Manager Online.

Mig11.JPG

If you are installing a new version, a message like this will appear:

Mig12.JPG

Click “Update to the latest version”:

Mig13.JPG

When the update is accepted, the following package is downloaded and applied. If the package also contains database changes, the following message will appear before the changes are applied in order for the database to be backed up and ensure that, in case of error when applying new scripts, the previous database status is recoverable.

Mig14.JPG

When MR is applied, the database changes are made and once the process has finished, the updated and applied version should appear:

Mig15.JPG

2.5.2 Update Manager Offline

Template warning.png

Offline updating is only available in Pandora FMS Enterprise versions.

 


To access this section, go to Update Manager > Update Manager Online.

Mig16.JPG

Upload the package in the appearing option:

Mig17.JPG

Once the package is applied, the following message will appear:

Mig18.JPG

If the package implies database changes, these are applied and the following message will appear when it is finished:

Mig19.JPG

To find out which version you are using, a new field has been added at the console footer that tells you which MR or database version it is, and whether the changes have been applied:

Mig20.JPG

2.6 New alert templates

New templates have been added for this release:

Mig21.JPG

They come installed on Pandora FMS 7.0 NG, but migrations from previous versions will not be applied, to respect previous configurations.

2.7 Interface monitoring nomenclature

Monitoring nomenclature by which network interface monitoring modules are currently created has been modified, so that their information can be easily sorted out by their interface name.

The following nomenclature was used in previous versions:

Mig22.JPG

This is the new format:

Mig23.JPG

In order to fully take advantage of Pandora FMS 7.0 NG's new features on Enterprise maps, interface graphs, etc., modify module names through the following SQL queries:

UPDATE tagente_modulo SET nombre = CONCAT(REPLACE(nombre, 'ifOperStatus_', ), '_ifOperStatus') WHERE nombre LIKE('ifOperStatus_%');
UPDATE tagente_modulo SET nombre = CONCAT(REPLACE(nombre, 'ifInOctets_', ), '_ifInOctets') WHERE nombre LIKE('ifInOctets_%'); 
UPDATE tagente_modulo SET nombre = CONCAT(REPLACE(nombre, 'ifOutOctets_', ), '_ifOutOctets') WHERE nombre LIKE('ifOutOctets_%');

To configure satellite server modules manually in the configuration file, the modules must be renamed in the satellite configuration files (NOTE: if remote configuration is enabled, update them on the server, and modify the .md5, or delete them from the server, rename them on the satellite and resent them).

Execute this from the server in case remote configuration is disabled:

sed -i -e 's/ifOperStatus_\(.*\)/\1_ifOperStatus/' /etc/pandora/conf/*.conf 
sed -i -e 's/ifInOctets_\(.*\)/\1_ifInOctets/' /etc/pandora/conf/*.conf 
sed -i -e 's/ifOutOctets_\(.*\)/\1_ifOutOctets/' /etc/pandora/conf/*.conf
sed -i -e 's/ifOperStatus_\(.*\)/\1_ifOperStatus/' /var/spool/pandora/data_in/conf/*.conf 
sed -i -e 's/ifInOctets_\(.*\)/\1_ifInOctets/' /var/spool/pandora/data_in/conf/*.conf 
sed -i -e 's/ifOutOctets_\(.*\)/\1_ifOutOctets/' /var/spool/pandora/data_in/conf/*.conf

After applying these changes, apply them on the satellite server config. To do this, modify the .md5 file on each agent by inputting a random value on each one of them.


echo 1 >/var/spool/pandora/data_in/md5/*.md5