Difference between revisions of "Pandora: Documentation en: Anexo Upgrade"

From Pandora FMS Wiki
Jump to: navigation, search
(Installing additional network and local components)
(Update from version 4.x to 5.0)
Line 257: Line 257:
 
=== Update from version 4.x to 5.0  ===
 
=== Update from version 4.x to 5.0  ===
  
{{Warning|In the version 5.0 the compound alerts have been deleted completely. If exist, will be deleted during the migration process.}}
+
==== Compound alerts ====
 +
 
 +
In the version 5.0 the compound alerts have been deleted completely. If exist, will be deleted during the migration process.
 +
 
 +
==== Plugins ====
 +
 
 +
The system of plugins has change in Pandora FMS 5.0. The data of this kind of modules now are differente, so will be necessary update it.
 +
 
 +
If the current installation has plugins and plugin modules, after the upgrade we need to execute the following script:
 +
 
 +
/usr/share/pandora_server/util/pandora_migrate_plugins.pl <dbname> <dbhost> <dbuser> <dbpass>
 +
 
 +
The PSPZ files to import plugins of previous versions of 5.0 '''are compatibles''' with the new system.
  
 
=== Update from version 3.2.1 to 4.0 ===
 
=== Update from version 3.2.1 to 4.0 ===

Revision as of 16:46, 7 February 2013

Go back to Pandora FMS documentation index

1 Upgrading from Previous Versions

1.1 Upgrading between minor releases

A minor version is for example, when you upgrade from 3.1 to 3.1.1, or for example, upgrading from a 3.1-rc1 to 3.1-final or 3.1-rc2.

Upgrade/migrate process from same major level version implies that that versions doesnt have any change in it's internal Database schema. You will only upgrade the software, not the database schema or data.

Update/migration between same major version is very easy, just replace your current setup with new release, for example from 3.1RC1 to 3.1RC2.The steps to follow are:

1. Backup your database (only as precaution, should not be necessary).

2. Backup your configuration files:

/etc/pandora/pandora_server.conf
pandora_console/include/config.php at your apache web root directory.
/etc/pandora/pandora_agent.conf
Any custom files (map images, plugins)

3. Use the method you prefer to update: RPM, DEB or tarball/sources

1.1.1 Installing additional network and local components

Since Pandora FMS 4.0.3 there are new network and local components out of the box. If you install this version all these new components will be installed by default. But if you have Pandora FMS 4.0.x installed you must run some auxiliar scripts to get all these new modules.

The scripts are located in <pandora_console>/extras and are the following:

network_components.mysql.sql
network_components.oracle.sql
network_components.postgreSQL.sql

You must execute the correct script using your DBMS for example MySQL:

mysql -u root -proot pandora < network_components.mysql.sql

These scripts will add new component groups and new network components.

Info.png

If something fails during the script execution (for example duplicate index because you have a group already created) you can modify them to insert the new modules properly in you database. The scripts are SQL syntax only.

 


If you have the enterprise version you will find similar scripts for local modules, located at <pandora_console>/enterprise/ and are the following:

local_components.mysql.sql
local_components.oracle.sql
local_components.postgreSQL.sql

You can execute the script like previous ones, for example:

mysql -u root -proot pandora < local_components.mysql.sql

Template warning.png

Before to execute local_component script, you must execute network_component script to create the new component groups

 


1.1.2 Updating/Upgrading from RPM

First you should know if it's an update or a reinstall. For this, first check the package version that is installed in your system:

rpm -q -a | grep pandora

If you have installed pandora's packages, they will be shown as a list of the package name and version, e.g:

pandorafms_console-3.0.0-1

This means that you have the "pandorafms_console" package in version "3.0.0-1". If you want to install the same version that you have already installed, you can "reinstall" writting the command:

rpm -i --force <nombre_paquete.rpm>

Sometimes "updates" of version with the same name and same number are releases (so they are development corrections, etc). For this, you should have to reinstall, forcing the installation with --force.

If it is the same package, but from a high version, you can update it with this command:

rpm -U <nombre_paquete.rpm>

To force an update of a version that you have already installed, same very similar to the reinstallation, but that will keep your original files if they have been modified and the new version will have the same version that the packages that you installed in first place, you can force the update:

rpm -U --force <nombre_paquete.rpm>

Be specially careful before reinstalling or updating any package and do security copies of:

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

Remember that if you're using the Enterprise version, you must also upgrade the enterprise packages, using the same method as explained here.

1.1.3 Using .deb packages

If you are using a Debian or Ubuntu, or another system that uses .deb packages, just install the new packages. Debian package system will manage the uninstall of previous version and wild ask you to conserve the old version.

dpkg -i package_names.deb.

If you have dependency problems, resolve it with:

apt-get install -f

Install new packages and replace the configuration files with your backup.

Remember that if you are using the enterprise version will also have to upgrade packages using the enterprise .deb packages.

1.1.3.1 Pandora Agent Unix

When you update a Pandora Agent Unix, in the final part of installation the system ask for to overwrite the plugins files. Please check if this plugins have a modifications for to avoid overwriting.

1.1.4 From Tarball / Sources

1.1.4.1 WEB Console

For Console, first decompress tarball file which contains Pandora FMS console to /tmp

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

Automated way

In SUSE (Vmware image or CD Appliance):

cd /tmp
cd pandora_console
./pandora_console_upgrade -p /srv/www/htdocs/pandora_console

Second parameter (in this example /srv/www/htdocs/pandora_console), is the path where Pandora FMS console is already installed.

In Ubuntu/Debian

cd /tmp
cd pandora_console
./pandora_console_upgrade -p /var/www/pandora_console

Manual way

Untar the pandorafms console tarfile to /tmp/pandora_console. Copy contents of /tmp/pandora_console to Pandora FMS current directory.

In SUSE (Vmware image ór CD Appliance):

cp -R /tmp/pandora_console /srv/www/htdocs/
chown -R wwwrun:root /srv/www/htdocs/pandora_console

In Ubuntu/Debian:

cp -R /tmp/pandora_console /var/www/
chown -R www-data:root /var/www/pandora_console

You can safely delete temp files from /tmp/pandora_console

rm -Rf /tmp/pandora_console

Versión Enterprise (Manual only)

In order to upgrade the Enterprise version, the /enterprise directory and all its contents must be copied to the root directory of Pandora FMS Web Console.

1.1.4.2 Server

For server, first decompress tarball file which contains Pandora FMS Server to /tmp

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

Automated way

Proceed to do the upgrade using the upgrade script

cd pandora_server
./pandora_server_upgrade --upgrade

Manual

This procedure will install new biraries and libraries, this doesnt update/upgrade the very important Pandora FMS tools. You will need to copy them one by one.

cd pandora_server
perl Makefile.PL
make
make install

And delete temporal files if doesnt need anymore.

rm -Rf /tmp/pandora_server

Enterprise version

The process is very similar to previous server upgrade. Just decompress the tarball and execute this as root:

perl Makefile.PL
make
make install

This should upgrade your Enterprise server.

1.1.4.3 Agent

Decompress tarball file

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

Run the installation tool that will install the agent as a whole, as well as tools and plugins that it contains. This installer makes an automatic backup of your configuration files in/etc/pandora/ pandora_agent.conf.yyyy-mm-dd. Just run the script and copy the contents of your backup configuration file in /etc/pandora/pandora_agent.conf.

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

And delete temporal files if doesnt need anymore.

rm -Rf /tmp/pandora_agent

Experts only: You can replace only the agent executable /usr/bin/pandora_agent or c:\program files\pandora_agent\pandoraAgent.exe to update the agent. Before, stop the process / service to replace the executable. This is useful for a quick upgrade.

Remember that in the "minor" version releases, there are no changes to the database schema, , so it's enough to replace/upgrade the files as described above. "Major" versions, for example 3.0 to 3.1, 2.1 and 3.0, have changes in the database schema and will require a database conversion.

See the documentation for more details.

1.2 Update a major version

This is the same process as with a minor version, but you will need to UPGRADE your database schema and data. This process is described below.

1.2.1 Upgrade database schema (Major Version only)

A major version is when upgrade from 3.0 to 3.1 or when migrate from 3.x to 4.x for example. A 4.0 to 4.0.1 is not a major version and doesnt need a database upgrade.

Major version upgrade/migration needs to do a database upgrade. The database upgrade works from the command line interface. This upgrade convert all information, you should not lost anything in the upgrade, but anyway, ALWAYS do a full-backup first (not only database, also code and configuration. Follow the steps for upgrade as described below.

Install your the packages for your new version of Pandora FMS (including the enterprise packages). Needed files for doing the database upgrade are in that packages, you can found in {PANDORA_CONSOLE}/extras directory and {PANDORA_CONSOLE}/enterprise/extras (enterprise only).

{PANDORA_CONSOLE} is your Pandora FMS console directory containing the console code. In a SUSE is /srv/www/htdocs/pandora_console, in a Debian/Ubuntu is /var/www/pandora_console. It depends on system.

Go to the directory extras there is a file called pandoradb_migrate_vX.Y_to_vX.Z.sql. This file has all the SQL code needed 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 steps needed to make the conversion are:

1. First of all: ¡Make a backup of your current database!.

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

2. 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. This will ask your pandora user password for Mysql (you can check it in your current /etc/pandora/pandora_server.conf file. We assume that your Pandora FMS database is called "pandora" and it's running on the same machine you're running this 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 minutes/seconds, the database is ready to work with the latest version of Pandora FMS.

In case of any problem, the backup can be restored to go back to your previous version with this command:

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

1.2.2 Enterprise DB schema

The process is almost the same. In the /enterprise/extras directory you have a file called pandoradb_migrate_vX.Y_to_vX.Z.sql. Use this file like the OpenSource migration 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 Update from version 4.x to 5.0

1.2.3.1 Compound alerts

In the version 5.0 the compound alerts have been deleted completely. If exist, will be deleted during the migration process.

1.2.3.2 Plugins

The system of plugins has change in Pandora FMS 5.0. The data of this kind of modules now are differente, so will be necessary update it.

If the current installation has plugins and plugin modules, after the upgrade we need to execute the following script:

/usr/share/pandora_server/util/pandora_migrate_plugins.pl <dbname> <dbhost> <dbuser> <dbpass>

The PSPZ files to import plugins of previous versions of 5.0 are compatibles with the new system.

1.2.4 Update from version 3.2.1 to 4.0

After update Console from Tarballs, DEB or RPM and access to Web console could appear 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 

For resolve these errors just add the following line in file <pandora_console_path>/include/config.php:

$config["dbtype"]="mysql";

If you have the SSH extension in your setup please delete it, it's old and will not run with 4.0 (and it will make console to crash).

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

Some 3.2 setups give problems in an autoincrement table, if it's your case, insert this in the SQL (by using the SQL manager in the console, or using mysql command line client):

ALTER TABLE tsesion AUTO_INCREMENT = 1;

After upgrade the server, a new servers will be available for high speed monitoring with ICMP and SNMP, for using that you need special requirements. Please read it carefully and disable it by default configuring following lines in your pandora_sever.conf:

snmpserver 0
icmpserver 0

1.3 Problems upgrading from a previous version (Perl Libraries)

Sometimes upgrade puts Pandora FMS libraries on different places where are installed old version, so after a upgrade you have two different versions of Pandora FMS libraries and you cannot know exactly what version will be used, if the old one or the new one. Best solution here is locate the libraries, delete all of them, and reinstall/upgrade. For that ejecute:

find /usr -name "Core.pm"

This will show you a few lines like:

/usr/lib/perl5/site_perl/5.10.0/PandoraFMS/Core.pm
/usr/lib/perl5/vendor_perl/5.10.0/Bootloader/Core.pm

Pandora FMS libraries are placed on /usr/lib/perl5/site_perl/5.10.0/PandoraFMS/. Delete it safely and reinstall again (from packages or tarball sources).

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

Perl version and exact location may differ in each linux distro, so you will need to locate prior deleting the directory written here.

1.4 Problems upgrading from a previous version (Database)

If you find a problem is probably because you are upgrading a 2.x version that comes from a version 1.x, or because it has made manual changes to the DB scheme. If you get a message like this:

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

This is due because a problem in MySQL because some fields has no the expected type. id_agente_modulo field in 2.1 should have bigint(10) type. If you have migrated from a 1.x before you will have this problem. Before running the migration tool to 3.0, enter this command in the mysql console:

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

And try to run again the upgrade tool. Please remember that you need InnoDB support for your MySQL database server.

2 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 the source package to "patch" the problem can be presented in several formats:

2.1 From distro packages

A package (RPM or DEB): just install the package:

Ubuntu/Debian

dpkg -i <package_name>

SUSE/RedHat/CentOS/Fedora

rpm -u <package_name>

2.2 From tarball or SVN

A package in tarball/Source format. This implies you know a bit more about the internals of Pandora FMS, that means, you know "where" are the files you will replace. Using a tarball is just a way to say, you have the source files and you will replace that for your installed Pandora FMS files.

In Console:

All files should be put on /var/www/pandora_console (Ubuntu/debian), /srv/www/htdocs/pandora_console (SUSE), or other directories, depending on distros.

In Server:

It depends on your version and install method, but the files you will need to replace should be searched before:

  • Libraries: find /usr -name "PluginServer.pm", usually should be at /usr/lib/perl5/PandoraFMS
  • Binaries: find /usr -name "pandora_server", usually should be at /usr/bin

2.2.1 Example of manual Console update

For example, if you have a tarball called pandorafms_console_3.1_securityfix_may2011.tar.gz, do the following steps:

(Supposing you're on a standard SUSE system)

cd /tmp
tar xvzf /home/youruser/download/pandorafms_console_3.1_securityfix_may2011.tar.gz
cd pandora_console
cp -R /srv/www/htdocs/pandora_console
sudo chown -R wwwrun /srv/www/htdocs/pandora_console

2.2.2 Example of manual Server update

For example, if you have a tarball called pandorafms_server_3.1_securityfix_may2011.tar.gz, do the following steps:

(Supposing you're on a standard SUSE system)

cd /tmp
tar xvzf /home/youruser/download/pandorafms_server_3.1_securityfix_may2011.tar.gz
cd pandora_server

(Locate where are your Pandora library files)

sudo find /usr -name "NetworkServer.pm"
.
.
/usr/lib/perl5/site_perl/5.12.1/PandoraFMS/NetworkServer.pm

Whoah, that's not the default installation dir (because in this same it's installed from the sources, not from RPM). We know now the location of Pandora FMS libraries, at /usr/lib/perl5/site_perl/5.12.1/PandoraFMS/ directory, so copy all updated libraries overwriting the old ones (this step is the same -but with different directory names- if you have your system installed from packages instead from sources):

sudo cp -R lib/PandoraFMS/*.pm /usr/lib/perl5/site_perl/5.12.1/PandoraFMS/

Don't forget to copy also the binaries and tools

sudo cp -R bin/* /usr/bin 

(Forget the warning message about skipping copy for PandoraFMS directory, it's normal).

sudo cp -R util/* /usr/share/pandora_server/

3 Console updates using Update Manager

3.1 OpenSource Updates

Since Pandora FMS 4.0.2 you can update, using OpenSource version, from weekly semiautomatic updates. This feature is based on a improvement of Update Manager system, previously only available with Enterprise version, now you can check online if there is a new update and download and update your console automatically under request.

This feature has the following characteristics:

  • The server which has Pandora FMS console must be connected to Internet.
  • Update Manager will contact our server for new updates (on Sourceforge). Send anonymous statistical data about the use of Pandora FMS (# of agents).
  • An update from Sourceforge will be downloaded from weekly updates folder.
  • The updates are incremental and they have the content of the whole console, so this process could take a lot of time (the packages weight is about 25 MB).
  • Updates are automatic: they are not reviewed by the team, in the 99% of cases no problem is expected but we could not guarantee nothing if a problem occurs.
  • The updates are only for console not for agents and server.

3.1.1 Console updating process

It's very easy. Just go to Extensions -> Update Manager. The main screen allow you to check for new updates available to be installed, also you can see the list with previous updates installed (in this picture there is no previous updates yet). Click on install.



Update manager open.png

Click on install button.

Info.png

To use Update Manager your server which hosts Pandora console must be connected to Internet. By default Pandora will use WGET to download the packages (it's faster), it's possible to use CURL method (you can change it in Pandora configuration) but it's slower

 




Update manager open2.png

When the packages was downloaded and installed, you will return to main page which will be like this. It shows the updates installed and a message saying there is no more updates available. Congratulations, you have updated to a new version!.



Update manager open3.png

3.2 Enterprise updates

Unlike Open updates, Enterprise updates have several additional features:

  • 100% tested by development team, so you can enjoy updates the same day (even a few hours later) that an incident was open.
  • Specific updates (incremental) which allow you to update only the part that is outdated, without downloading heavy packages.
  • Offline updates are allowed, downloading packages from support page for Pandora FMS installation which are not connected to Internet (due to security reasons).

To use Enterprise version of Update Manager first of all you must configured your serial number and the kaygen installed

Para poder usar Update Manager en la versión enterprise, primero ha debido configurar correctamente su nº de serie y tener instalado el "keygen", y configurado éste adecuadamente, en la pantalla de setup, tal y como se muestra aquí:



Update manager4.png



From Operation>Extensions>Open Update Manager, you can access to Update Manager. If you have Enterprise versions installed you can use this interface, if not Open version will be displayed.



Update manager5.png



In this page you can see the current version number of Pandora FMS and will notify you for new updates available.

To update to a new version, click on "Update" button.

You can mark the checkbox "Overwrite local changes" which will overwrite any existing local modification of the files.

3.2.1 "Offline" updates

You can download "offline" updates of Pandora which are packages with .OUM extension. To do that go to Pandora FMS official support page and download .OUM files which will be like this:



Update manager7.png



Upload it to the console using this control:



Update manager6.png



The update will be applied automatically.

3.3 PHP engine additional configuration to operate with Update Manager

To ensure Open Update Manager is executing properly it needs more memory than the amount assigned by default. To assign more memory to PHP execution you must edit the php.ini file and set the reserved memory to at least 64M.

The line is:

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

Commonly, on Debian/Ubuntu systems the file is located in directory /etc/php5/apache2.

Go back to Pandora FMS documentation index