Archive for January, 2009
— Cacti on Fedora 10 —
One thing I’ve noticed about the Ubuntu community, is they have some really great
guides for configuring server packages. However, I like Fedora…….I guess it’s the hat or something.
While there is a Fedora Doc site, it’s lacking guides for most things that are in
the Fedora repos.
I’m planning on joining the Fedora team and submitting such docs in the future. I figured
this would be a great place to test some of my guide ideas.
I’m using a cross between the docs at the cacti site and my own trial and errors.
This will be a multi-part HOWTO. The first write up, will walk you through everything
needed to get cacti up and running on Fedora 10 from scratch.
—————–
0. I’m assuming you have Fedora 10 already installed and ready to go.
—————–
1. Installing Cacti and all the requirements: (mysql server, apache, etc.)
# You can simply copy and paste. If you’re not in the sudoers file yet, either add yourself or switch to root.
sudo yum install -y mysql mysql-server httpd mod_ssl php php-snmp php-mysql net-snmp net-snmp-utils rrdtool cacti
# Almost everything will be done for you (so no need to follow the Cacti Manual 100%)
# However, it’s good to read and understand where all the core files are.
# So either visit the cacti site or check the docs under /usr/share/doc/cacti-0.8.7b/*
—————–
2. Setup the MySQL server:
# If you’ve just installed the MySQL server, you’ll need to configure the root account & password.
# If you already have a mysql server installed and configured simply skip the “mysql_secure_installation”.
sudo service mysqld start
sudo /usr/bin/mysql_secure_installation (answer all questions as needed/desired)
mysqladmin -u root -p create cacti
sudo mysql -p cacti < /usr/share/doc/cacti-0.8.7b/cacti.sql
# Open the mysql database and configure the cacti user privs/password etc.
mysql -u root -p mysql
mysql>GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'SOME-PASSWORD';
mysql>flush privileges;
mysql>exit
——————
3. Configure the cacti database configuration settings:.
Backup the default config.php (/usr/share/cacti/include/config.php), which actually links to “/etc/cacti/db.php”
Then edit “/etc/cacti/db.php” and specify the database type, name, host, user and password for your Cacti configuration.
sudo vi /etc/cacti/db.php
$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cactiuser”; <—- created via the cacti.sql script
$database_password = “cacti”; <—- change this to the above ‘SOME-PASSWORD’
—————–
4. Configure Cron to run the poller script:
# Make sure your /etc/cron.d/cacti looks like so. (you’ll need to remove the #)
*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
—————–
5. Start up mysql and apache:
# Start/Restart your MySQL and Apache servers.
sudo service mysqld start
sudo service httpd start
#Point your web browser to:
http://localhost/cacti/ or https://localhost/cacti/
Continue with the installation via the web browser, when you get to the page that locates “rrdtool” etc.
make sure everything is “FOUND” and has the correct path.
IMPORTANT – at the bottom of this same screen change the default “RRDTool Utility version” from 1.x to 1.2.x.
Click “Finish”
Log in the with a username/password of admin. You will be required to change this password immediately.
You can now start creating new devices per the Cacti users guides or poke around and figure it out.
—————–
6. Alter the cacti.conf file for access:
Note: Once you’ve got everything set up the way you want and are ready to access your new Cacti install from
else where, you’ll need edit the /etc/httpd/conf.d/cacti.conf file.
Simply alter the Allow statement as needed.
#
# Cacti: An rrd based graphing tool
#
Alias /cacti /usr/share/cacti
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
—————–
7. Make sure mysqld and httpd are running on boot.
sudo chkconfig httpd on
sudo chkconfig mysqld on
—————–
In part 2, I’ll walk you through examples of configuring various devices.
Take care.
DB
Just another “quick tip” from the field.
Starting in Vmware Workstation 6.5 they removed the old (working) vmware-config.pl script.
If for some reason you need to force a reconfig/recompile of the vmmon modules etc.
Then simply run the following as root/sudo
vmware-modconfig --console --install-all
HTH
DB
Even though I like Windows, Mac, Linux, or anything else that runs a box of parts thrown together, I always feel a great joy when reading about Tux stomping some butt.
Linux Based HPC’s – over 80%
Windows Based HPC’s – 1%
http://www.top500.org/stats/list/32/os
Quick Tips from the field.
If you’re running a Linux host with a Linux guest and are having issues with your keyboard keys being mapped wrong inside your VM. (Like my up arrow was remapped to “Print” etc)
Then you can try the following.
edit the following file: /etc/vmware/config
Add the following:
xkeymap.nokeycodeMap = true
save the file.
Make sure vmware isn’t running and restart the vmware services like….
#sudo /etc/init.d/vmware restart
Then launch vmware again.
HTH
This describes how to use the free versions of RealVNC to connect to your RedHat Enterpirse Linux 5 desktop from your Windows XP machine. These instructions might work for RHEL4, CentOS, Windows Vista, and other flavors of Linux, but I haven’t tried them. YMMV.
First download the latest free version for Linux to your RedHat machine from here:
http://www.realvnc.com/cgi-bin/download.cgi
Note: Since you are on RedHat, make it easy on yourself and grab the RPM version.
Unzip/Untar the file to extract the RPM, then install it:
rpm -i vnc-4.*.*.*.rpm
Next, you will need to edit the script which launches RealVNC or else it will choke on the font paths. So, as root, edit this file:
/usr/bin/vncserver
You should see a section in that file that looks like this:
# Add font path and color database stuff here, e.g.: # # $cmd .= " -fp /usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/"; # $cmd .= " -co /usr/lib/X11/rgb"; #
To jump to it quickly, just search for the word ‘font’ in your editor.
Now, you want to uncomment and edit the two necessary lines so that it looks like this:
# Add font path and color database stuff here, e.g.: # $cmd .= " -fp /usr/share/X11/fonts/misc/,/usr/share/X11/fonts/75dpi/"; $cmd .= " -co /usr/share/X11/rgb"; #
Got it? Good. Save that sucker and close it.
Don’t Run RealVNC As Root.
You need to be logged in as a non-root user when you fire up the VNC server, lest the application bomb out with errors. So, once you have chosen the user you wish to be, log in and edit this file:
/home/username/.vnc/xstartup
You will want to change the last line to use your GUI of choice (I prefer Gnome).
Change:
twm &
To:
gnome-session &
Save that sucker. Got it? Good.
There is one last thing to do before any of this will work, and that is to open the necessary port in your firewall. On your RedHat box, open the Firewall editor and add port 5901 to the list of allowed ports.
Fire It Up
Logged in as the non-root user you decided to run this as, enter the following at the command line:
#> vncserver :1
The first time you run this, you will be asked to create a password. Choose something you will remember by the time you get to your Windows machine to connect in a few minutes.
You should see a few notes about the server being started and the log file being created. And with that, the vnc server is ready for connections from your Windows box.
Setting Up Windows
Now, you need to download and install the free RealVNC viewer to connect to your RedHat machine, which again is available here:
http://www.realvnc.com/cgi-bin/download.cgi
When installing, choose the Viewer option, not the Server option. Once it’s installed, launch the application, and in the Server field, enter the IP or hostname of your RedHat server, followed by :1. For example:
192.168.1.2:1
Click OK, and you should be asked to enter the password you created a few minutes ago. Once you do, if all worked as planned, you should be looking at your RedHat desktop on your Windows machine.
Notes
Stopping RealVNC
Sometimes you may need to stop and restart VNC on the RedHat box. To do this, log in at the command line and enter:
#> vncserver -kill :1
It should say something like “Killing process 5036″, letting you know it has been completed.
Getting A Better Resolution
If your Windows box has a monitor running at a resolution different than that of your Linux box, you may want to change the resolution at which RealVNC runs. To do this, just add the desired resolution to the startup command like so:
#> vncserver -geometry 1440x900 :1
Let me just say I’m a big VMware fan. And since they started giving out ESXi for free, I try to pass on the love as much as possible.
However, sticking to open source values is very important to me for many reasons, and I recently discovered Xen is going away in RedHat Enterprise Linux (RHEL). I kinda figured it would die out as soon as Citrix bought up Xen.
So I dug around after a few emails with another virt guy.
Red Hat’s official statement:
http://www.redhat.com/about/news/prarchive/2008/virtualization.html
I guess if you’re sticking with RHEL’s way of doing things, you had better give up on Xen and start working with KVM / Ovirt etc.
It seems Xen will continue to be supported through the 5.x series, as they have lots of customers using it. (hmmm…)
So I guess there will be a tool or some article for transitioning later on.
Ovirt – http://ovirt.org/
KVM – http://kvm.qumranet.com/kvmwiki/Front_Page
FreeIPA – http://www.freeipa.org
However, this is all in a beta area for now.
My thoughts would be to simply go with VMware Server or ESXi server for production and then start testing the KVM solutions for future configurations. That’s just my two cents.
HTH
I have about a dozen email accounts I try to manage locally with Thunderbird. By and large, things run pretty smoothly until I need to move it all, as I did recently when upgrading from XP to Vista.
I have been a big fan of MozBackup in the past, but as my email accounts grew and I had more and more email stored in folders, MozBackup started taking a long time to process it all. After my move to Vista, I realized I had over 2GB of mail backed up, and restoring it from Mozbackup didn’t work. It recreated all my accounts and folders, but all the folders were empty.
After the initial panic faded, I found some forum threads discussing the manual opening of MozBackup archives and restoration of email. I finally got it all back, but it wasn’t without more than a few sweat bullets hitting the keyboard.
Since this episode, I have been looking for something to put my mind at ease in regards to email storage, backup, and even reduction. I don’t know why I had never heard of it, but I stumbled across MailStore, which offers a free home version called, get this, MailStore Home.
MailStore Home will back up and archive email from many different clients, including Outlook, Thunderbird, Exchange, GMail, Yahoo mail, and others. At first I thought it was too good to be true, but after installing it I was quickly impressed with the simplicity and ease of use.
I had soon archived my two biggest email accounts, and even burned them to DVD through the MailStore application itself. Knowing DVD’s aren’t indestructible, I also backed up the archive using Carbonite (another of my favorite apps).
Going back into a MailStore archive is very easy, and it lets you read email, open, and even search mail and contents of attachments.
Once I was convinced that I had succesfully archived and backed up all my email, I was able to go through my Inboxes and delete over 1GB of email. Hopefully, this will allow MozBackup to run more smoothly, if I ever really need it again in the first place.
If you find yourself with an unweildy inbox and a nagging feeling that you haven’t done anything to back it up, go grab MailStore Home now.
mailStore Home: http://www.mailstore.com/en/mailstore-home.aspx
Just a quick tip that might help out the folks needing something better than gcj and still using an open version of Java.
On CentOS 5.2 :
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm
yum install -y java-1.6.0-openjdk-plugin java-1.6.0-openjdk-devel java-1.6.0-openjdk
Hope that makes someone’s life easier!
Move Your Web Clippings Out of Google Notebook. Now. The free service has already stopped allowing new registrations, and will no longer be updated.
I can’t express the grief I have over this, as I have been a hardcore Notebook user since I discovered it about 9 months ago.
In case you haven’t heard of it, Google Notebook is a tool which allows you to save clippings, notes, and bookmarks which you run across while cruising around the information highway. It’s easy to save parts of web pages using the Notebook plugin for Firefox, and you can add bookmarks, pictures, and notes, and to boot.
There are alternative services offered, the most popular of which seems to be Evernote, but being forced to switch services is just not cool, not matter how good they might be.
I have had an Evernote account for quite a while, but I never used it because I preferred Google Notebook’s ease of use and simplicity. The worst part is that in order to import half of what I have saved in Google Notebook, I will have to purchase Evernote’s premium service and do it all by hand.
So, check back soon for an Evernote review!