Pandora: Documentation en: Anexo Upgrade

From Pandora FMS Wiki
Revision as of 14:30, 24 February 2015 by Ivo yordanov (talk | contribs) (Pandora Server Enterprise)
Jump to: navigation, search

Go back to Pandora FMS documentation index

1 Upgrading from Previous Versions

1.1 Upgrading to Minor Releases

Upgrading to a minor version means if you e.g. upgrade from '5.1' to '5.1SP1', or from a '4.0.1' to a '4.0.2'.

The upgrading / migrating process from same major level version implies that versions don't come with any changes regarding their internal database schemata. They're only going to upgrade the software, but neither the database schemata nor the data. The updating or migration among the same major versions is very easy. Please just replace your current setup with new release, e.g. from '3.1RC1' to '3.1RC2'. You're required execute the below mentioned steps to do so.

1: Backup your database (just as a precaution - it shouldn't be necessary).

2: Backup your configuration files:

{console Root directory}/include/config.php 

3: Any custom files (map images, plugins). Some of them are in:

{console Root directory}/attachment/plugin
{console Root directory}/images

4. Stop all Pandora FMS related processes:

/etc/init.d/pandora_server stop 
/etc/init.d/pandora_agent_daemon stop 
/etc/init.d/tentacle_serverd stop 
/etc/init.d/apache2 stop or /etc/init.d/httpd stop 
/etc/init.d/mysqld stop 

1.1.1 Updating / Upgrading from an RPM

You should know if it's an update or a reinstall first. Please check the package version which is installed on your system by the following command:

rpm -q -a | grep pandora

If you're done installing Pandora's packages, they're e.g. going to be shown as a list of the package names and versions:


This means that you have the 'pandorafms_console' package in version '3.0.0-1'. If you intend to install the same version you've already installed, you may 'reinstall' it by entering the following command:

rpm -i --force <package_name.rpm>

Sometimes updates of versions which bear the same name and number are releases (they are development improvements, etc.). In this case, it's recommended to reinstall them by forcing the installation by the '--force' parameter.

If it's the same package but from a higher version, you may update it by the following command:

rpm -U <package_name.rpm>

To force an update of a version which you have already installed, the course of action is very similar to the re-installation. Doing so is going to preserve your original files if they've been modified. The new version is going to have the same versions of the packages you've installed before. You may force the update by entering this command:

rpm -U --force <package_name.rpm>

Please exercise extreme caution before reinstalling or updating any package and generate security backups of:

  • /etc/pandora/pandora_server.conf: On Pandora FMS Server.
  • /etc/pandora/pandora_agent.conf: On Pandora FMS Agents.

1.1.2 Using .deb Packages

If you are using a Debian or Ubuntu or another system that uses '.deb' packages, please just install the new packages. The Debian package system is going to manage the uninstalling of previous version and asks you whether to preserve the old version or not.

dpkg -i package_name.deb.

If you experience any dependency problems, please resolve it by the following command:

apt-get install -f

Please install new packages and replace the configuration files by the ones of your backup.

1.1.3 From Tarball / Sources The Web Console

For the Web Console, please decompress the tarball file which contains the Pandora FMS Console to the '/tmp' directory by entering the following command first:

cd /tmp
tar xvzf pandorafms_console_3.1xxxx.tar.gz 
cd pandora_console
./pandora_console_upgrade -p { pandora console root directory/}

The second parameter (for example: '/srv/www/htdocs/pandora_console'), is the path where the Pandora FMS console is already installed. It depends of your setup and linux distro. The Server

For the server, please decompress the tarball file which contains the Pandora FMS Server to '/tmp' first.

cd /tmp
tar xvzf pandorafms_server_3.1xxxx.tar.gz 

To perform the upgrade, please do so by using the Upgrade Script:

cd pandora_server
./pandora_server_upgrade --upgrade The Agent

Please decompress tarball file:

cd /tmp
tar xvzf pandorafms_unix_agent_3.1xxx.tar.gz

Please execute the installation tool which is going to install the agent as a whole and all the tools and plug ins that it requires. This installer generates an automatic backup of your configuration files under '/etc/pandora/pandora_agent.conf.yyyy-mm-dd.' Please execute the script and copy the contents of your backup configuration file under '/etc/pandora/pandora_agent.conf' by entering the following commands:

cd pandora_agent
./pandora_agent_installer --force-install
cp /etc/pandora/pandora_agent.conf.xxxxxxx /etc/pandora/pandora_agent.conf

Please delete all temporal files by the command below if you don't need them anymore.

rm -Rf /tmp/pandora_agent


Experts only, You may only replace the agent's executable '/usr/bin/pandora_agent' or 'c:\program files\pandora_agent\pandoraAgent.exe' to update the agent. Before that, please make sure to stop the process or service to replace the executable. This should come in handy if a quick upgrade is intended.


Please keep in mind there are no changes to the database schema contained within minor version releases. It's sufficient to replace or upgrade the files as described above. Major versions, e.g. '3.0' to '3.1' or '2.1' to '3.0', might have serious changes in the database schemata and are going to require a database conversion.

1.1.4 Enterprise version update Agent

This is only needed on Android agents, which have an specific .APK, different from public PLayStore package. Other Pandora FMS agents have not an enteprise package. Console

You need the official enterprise packages on RPM (centos/redhat), DEB (debian/ubuntu), or RPM (suse/opensuse) format. Update process is exactly the same for the console package. Server procedure is based on a tarball file. Remember you need to do the update procedure first on the opensource packages and later, proceed to the upgrade on enterprise packages. Server

You need the official enterprise package, released as 32 or 64 bit tarball. Decompress the tarball and ejecute as root:

# ./pandora_server_installer --install

1.1.5 Updating from Version 5.1SP1 to 5.1SP2 Pandora Server Enterprise

The Enterprise ICMP Server now uses Fping instead of Nmap to perform ping requests. Make sure it is installed an configured in pandora_server.conf:

# Path to the fping binary. Used by the Enterprise ICMP Server.
fping /usr/bin/fping

To install fping you can use the software package manager for your Linux distribution.

In the case of the RHEL/Centos/Fedora based systems for example:

sudo yum install fping Satellite Server

The Satellite Server now uses Fping instead of Nmap to perform ping requests. Make sure it is installed an configured in satellite_server.conf:

# Path to the fping binary.
fping /usr/bin/fping

1.2 Updating to a Major Version

This is the same process as with a minor version, but you're required to upgrade your data and database schemata as described below:

1.2.1 Upgrading the Database Schemata (Major Versions only)

A major version is defined as upgrading from '3.0' to '3.1' or if migrating from '3.x' to '4.x'. An update from '4.0' to '4.0.1' is not considered upgrading to a major version which is the reason for why it doesn't require a Database Upgrade.

Major-version upgrades or migrations require to perform a database upgrade. This upgrade is initiated from the command line interface and converts all information. You're not going to lose anything in the upgrade, but anyway: ALWAYS conduct a full-backup first (not just the database, the entire code and configuration as well). Please follow the steps for upgrading as described below.

Please install your packages from your new version of Pandora FMS (including the Enterprise packages). The required files to conduct the database upgrade are contained in these packages. You can find them in the '{PANDORA_CONSOLE}/extras' directory and under '{PANDORA_CONSOLE}/enterprise/extras' (Enterprise Version only).

The {PANDORA_CONSOLE} is your Pandora FMS console directory which contains the console code. Under a SUSE it's '/srv/www/htdocs/pandora_console', under a 'Debian' or 'Ubuntu', it's '/var/www/pandora_console'.

Please go to the 'extras' directory. There is a file called 'pandoradb_migrate_vX.Y_to_vX.Z.sql'. This file contains all the SQL code required to convert your X.Y.x database in a X.Z database ready to be used with a X.Z console and a X.Z server. The required steps to conduct the conversion are the following:

1: Please perform a complete backup of your current database by entering the following command:

mysqldump -u root -p pandora > backup_pandora_X.Y.sql

2: Please stop your Pandora FMS Server and Web Server:

 /etc/init.d/pandora_server stop
 /etc/init.d/apache stop

3: Apply the upgrade script to update your database. You're going to find it once you have installed the new version's packages. The script is going to ask for your Pandora FMS user password for MySQL (you may find it within your current '/etc/pandora/pandora_server.conf' file). We're assuming your Pandora FMS Database is called "pandora" and it's running on the same machine you're executing the following command:

cd /srv/www/htdocs/pandora_console (or equivalent)
cat extras/pandoradb_migrate_vX.Y_to_vX.Z.sql | mysql -u pandora -p -D pandora 

After a few seconds or minutes, the database is ready to perform its tasks in conjunction with latest version of Pandora FMS.

In case of experiencing any problems, the backup to go back to your previous version may be restored by the command below:

mysql -u root -p
> drop database pandora;
> create database pandora;
> use pandora;
> source backup_pandora_X.Y.sql

1.2.2 The Enterprise DB Schema

Template warning.png

It's very important to execute the Open Migration Script first. It's located in the 'extras' directory as mentioned within the previous section.


This process is almost the same as the ones explained above. In the '/enterprise/extras' directory, you have a file called 'pandoradb_migrate_vX.Y_to_vX.Z.sql'. Please use this file like the OpenSource Migration Script explained above:

cd /srv/www/htdocs/pandora_console (or equivalent)
cat enterprise/pandoradb_migrate_vX.Y_to_vX.Z.sql | mysql -u pandora -p -D pandora

1.2.3 Updating from Version 5.0 to 5.1 Pandora Console

  • It is necessary deleting the old "update manager", and the things to delete are the file <pandora_console>/extensions/update_manager.php and the directory <pandora_console>/extensiones/update_manager/. Recon Scripts and Tasks

The Recon Task's fields consisted of four static fields until the publication of version 5.0. These fields have been changed to a dynamic system of fields, defined within the recon script's creation (similar to the plug-in's macros) under Pandora FMS 5.1. They involve some database's structure and storing changes.

Due these changes, we're required to execute the following script after the upgrade's completion:

/usr/share/pandora_server/util/ <dbname> <dbhost> <dbuser> <dbpass>

It's going to create the old four fields as dynamic fields within the recon script's table and is going to convert the already used fields within the recon tasks to the new format, therefore maintaining the compatibility to previously created recon tasks.

It is possible that attempt to start the service pandora_server will find this error in the log

DBI connect('pandora:localhost:3306','pandora',...) failed: Can't
connect to local MySQL server through socket '/tmp/mysql.sock' (2) at
/</usr/local/bin/pandora_server>PandoraFMS/ line 108.

Check pandora_server.conf and set the parameter dbhost with the ip instead of localhost.

1.2.4 Update from Version 4.x to 5.0

Template warning.png

Within version 5.0 of Pandora FMS, some API functions like set create_event have changed as follows: Compound Alerts

Within version 5.0, the compound alerts have been entirely removed. If they still exist, they're going to be deleted during the migration process. Plug Ins

The plug-in system has changed in Pandora FMS 5.0. The data of these type of modules is now different. In this case, it's mandatory to conduct an update.

If your current installation contains plug ins and plug-in modules, you're required to execute the following script after the upgrade's completion:

/usr/share/pandora_server/util/ <dbname> <dbhost> <dbuser> <dbpass>

The PSPZ files to import plug ins of previous versions of 5.0 are compatible to the new system.

1.2.5 Update from Version 3.2.1 to 4.0

Subsequently to updating the console from 'Tarballs', 'DEB' or 'RPM' packages, the access to the web console could experience the following errors:

Notice: Undefined index: dbtype in /var/www/pandora_console/include/functions_db.php on line 32 
Notice: Undefined index: dbtype in /var/www/pandora_console /include/functions_db.php on line 48 
Notice: Undefined index: dbtype in /var/www/pandora_console/include/functions_db.php on line 625 

To resolve these errors, please add the following line to the file named '<pandora_console_path>/include/config.php':


If the SSH extension is contained within your setup, please delete it. It's quite old and it's not going to run in conjunction with Pandora FMS 4.0. It's also going to crash the console.

rm -Rf < your pandora console root directory>/extensions/ssh_console*

Some 3.2 setups cause problems within an auto-increment table. In this case, please enter the below mentioned command into SQL by using the SQL manager in the console or by using the MySQL command line client:


After upgrading the server, there's a new server for high-speed ICMP and SNMP monitoring available at your disposal. There are special preparations required for using it. Please read the following lines thoroughly and disable it by adding the following lines to your 'pandora_server.conf':

snmpserver 0
icmpserver 0

1.3 Problems while upgrading from a previous Version (Perl Libraries)

Sometimes an upgrade moves the Pandora FMS Libraries to different locations, e.g. to where the old library's versions were installed. After completing the upgrade, you might have two different versions of Pandora FMS Libraries and you're unable to know which version is actually going to be used. The best solution is to locate the libraries, delete all of them and to reinstall or upgrade here. To do so, please execute the command below:

find /usr -name ""

This command is going to show you a few lines like:


The Pandora FMS libraries are located under '/usr/lib/perl5/site_perl/5.10.0/PandoraFMS/'. Please delete them entirely and reinstall them by using packages or tarball sources.

rm -Rf /usr/lib/perl5/site_perl/5.10.0/PandoraFMS/

The Perl versions and exact locations may differ within each Linux distribution, so you're required to locate them prior to deleting the directory which was mentioned here.

1.4 Problems during the Upgrade from a previous Version (Database)

If you experience any problems, it's probably because you're upgrading a 2.x version which was an upgrade from a 1.x version or because someone has conducted manual changes to the Database scheme. If you e.g. get a message like this:

ERROR 1005 (HY000) at line 101: Can't create table './pandora/talert_template_modules.frm' (errno: 150)

This error originates in a problem under MySQL, because some fields don't have the expected type. The 'id_agente_modulo' field in 2.1 is required to consist of the 'bigint(10)' type. If you e.g. have migrated from a 1.x version of Pandra FMS, you're going to encounter this problem. Before upgrading the migration tool to 3.0, please enter this command within the MySQL-Console:

ALTER TABLE tagente_modulo MODIFY id_agente_modulo bigint(10) unsigned NOT NULL auto_increment;

Please retry to execute the upgrade tool again. Please keep in mind that you're required to have InnoDB support for your MySQL Database Server.

2 Migrating to another System

Sometimes we might intend to use the new version of Pandora FMS under a different system/distribution, e.g. migrating from 'SUSE 11' to 'SUSE 12' or from 'Ubuntu' to 'CentOS'.

For achieving this, we're required to install the new Pandora FMS application from scratch or to download our ISO appliance and install it.

  • Once the new Pandora FMS instance is running in our new system, we're going to perform a backup of the previous system's database:
mysqldump -u root -p pandora > backup_pandora_X.Y.sql
  • After we transfer the backup file named 'backup_pandora_X.Y.sql' to the new system.
  • Then we're going to stop all the running processes except 'mysql' by entering the following command:
/etc/init.d/pandora_server stop 
/etc/init.d/pandora_agent_daemon stop 
/etc/init.d/tentacle_serverd stop 
/etc/init.d/apache2 stop  o /etc/init.d/httpd stop (parar servidor apache, variará dependiendo de la distribución que usemos)
  • Within a MySQL-Shell, we're going to acquire root privileges first. Then we're going to access the Pandora FMS Database (default name is 'pandora') and conduct the import operation:
#mysql -u root -p
mysql>use pandora
Database changed
mysql>source /home/artica/backup_pandora_X.Y.sql ( put the full path to the backup file you created a few steps back )
  • If you're migrating to a superior version, you must perform the database migration scripts.
  • If you've changed your distribution's OS, please keep in mind that the console's path may have been modified within the system, and some database fields are also required to be modified within the Pandora FMS Database. To do so, we're required to conduct the following queries:
#mysql -u root -p
mysql>use pandora
Database changed
mysql>UPDATE tconfig SET value = '/var/www/html/pandora_console/attachment' WHERE token LIKE 'attachment_store'
mysql>UPDATE tconfig SET value = '/var/www/html/pandora_console/include/fonts/smallfont.ttf' WHERE token LIKE 'fontpath'

Where '/var/www/html/pandora_console/attachment' is the actual console's path within your system.

These path variables are also required to be modified within the server's and console's configuration files.

  • Once the database has been imported, we're required to make sure the configuration files '<CONSOLE_PATH>/pandora_console/include/config.php' and '/etc/pandora/pandora_server.conf' hold the same data in the fields named 'dbname', 'dbuser' and 'dbpass'. If they're unequal, we're required to do the following:

1. To replace the new configuration files by the old ones.

2. To update the database credentials according to the values stored in the configuration files. Assuming the new configuration file hold the following data: 'dbname=pandora', 'dbuser=pandora1' and 'dbpass=pandora2', it's recommended to enter the following commands:

#mysql -u root -p
mysql>grant all privileges on pandora.* to 'pandora1'@'localhost' identified by 'pandora2';
mysql>flush privileges;

Subsequently, we may restart all the daemons and gain access to the Pandora console along with the previous configuration. If you've changed your IP address, you're required to modify the 'target_ip' token within all the agent's configuration files.

This procedure is also valid for the Enterprise version.

3 Security upgrades / Patches

A security upgrade or security patch is a small patch usually for Console, but you can also have a security patch for server. In both cases you must proceed like is described in the "minor upgrade" process.

4 Console updates by using the Update Manager

4.1 OpenSource Updates

Since Pandora FMS 4.0.2, you may update from weekly semiautomatic updates by using the Open-Source version. This feature is based on an improvement of the Update Manager's system, which was only available to customers of the Enterprise version before. Now you may verify online whether there's a new update, download and update your console automatically by a request.

This feature has the following characteristics:

  • The server which executes the Pandora FMS console has to be connected to the Internet.
  • The Update Manager is going to contact our server for new updates (on Sourceforge). It also sends anonymous statistical data about the use of Pandora FMS (number of agents).
  • An update from Sourceforge is going to be downloaded from the weekly updates folder.
  • The updates are incremental and they're containing the whole console. This process could take a lot of time (the package size is about 25 MB).
  • The Updates are conducted automatically: They're not reviewed by the team. In 99% of cases, there are no expected problems but we're not guaranteeing anything if a problem occurs.
  • The updates are only intended for the console (neither for agents nor servers).

4.1.1 The Console's Updating Process

It's very easy. Just go to 'Extensions' -> 'Update Manager'. The main screen allow you to check for new available updates to be installed, also you can see the list, containing the previously installed updates (on the picture below, there are no previous updates yet). Please click on 'install'.

Update manager open.png

Please click on the 'Install' button.


To use the Update Manager, the server which hosts the Pandora FMS Console has to be connected to Internet. Pandora FMS is going to use the 'wget' command to download the packages by default (it's faster). You may also use the 'curl' method to do so (you may change it within the Pandora configuration files) but it's slower.


Update manager open2.png

The moment the packages are downloaded and installed, you're going to return to the main page which is going to look like the one shown below. It shows the installed updates and a message which says that there are no more available updates. Congratulations, you've updated your system to a new version!

Update manager open3.png

4.2 Enterprise Updates

Unlike Open updates, Enterprise updates have several additional features:

  • 100% tested by our development team, so you can enjoy updates on the same day an incident was opened (even a few hours later).
  • Specific updates (incremental) which allow you to update the outdated part only and without being forced to download huge packages.
  • Offline updates are allowed now. Downloading packages from the support page for the Pandora FMS installation which aren't connected to the Internet (due to security reasons).

To use the Enterprise version's Update Manager, you're required to install the Key Generator and enter your serial number first.

Update manager4.png

You may access the Update Manager by clicking on 'Operations -> 'Extensions' and 'Open Update Manager.' If you have the Enterprise version installed, you may use this interface. If not, the open version is going to be displayed.

Update manager5.png

On this page, you're able to verify the current version number of Pandora FMS. You're going to get notified if there are any new available updates.

To update to a new version, please click on the 'Update' button.

You may also mark the checkbox named 'Overwrite local changes' which is going to overwrite any existing local modification of the files.

4.2.1 Off-Line Updates

You may also download 'off-line' updates for Pandora FMS which are packages with an '.OUM' extension. Please go to the Pandora FMS official support page and download the '.OUM' files as shown on the picture below.

Update manager7.png

Upload it to the console by using this control:

Update manager6.png

The update is going to be applied automatically.


You may also update by ZIP files in the same way that you've used to update by the OUM files. These zip files were created by our programmers.


4.3 Additional Configuration of PHP Engine to operate with Update Manager

To ensure the Open Update Manager is working appropriately, it requires more memory than the amount assigned by default. To assign more memory to the PHP executions, you're required to edit the php.ini file and set up the reserved memory to at least 256MB.

The appropriate line to edit is shown below.

memory_limit = 256M	; Maximum amount of memory a script may consume (256MB)

On Debian and Ubuntu systems, the file is usually located in the directory named /etc/php5/apache2.

Go back to Pandora FMS Documentation Index