I had to move Cacti now three times in the past year from one server to another. This process is not a part of the standard Cacti documentation, so you have to go hunting. Here is what I found to be the best process. Well, at least a working process. Many of these specifics are due to our Centos 4.4 kickstart install, i.e. SELinux, etc...
New Server:
1. Insure that MySQL is up and running. Mine wasn't due to SELINUX. I also needed the MySQL client.
yum install MySQL-client-standard
yum install perl-DBD-MySQL
service MySQL start
failed
service mysql restart
failed
vi /etc/my.cnf
(comment out the basedir option
#basedir=/var/lib
service mysql restart
failed
system-config-securitylevel
change permissions to allows mysql
service mysql restart
ok.
2. Download the source rpm or use the one you already have. Rebuild it on the new server and then install it.
rpmbuild --rebuild cacti-0.8.6j-1.src.rpm
rpm -Uvh /usr/src/redhat/RPMS/i386/cacti-*
oops, need other packages
yum install php-mysql php-snmp rrdtool
rpm -Uvh /usr/src/redhat/RPMS/i386/cacti-*
oops, need rrdtool and perl-rrdtool
rpm -Uvh perl-rrdtool-1.2.15-1.el4.rf.i386.rpm rrdtool-1.2.15-1.el4.rf.i386.rpm
rpm -Uvh /usr/src/redhat/RPMS/i386/cacti-*
ok.
Old Server:
1. Stop Cacti from running by removing or moving the crontab job from /etc/cron.d. I just moved it to root's home area in case I need it again.
2. Backup the cacti database:
mysqldump -u root -p cacti > cacti_export.sql (-u username -p prompt me for the password database_name > sql file)
3. Copy the cacti_export.sql file to the new server.
4. Copy the rra, scripts, and any other modified files to the corresponding directory on the new server.
scp -r /var/www/cacti/rra/* root@violet:/var/www/html/cacti/rra/
...That's right, violet lives again.
New Server:
1. Create the cacti databases, import old database, and set appropriate permissions.
mysqladmin --user=root create cacti
mysql -u root -p cacti < /root/cacti_export.sql mysql -u root -p cacti mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'the password of cactiuser';
mysql> flush privileges;
mysql> quit;
2. Verify the permissions are set correctly on the rra/ and log/ directories in cacti's home area.
chown -R cactiuser:cactiuser rra/ log/
It never hurts to make sure, especially after you have copied files from another server.
3. I then go to the log/ directory and tail -f the cacti.log and watch for the next crontab job to run and hopefully see good results.
I think that is all I had to do, but this is the best I can remember. If you have SNMP access lists on your devices or any firewall rules in your path, always make sure to change them to reflect the new server.
EXTRAS:
I install the cacti plugin architecture, www.cactiusers.org, primarily the thold plugin. The steps are easy to follow, so I leave you to follow their documentation.
Matthew
Tuesday, May 22, 2007
Tuesday, May 15, 2007
Xen
Red Hat Enterprise Linux 5.0 came built with the XEN virtualization software. I installed Centos 5.0 this afternoon on a Dell 2950 with two dual core CPUs. I made sure to select the virtualization option during the OS install. I also had to enable the virtualization option in the BIOS for the CPUs, but in the end I was able to successfully launch the XEN VM manager.
I stumbled upon a lab from Red Hat walking you through how to setup different VM scenarios. I was able to run the command virt-manager and get a window similar to the start screen for VMWare. Tomorrow I am taking my Windows XP disk in and am going to try and get an XP machine up and running in XEN.
It has been a few years since I used Linux extensively. I had begun only using CYGWIN to get my XTerm windows that I love so dearly. After starting the new job I have started running Linux on the laptop again. It always works great if you are ok with having to settle on a few issues...the chief being Office Application interoperability. I always end up with a Windows XP Pro VM using VMware, but I would really like to use the native and open source solution provided from Red Hat. I will let you know how it goes.
Matthew
I stumbled upon a lab from Red Hat walking you through how to setup different VM scenarios. I was able to run the command virt-manager and get a window similar to the start screen for VMWare. Tomorrow I am taking my Windows XP disk in and am going to try and get an XP machine up and running in XEN.
It has been a few years since I used Linux extensively. I had begun only using CYGWIN to get my XTerm windows that I love so dearly. After starting the new job I have started running Linux on the laptop again. It always works great if you are ok with having to settle on a few issues...the chief being Office Application interoperability. I always end up with a Windows XP Pro VM using VMware, but I would really like to use the native and open source solution provided from Red Hat. I will let you know how it goes.
Matthew
Wednesday, May 02, 2007
Google Apps
If you have your own domain or perhaps have your own company then you must checkout Google Apps.
I have heard great things about it and it seems to be a way to a possible future for office applications and communications. I have tested one of my domains, linuxfan.us, and it works like a snap. You can login to gmail or gtalk with your own domain. I created a mpbrown@linuxfan.us user and a dbrown@linuxfan.us user for my Dad. I was able to login with each in gtalk.
Very cool.
Matthew
I have heard great things about it and it seems to be a way to a possible future for office applications and communications. I have tested one of my domains, linuxfan.us, and it works like a snap. You can login to gmail or gtalk with your own domain. I created a mpbrown@linuxfan.us user and a dbrown@linuxfan.us user for my Dad. I was able to login with each in gtalk.
Very cool.
Matthew
Okay, now we're back so let's talk about...
I was looking for some good Solaris tips on disk arrays and came across this blog, Blog O'Matty, which had several articles pertaining to Solaris, Linux and others. I believe this guy had written an article for the old Sys Admin magazine I used to get. I especially liked the post about the RHEL 5 ftp client and there being a bug in the "C" code.
Red Hat Enterprise Linux 5 FTP bug
It was the first time in over seven years that I looked at "C" code and I didn't understand the difference between a long data type and a long long data type. I do now as I searched Google to find the answer. Quite obvious in the end as it was just that a long data type had a certain limit to how big a number it could hold. A long long data type holds more data...obvious I know.
In the end my search lead me to http://www.sunfreeware.com where I was able to find most of my favorite Linux tools ported to Solaris. Primarily I found vim, bash, and tcpdump, but there is more!
Matthew
Red Hat Enterprise Linux 5 FTP bug
It was the first time in over seven years that I looked at "C" code and I didn't understand the difference between a long data type and a long long data type. I do now as I searched Google to find the answer. Quite obvious in the end as it was just that a long data type had a certain limit to how big a number it could hold. A long long data type holds more data...obvious I know.
In the end my search lead me to http://www.sunfreeware.com where I was able to find most of my favorite Linux tools ported to Solaris. Primarily I found vim, bash, and tcpdump, but there is more!
Matthew
Subscribe to:
Posts (Atom)