migrasi cacti, installasi spine dan network-weathermap

Cacti saya sudah lama running on FreeBSD 5.5 sampai versi 7,  karena sesuatu hal saya mau ganti sistem operasinya dari FreeBSD ke Linux distribusi Debian, karena ada banyak keunggulannya.  Bagaimana prosesnya apalagi server ini production 24 jam dan dipakai ratusan client untuk bandwidth graphic utilization mereka. Berikut langkahnya :

Old Cacti : Location : Data Centre West Africa, sistem operasi FreeBSD, Mysql

New Cacti : Location : Data Centre West Africa, sistem operasi Linux distribusi Debian

Kunci utama keberhasilan migrasi ini ada pada database MySQL dan RRD Files, dan tahapannya sbb :

Install Cacti on the New Server
Turn Off Cacti at the Old Server
Migrate the Database
Copy the RRD Files as XML
Reconvert the XML back to RRD File
Activate the New Cacti
Install Spine dan Network-weathermap

OLD CACTI SERVER :

Matikan Pooling Cacti dengan stop proses pada cron.  Cron file pada FreeBSD ada di /etc/crontab

Backup MySQL DB :

# mysqldump -u root -p cacti > cacti_db20August2011.sql

Filenya SCP atau SFTP ke new server.

Copy RRD File as XML

# cd /usr/local/share/cacti/rrd

# ls -1 *.rrd | awk ‘{print “rrdtool dump “$1” > “$1″.xml”}’ | sh -x

# tar -czvf ~/rrd.tgz *.rrd.xml

Filenya SCP atau SFTP ke new server

NEW CACTI SERVER :

Sistem operasi Linux distribusi Debian 6, Cacti, SNMP, RRDTOOL,MySQL,PHP,APACHE2 harus sudah terinstall.

Sesuaikan user password nama database MySQL untuk cacti user, setelah cacti selesai diinstall menggunakan apt-get, matikan poller :

# nano /etc/cron.d/cacti

Restore cacti_db20August2011.sql :

#mysql -u root -p cacti < cacti_db20August2011.sql

Reconvert XML file ke RRD :

# cd /var/lib/cacti/rra/

# ls -1 *.rrd.xml | sed ‘s/\.xml//’ | awk ‘{print “rrdtool restore “$1”.xml “$1}’ | sh -x

# chown www-data:www-data *.rrd

Setelah beres, akses web gui cacti dan pilih mode upgrade, edit dan ikutin petunjuk yang ada di setiap menu, path bin pada FreeBSD berbeda dengan Debian, jadi harus mengganti beberapa path seperti adodb, rrdtool, php, snmpwalk, snmpget, snmpbulkwalk, snmpgetnext, cacti.log.

Selesai untuk migrasi cacti dan untuk administrasi bisa dilakukan melalui Cacti Admin  via web GUI dan juga cek log :

tail -f /var/log/cacti/cacti.log
tail -f /var/log/apache2/access.log
tail -f /var/log/apache2/error.log

Aktifkan poller cacti :

# nano /etc/cron.d/cacti

 

Instalasi SPINE :

# apt-get install cacti-spine

# nano /etc/cacti/spine.conf

Instalasi Network Weather Map

# wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gz
# tar xvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
# wget http://www.network-weathermap.com/files/php-weathermap-0.97a.zip
# unzip php-weathermap-0.97a.zip
# cd cacti-plugin-arch/files-0.8.7g
# sudo cp -R * /usr/share/cacti/site/
# cd ..
# mysql cacti < pa.sql -u root -p
# nano +107 /usr/share/cacti/site/include/global.php

$config[“rra_path”] = ‘/var/lib/cacti/rra’;

# nano +197 /usr/share/cacti/site/include/global.php

include(‘/usr/share/php/adodb/adodb.inc.php’);

# nano +100 /usr/share/cacti/site/include/global.php
$config[‘url_path’] = ‘/cacti/’;

# nano +42 /usr/share/cacti/site/include/global.php

/* Weathermap */
$plugins = array();
$plugins[] = ‘monitor’;
$plugins[] = ‘weathermap’;
# chmod 644 /usr/share/cacti/site/lib/plugins.php
# chmod 644 /usr/share/cacti/site/include/plugins.php
# cd cacti-plugin-arch/files-0.8.7g

# mv weathermap/ /usr/share/cacti/site/plugins
# chown -R www-data:www-data /usr/share/cacti/site/plugins

Selesai, tinggal mencustomize Network-Weather map melalui Cacti Admin Web GUI.

2 thoughts on “migrasi cacti, installasi spine dan network-weathermap

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.