Pandora: Documentation en: Anexo Upgrade

From Pandora FMS Wiki
Revision as of 10:31, 25 May 2017 by Antonio.sanchez (talk | contribs) (Additional PHP engine configuration for Update Manager)
Jump to: navigation, search

Go back to Pandora FMS documentation index

1 Update manual

Pandora FMS is fundamentally a triad of console, server and database. In Opensource installations these three components can be rapidly updated, whereas Enterprise installations contain extra functions that require updating separately.

Breakdown

Opensource installations:

  • Web Console.
  • Server.
  • Database.

Enterprise installations:

  • Open Web Console.
  • Enterprise Web Console (extended console functions).
  • Open Server.
  • Enterprise Server (extended server functions).
  • Database (Enterprise version additional charts).

Updates always include console changes, occasionally server changes, and rarely database changes. We'll divide the the updates into two super-categories: minor release updates, with no database changes; and major release updates, including changes to the database.


1.1 Minor release version update

These don't include any changes to the database, only to the console and sometimes to the server. Eg. updates 6.1 SP1 to 6.1 SP2.

Initial precautions/safeguards:

1. Back up the database. Eg: mysqldump -u root -p pandora > backup_pandora_X.Y.sql

2. Back up the config files: pandora_server.conf, config.php, pandora_agent.conf.

3. Back up server and agent plugins, at:

/etc/pandora/plugins
pandora_console/attachment/plugin
/usr/share/pandora_server/util/plugin

4. Suspend the following services: pandora_server, tentacle_serverd, httpd, pandora_agent and mysqld.

5. Update.

1.1.1 From RPM packets

  • Open console update:
rpm -U pandorafms_console_package.rpm
  • Enterprise console update:
rpm -U pandorafms_console_enterprise_package.rpm
  • Open server update:
rpm -U pandorafms_server_package.rpm
  • Enterprise server update:
rpm -U pandorafms_server_enterprise_package.rpm

You can find out which version you're running at any time, before or after the installation by executing the command:

rpm -qa | grep -i pandora

1.1.2 From DEB packets

  • Open console update:
dpkg -i pandorafms_console_package.deb
  • Enterprise console update:
dpkg -i pandorafms_console_enterprise_package.deb
  • Open server update:
dpkg -i pandorafms_server_package.deb
  • Enterprise server update:
tar zxvf pandorafms_server_enterprise_package.tar.gz
cd pandora_server/
./pandora_server_installer --install

In case of dependency problems, they can be resolved directly with:

apt-get install -f

1.1.3 From Tarball / Sources

  • Open console update:
tar xvzf pandorafms_console_package.tar.gz
cd pandora_console
./pandora_console_upgrade -p /yourconsolepath
  • Enterprise console update:
tar xvzf pandorafms_console_enterprise_package.tar.gz
cd pandora_console
./pandora_console_upgrade -p /yourconsolepath
  • Open server update:
tar xvzf pandorafms_server_package.tar.gz 
cd pandora_server
./pandora_server_upgrade --upgrade
  • Enterprise server update:
tar xvzf pandorafms_server_enterprise_package.tar.gz 
cd pandora_server
./pandora_server_upgrade --upgrade
  • Agent update:
tar xvzf pandorafms_agent_package.tar.gz
cd pandora_agent
./pandora_agent_installer --force-install

1.2 Major release update

Major release updates always include database changes so you need to update your database schema, eg. updates from version 6.0 to 6.1; or 6.1 to 7.0.

1.2.1 Database updates ("Major releases")

In order to update the database you first need to update the Open or Enterprise console, depending on your version. These updates allow the necessary sql files to be downloaded.

Once the console is up to date, the sql database update scripts can be found in /extras or /enterprise (again, depending on your version) on the console. On a standard CentOS installation they can be found at:

/var/www/html/pandora_console/extras/pandoradb_migrate_X.Y_to_Z.T.mysql.sql
/var/www/html/pandora_console/enterprise/pandoradb_migrate_vX.Y_to_vZ.T.mysql.sql

Before updating it's recommendable to follow the precautions described above: make a backup of the database and the config files, and suspend the Pandora FMS server:

service pandora_server stop
  • Open database update:
mysql -u username -p -D databasename

Eg.

mysql -u pandora -p -D pandora 

Execute the following from the MySQL command-line:

source /yourconsolepath/extras/pandoradb_migrate_X.Y_to_Z.T.mysql.sql;
  • Enterprise database update:
mysql -u username -p -D databasename

Eg.

mysql -u pandora -p -D pandora 

Execute the following from the MySQL command line:

source /yourconsolepath/enterprise/pandoradb_migrate_vX.Y_to_vZ.T.mysql.sql;

To exit MySQL execute "quit". The database is now updated to the correct version.

In case you need to go back to a previous version, you can restore the backed up database with:

mysql -u username -p databasename
> drop database databasename;
> create database newdatabasename;
> use newdatabasename;
> source backup_pandora_X.Y.sql

Eg.

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

2 Automatic update withUpdate Manager

2.1 OpenSource updates

From version 4.0.2 onward, Pandora FMS (Opensource version) permits automatic weekly updates, based on improvements in the Update Manager system (previously exclusive to Enterprise). It allows an online query to be carried out, to find out if there is an update available and, if so, to download it (under authorization) and automatically update the console.

Updates feature the following characteristics:

  • You need an outgoing Internet connection from the Pandora FMS console.
  • Update manager contacts our servers to get the latest version (in Sourceforge). It sends statistical data on the number of agents used (the data is anonymous). Enviará datos estadísticos de uso anónimos (nº de agentes).
  • Downloads the update from Sourceforge, from the directory of weekly updates.
  • Weekly updates are not incremental, but the total content for the console, which means the download can take a while (packet size is approximately 25MB).
  • Updates are automatic: they are not checked by the team, and cannot be guaranteed. However, in 99.9% of cases they present no issues.
  • Updates are only for the console, not agents or server.

2.1.1 Console update

Go to extensions -> Update manager. On the main screen you'll see if there are any updates pending or available to install, plus the latest console version. Click to install.

Um online open actualizar es.png

After downloading the packet a dialog will appear with the option to accept or reject the update.

Dialog um principal es.png

Click Confirm to begin the installation process.

Some updates contain modifications in the database. The update process launches a dialog to inform about these changes, as in the following screenshot.

Dialog hay mr es.jpg

At this point there are two possibilities, apply the changes to the database and update the console, or reject the update, and leave the console and database as they are.

Info.png

For Update Manager to work you need an outgoing Internet connection. It uses WGET by default to download packets, and can also use CURL but it is less fast.

 


After the process the main update page will appear with the updated console version displayed. Congratulations, you've successfully updated your version!


Um online open finalizado.png

2.2 Enterprise updates

Unlike Open installations, these have some additional characteristics:

  • 100% tested by our in-house development team, so you can update daily if necessary (even hours after opening an incident, in some cases).
  • Specific updates (incrementals) that only update out-of-date elements, without downloading heavy packets.
  • Enables "offline" updates, downloading packets from the support page, for Pandora FMS installations that don't have an Internet connection (security reasons).

To be able to use Update Manager Enterprise version, configure the updater from its menu options:

Opciones um es.png

Access Update Manager from the update section. If you have Enterprise version installed, you can use the interface (if not, the Open version will appear).

Um online pag principal es.png

From this page you can see the version of Pandora FMS you are currently using, plus any new updates available.

To update to the latest version click the console link. A dialog will appear that giving you the option to continue or not.

Dialog um principal es.png

If you click Continue, either, 1) the console will be updated and the process will finish; or, 2) the update includes changes to the database and a dialog will appear asking if you want to update the database or not.

Dialog hay mr es.jpg

If you update the database, the process will execute normally; however, if not, neither the database or the console will be updated, as some database changes can have critical consequences for console changes in the same update.

After, the updater will appear with the current version installed on Pandora FMS.

2.2.1 "Offline" updates

"Offline" Pandora FMS updates can also be downloaded, as they have .OUM extensions. Go to the official Pandora FMS support page to download.

Upload them with the following control:

Um offline pag principal es.png

Once uploaded, the file will appear. Click to start the update.

Um offline pag principal cargado es.png

The update follows the same operation flow as online downloads, displaying the corresponding console and database update dialogs, if there are any changes to be applied there.

Info.png

The Pandora Console can be updated in the same way, using zip files created by our team.

 


2.3 Additional PHP engine configuration for Update Manager

For Open Update Manager to execute correctly it needs more memory than it has pre-determinedly assigned. To assign more memory to PHP execution and for Open Manager to function, the php.ini file must be edited and a minimum memory of 256M established.

The line is:

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

Generally on Debian/Ubuntu systems, this file may be found here: /etc/php5/apache2.

http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en

3 Migración a otro sistema

Nos podemos ver ante la circunstancia de que queremos usar una nueva versión de Pandora en otro sistema/distribución diferente o más nueva, por ejemplo migrar de un SUSE 11 a un SUSE 12 o de un Ubuntu a CentOS.

Para realizar esto, lo único que tenemos que hacer es instalar en el nuevo sistema Pandora FMS desde cero, o descargar directamente la ISO que proporcionamos e instalarla.

1. Una vez este funcionando Pandora FMS en el nuevo sistema, procederemos a realizar un backup de la base de datos del anterior sistema:

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

2. Despúes enviaremos del modo que nos sea más sencillo el archivo backup_pandora_X.Y.sql del sistema viejo al nuevo.

3. Cerramos todos los procesos que esten corriendo excepto mysql.

/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)

4. Entramos en mysql con usuario root. Accedemos a la base de datos de pandora en el sistema nuevo, por defecto "pandora" e importaremos la base de datos.

#mysql -u root -p
mysql>use pandora
Database changed
mysql>source /home/artica/backup_pandora_X.Y.sql ( esta ruta variará dependiendo el directorio donde tengamos el backup )

5. En el caso de que fuese una migración a una versión mayor en la que cambia la esctructura de la base de datos, este sería el momento de ejecutar los scripts de migración tal y como se indica en el procedimiento de actualizacion mayor de versión.

6. Si hemos realizado un cambio de distribución tenemos que tener en cuenta que el PATH de la consola se ha modificado y en ese caso hay algunos campos en la base de datos que también se han modificado como son en tconfig "attachment_store" y "fontpath". Para modificar estos campos debemos introducir estas querys. El ejemplo es para una migración a CentOS, en otras distribuciones cambiar el path del directorio apache.

#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'

Estos Path también hay que tenerlos en cuenta en los archivos de configuración del servidor y de la consola (config.php y pandora_server.conf)

7. Una vez migrada la base de datos, tenemos que comprobar si los ficheros .../pandora_console/include/config.php y /etc/pandora/pandora_server.conf anterior y los nuevos tienen los mismos datos en los campos dbname, dbuser, dbpass. En el caso de que sean iguales no debemos hacer nada más. Si son diferentes, podemos hacer dos cosas:

a. Sustituir los nuevos ficheros por los antiguos o en su defecto los datos de los ficheros viejos por los que estan en los nuevos.

b. Dar permisos a la base de datos con los datos de la nueva instalación. Imaginando que la nueva instalación tiene estos datos; dbname=pandora, dbuser=pandora1 y dbpass=pandora2, se realizaría de este modo:

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

Después de esto, podemos volver a arrancar todos los demonios de nuevo y ya podremos acceder a la Consola de Pandora, con todos los agentes, módulos, alertas,... que teniamos configurados y si cambiamos la IP del nuevo Host por la del anterior, todos los agentes locales reportaran a este nuevo sistema.

En el caso de que se trate de una versión Enterprise, se seguirá el mismo proceso.

4 Actualización del cliente Windows desde el instalador

En el ejecutable de instalación de la consola y el servidor existe una nueva opción que permite actualizar Pandora FMS si está instalada en el equipo una versión anterior.

Inicie el instalador (.exe) como si fuera a realizar una instalación limpia y seleccione el idioma:



Pandora agent 3.0 RC3 install windows 01.png



Siga los pasos del instalador:



Pandora server install windows 01.png



Acepte los términos de la licencia:



Pandora server install windows 02.png



En el apartado Selección de componentes, escoja únicamente la opción de actualizar la versión instalada.



Pandora server update windows 01.png



Seleccione la ruta de instalación que desee y continúe. El instalador le preguntará la IP o el nombre del servidor de Pandora FMS.



Pandora server install windows 05.png



Tras esto empezarán a instalarle los componentes. Aparecerá un aviso recordándole que se necesita Microsoft Visual C++ para que los módulos funcionen adecuadamente.



Pandora server install windows 06 2.png



Cuando haga clic en Terminar, la instalación continuará hasta su finalización.



Pandora server install windows 08.png



Pandora está actualizado y listo para su uso.

Info.png

Con estos pasos, el código de Pandora será actualizado a la última versión, entre cuyos cambios se encuentra la sustitución de Apache por Nginx como servidor Web. En el caso de que se quiera mantener la instalación con Apache, deberá actualizar la consola a través de los paquetes OUM o el Update Manager Online.