To install MRTG without using Optware, you will have to do the following.
Why without Optware? I've got broken perl with Optware's version, so it's just don't work. You know, sometimes it's better to Do It Yourself than to figure out what's wrong with this stuff.
First, login to your MBWE and create temporary directory:
mkdir builds cd builds
I'm using non-privileged user who can sudo (and recommend the same to you). If you like to be running under root, you can just omit "sudo" from the commands below.
Then, get MRTG and its prerequisites' sources.
wget http://oss.oetiker.ch/mrtg/pub/mrtg-2.16.2.tar.gz tar zxvf mrtg-2.16.2.tar.gz wget http://www.libgd.org/releases/gd-2.0.35.tar.gz tar zxvf gd-2.0.35.tar.gz wget http://prdownloads.sourceforge.net/libpng/libpng-1.2.29.tar.gz?download tar zxvf libpng-1.2.29.tar.gz wget http://www.zlib.net/zlib-1.2.5.tar.gz tar zxvf zlib-1.2.5.tar.gz rm *.tar.gz*
Let's build this (If you have something already installed, you can skip it)
cd zlib-1.2.5 ./configure make sudo make install cd ..
cd libpng-1.2.29 ./configure make sudo make install cd ..
(Note: I already have freetype2 installed with Optware — need to check if it's ok without it. Should be fine.)
cd gd-2.0.35 ./configure make sudo make install cd ..
And finally, MRTG itself.
cd mrtg-2.16.2 ./configure make sudo make install cd ..
Now it's done. Let's configure MRTG.
sudo mkdir /usr/www/lib/mrtg sudo /usr/local/mrtg-2/bin/cfgmaker --global 'WorkDir: /usr/www/lib/mrtg' \ --global 'Options[_]: bits,growright' \ --output /usr/local/mrtg-2/mrtg.conf \ public@localhost sudo /usr/local/mrtg-2/bin/indexmaker /usr/local/mrtg-2/mrtg.conf --output=/usr/www/lib/mrtg/index.html
If you made changes to your snmpd.conf, so your community name is not "public", you have to specify your own in cfgmaker.
Unless you already hacked lighttpd, index.html is not automatically assumed as index. You have to edit /etc/lighttpd/lighttpd.conf (as root), adding this line
index-file.names += ( "index.html" )
sudo /etc/init.d/lighttpd.sh restart
Then run MRTG:
sudo /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/mrtg.conf
Note that you have to run this three times to get rid of error messages. This is normal.
Point your browser to http://Your.MyBook.Name/mrtg/ and voila! This is a report for your traffic.
Most likely, you don't want to run MRTG manually.
So, let's make cron work for you.
Edit /etc/crontab/root (as you can assume, as root) and add
*/5 * * * * /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/mrtg.conf --logging /var/log/mrtg.log
Yes, it will make that "smart spindown" useless. But who knows why the hell you need to spin down hard drive on file server? Remember, every time your WD spins down, a kitten dies… well, it makes a horrible dying sound and your S.M.A.R.T. statistics get worse.
If you want to add some other things to MRTG graphs, like CPU and disk usage or anything, you have to re-run indexmaker to recreate index.html
sudo /usr/local/mrtg-2/bin/indexmaker /usr/local/mrtg-2/mrtg.conf --output=/usr/www/lib/mrtg/index.html
If you find two columns on index page ugly, you can change their number:
sudo /usr/local/mrtg-2/bin/indexmaker /usr/local/mrtg-2/mrtg.conf \ --columns=1 --output=/usr/www/lib/mrtg/index.html