IOG HowTo Author:
Sean Kelly
<sean@inabiaf.com> |
|
|
|
Problem: You
want to install IOG on SME 5.x to monitor the bandwidth consumed
by your SME server. |
|
|
STEP 1: Download IOG
Go to http://www.dynw.com/iog and download iog-1.01.tgz . Copy it up to your SME server by whatever means you are comfortable.
STEP 2: Download and install net-snmp and net-snmp-utils
SME does not come with SNMPd
installed out of the box. You will need snmp-tools as well,
especially if you want to get the metrics from other SME servers (and
do other things, more on that later).
For SME 5.x, grab the
appropriate version of ucd-snmp and ucd-snmp-utils from Sassous Efoe
Boris's howto on installing Cacti on SME
(http://www.speedfactor.ath.cx/howto/)
and follow that portion of his howto to install them (as plagiarised
below ;-)
Fetch them:
For
E-SMITH/SME 5.x Only For
SME 5.6 Or if the
first site is unavalaible try this: |
Now install them:
For
E-SMITH/SME 5.X |
WARNING: The "mv
/etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old" command is to
force net-snmp to start in such a way that it only listens to
requests from 127.0.0.1, or localhost. SNMP has known security holes,
so it is important that this command is run - your machine may be
left vulnerable if you don't do this.
STEP 3: Untar IOG to a safe place
shell>
mkdir /opt/iog |
STEP 4: Create an ibay for IOG to live in
Create an ibay (called "iog" or whatever) for the web page and the iog data to live in. No special CGI or other permissions are required for this ibay.
Copy the .gif files from your /opt/iog directory into your ibay/html directory (nominally /home/e-smith/files/ibays/iog/html).
shell> cp ./iog-1.01/*.gif /home/e-smith/files/ibays/iog/html |
STEP 5: Edit iog.cfg to reflect your system
First off, let's look at the guts of iog.cfg:
If
for example we wanted to monitor the internal and external ports of
our gateway we would make an entry like:
Here
is where the snmp-utils comes in. The ifInOctets.1 part in the above
entries is the OID (Object Identifier) in the MIB (Management
Information Base) for the counter (in octets or bytes) of the first
interface reported by your machine's SNMPd. The only way to be sure
of what the actual interface index is is to use SNMPWALK to
walk the OIDs on your machine and view the results.
For
example:
I
know (or I should know;-) which interface is inside (eth0,)
and which interface is outside (eth1). As the ifDescr values
correspond to ifInOctets and ifOutOctets values, I would change the
lines in iog.cfg to read:
...
as ifInOctets.3 corresponds to ifDescr.3, which is the interface
number for eth1, which is my server's external interface.
If your entry is index:127.0.0.1:public:ifInOctets.3:ifOutOctets.3:/home/e-smith/files/ibays/iog/html then this will create index.html, replacing the default "Under Construction" page in the ibay. This is useful if you only want to monitor one interface, like your server's external ethernet.
Now, while you have the chance, you can remove snmp-utils as the snmp_session.PM file in iog looks after that stuff for you. To do this, run...
STEP 6: Create the crontab entries to run IOG
You now need to run iog every hour. Assuming you put the iog files in /opt/iog, do this:
shell>
mkdir -p /etc/e-smith/templates-custom/etc/crontab/ |
Do not run iog every five minutes (as per mrtg and cacti etc) as this will give you very weird statistics for your traffic!
STEP 7: Wait for a few hours...
You should, after a few hours, be able to go to http://mysmeserver/iog/Gateway-external-ethernet.html and http://mysmeserver/iog/Gateway-internal-ethernet.html to see the results. There should be nice graphs there, with drill-down levels as time goes on.
Each interface line you created in your iog.cfg will create an html page with the title being the part before the first colon, eg Gateway-internal-ethernet.html, Gateway-external-ethernet.html, etc. If you are monitoring a whole bunch of interfaces you may want to modify the default index.html to point to these individual files.
Other possibilities:
Given that IOG uses SNMP to gather the statistics, it should be possible to gather stats from any snmp-enabled device as long as you know what the appropriate ifDescr indices are. You could use it to track the i/o on any server in your network if you wished, or on the kid's PC in their room (if you enabled snmp on it).