Cacti on Fedora 10 – Part 1

— 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

Vmware Workstation 6.5 and Linux (host) kernel update woes

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

The YouTube Takedown: Part Deux

The LA Times interviewed me last week regarding the YouTube takedown of my Star Wars on a Banjo video (see YouTube Is Out To Get Me). The article is on the web for your perusal here:

http://latimesblogs.latimes.com/technology/2009/01/youtube-warner.html

Following a link at the bottom of that article, I discovered the site of Ben Sheffner, who runs a blog called  Copyrights & Campaigns, and who helped clarify the specific aspects of the DMCA laws regarding this situation.  Thanks, Ben.

I remain optimistic that YouTube will unblock my video, but it will rely heavily upon what level Warner Music Group decides to micromanage counterclaims.

YouTube Is Out To Get Me

YouTube has implemented a three-phased attack to thoroughly rid me of any reason to ever talk nice about it again.  They have succeeded.

Phase I – Google Search Drops My Site

It started in late December.  I run a site called TheBestOfYouTube.com which is just a blog I use to feature random videos I find on YouTube.  I write a little about them, and link to the video.  No harm done, and this is completely acceptable (and encouraged through video embedding) by YouTube.

For two years, a search for “best of you tube” or “you tube best” would show my site either first or second in the search results.  There is another site similar to mine (though more succesful) at bestofyoutube.com which would be right there at the top of the search results with me.

One day in late December, that all changed.  I was nowhere to be found for those searches, but bestofyoutube.com was still there.  If I searched Google for “thebestofyoutube.com” it would still show the site.  Using Google’s Webmaster Tools and Google Analytics, it was revealed the site was still being indexed by Google.

There didn’t seem to be any sandboxing of my site, as it’s still findable, just not using those important keywords.  Needless to say, my traffic dropped by about 85%, and thus my ad revenue fell with it.  Curiously, in December, I had received my largest-ever payment from Adsense, as the site had been steadily gaining traffic the previous couple of months.

In case you were late to the meeting and didn’t hear, Google owns YouTube.

Was this a penalization of some sort by Google?  Did the bestofyoutube.com guys do something to get my site unlisted for those keywords?  I have no idea, and I have no idea how to figure it out.  Either way, the fact that my site is still in Google’s index leads me to believe it was something that targeted me specifically.

Phase II – The Empire Strikes Back

On January 18, I received a letter from YouTube stating that Warner Music Group was claiming infringement on my “Star Wars on a Banjo” video.  This was simply a video of me loosely interpreting the Star Wars theme on my banjo.  It had been up for over 2 years, had garnered over 1.5 million views, and was featured on the front page of sites such as Fark.com and Metafilter.com.  It led to me being interviewed by the local paper.

So they yanked it down, and I inquired about what to do on both Reddit.com and Metafilter.com. I received many varied responses, but the general consensus was that people were supportive of me, and that YouTube was overreacting.

Even though Warner claimed infringement, the video could easily be considered a parody, in which case it falls under fair use.  Still, YouTube has to take things like this down if a copyright holder complains, just to protect themselves under the DMCA laws.  The procedures state that it is now my turn to file a counter-claim, which might get my video back online if Warner doesn’t respond in 10 days.

I have filed the counter claim with YouTube, and am hoping to see the video return.  Stay tuned.

Phase III – Shock and Awe

This morning, I got another email from YouTube.  This time, they were letting me know that my Fingernail Collection video had been yanked for violating the YouTube Community Guidelines.

I guess that a video of someone licking fingernail clippings is considered a “shock” video. The funny thing is, in my opinion, it is completely ironic that people get grossed out by it.  What is the difference between biting your fingernails while they are on your finger and merely touching your tongue to them when they are off your finger?

I just don’t get it.

The video has been up for nearly two years, and for this to happen just a few days after my Star Wars banjo video takedown got a lot of attention in the Internet press, seems too coincidental to me.

In Summary

I have been disheartened by all of this.  I’ve always been a big fan of Google and their ventures (YouTube included), and to get the triple smackdown in three different areas has been quite demoralizing.

I do plan on contesting the Star Wars On A Banjo and fingernail video takedowns.

If the person at the other end of the line has an iota of reasoning abilities, they will hopefully see my point of view and put the videos back online.

I’m interested to hear your thoughts on this matter. Please comment!

Vmware – Linux Host / Linux Guest – Keyboard Mappings Issues

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

RealVNC on RedHat Enterprise 5

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

clicky