уторак, 21. јун 2011.

How to upgrade Linux Ubuntu from 9.04 to 10.04 which is running Nagios

My Ubuntu is running Nagios monitoring system, so I didn't want to do fresh installation, but upgrade it, as Linux Ubuntu Desktop 9.04 come to End Of Life. I tried with regular procedure:

$sudo apt-get update
$sudo apt-get dist-upgrade
$sudo do-release-upgrade

and got error message: "An upgrade from 'jaunty' to 'lucid' is not supported with this tool".

After googling, I found direction how to do it.
  1. perform CD upgrade from Ubuntu 9.04 to Ubuntu 9.10
  2. after successful CD upgrade, run regular procedure for upgrade from Ubuntu 9.10 to Ubuntu 10.04
Prior procedure of upgrade, I made a backup of my disks/partitions using Clonezilla.

For the CD upgrade, I downloaded iso image of Ubuntu Karmic Koala (9.10) from Ubuntu releases link using Alternate install CD version.
Downloaded iso image, mounted (there is no need to burn it onto disc):

$sudo mount -o loop ~/Desktop/ubuntu-9.10-alternate-i386.iso /media/cdrom0/

Press Alt+F2, and typed following:

gksu "sh /cdrom/cdromupgrade"

and went through procedure of upgrading smoothly.

After successful upgrade from Ubuntu 9.04 to Ubuntu 9.10, I run regular procedure for release upgrade (from Ubuntu 9.10 to Ubuntu 10.04), and that also finished smoothly.

Few things need to be fixed after upgrade.

MySQL server and client were removed, so I installed it (mysql-server, mysql-client, libmysqlclient-dev).

NDOUtils didn't work anymore, because of following:

"/usr/local/nagios/bin/ndo2db: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory"

On my upgraded system, I have now libmysqlclient.so.16. To fix this, I had to compile and install again NDOUtils. To correct high IOwait CPU usage of NDOUtils, I used patch from centreon:

$sudo wget -k -np http://svn.centreon.com/trunk/Patch-NDOutils/
$cd svn.centreon.com/trunk/Patch-NDOutils/
$sudo ./configure --prefix=/usr/local/nagios/ --with-mysql-lib=/usr/lib/mysql
$sudo make
$sudo cp ndomod-3x.o /usr/local/nagios/bin/ndomod.o
$sudo cp ndo2db-3x /usr/local/nagios/bin/ndo2db
$sudo chown nagios:nagios /usr/local/nagios/bin/ndo2db
$sudo chown nagios:nagios /usr/local/nagios/bin/ndomod.o

And, NDOUtils work again.

Next thing, which I needed to repair was successful running of check_mssql_health Nagios script. For that, I needed freetds, installed from source.

$wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
$tar -xzvf freetds-stable.tgz
$cd freetds-0.82/
$sudo ./configure --prefix=/usr/local/freetds/
$sudo make
$sudo make install

I already had configuration of freetds in /usr/local/freetds/etc/freetds.conf, so I didn't make any changes in this file (everything was already configured). I was missing following perl modules: DBI and DBD::Sybase.

$sudo perl -MCPAN -e shell
cpan>install DBI
cpan>install DBD::Sybase

I got error: "Please set SYBASE in CONFIG, or set the $SYBASE environment variable at Makefile.PL line 120, line 44"

So, I made changes in CONFIG file (~/.cpan/build/DBD-Sybase-1.12-LmLVY7)

$sudo vi CONFIG
SYBASE=/usr/local/freetds
EXTRA_LIBS=-linsck
$sudo perl Makefile.PL
$sudo make
$sudo make install

And, that was it.