MRTG and Load Balancers

Search the lb-l mailing list archive:
Site Map

Docs

Product Configs

Vendors

Load Balancing Resources:

MRTG and SNMP Concepts

MRTG is a program that works primarily in the realm of SNMP (Simple Network Management Protocol, although it's really not simple). To help beginners I've compiled a short list of terms and concepts that will help you find your way around.
SNMP

This is the protocol that makes this all possible. An SNMP service/daemon runs on a device and serves out MIBs.  A popular UNIX SNMP server (but definitely not the only one) would be net-snmp.  Cisco routers all have SNMP services as do all load balancers mentioned.   An SNMP server has a "community string" which is like a password to get or set information.  Most devices have a "read" or "public" community string, which enables read-only access to MIBs, as well as a "write" or "private" community string that will allow to read and to set certain parameters via SNMP.  For the purposes of these discussions, we are only concerned with the read-only aspect of SNMP.

There is another part of SNMP called traps that allow warnings and alerts to be sent to a collector machine.  Again, for the purposes of these discussions, we will not delve into that aspect of SNMP.

MIB

A MIB is a collection of variables and other info that are programmed into an SNMP service.  MIBs have a text file that contains the OID and a description of the info found in a particular OID.  An SNMP service may have many MIBs compiled in.  For instance, all the SNMP devices discussed have a standard MIB that gives out OID information on network ports.  This MIB is known as the IF-MIB (RFC-1213).  The information is presented in a universal format, regardless of whether or not its a Sun machine, a Cisco router, or a toaster with an Ethernet card.

Vendors often create their own MIBs to report specialized data unique to their products. Most of the load balancer vendors out there have MIBs that relate to SLB functions and metrics, and those are the basis of this site.

Object

An Object is a specific metric that can be measured and polled through SNMP. The most popular object is the byte counter for network interfaces. This standard object is in just about every SNMP-enabled device (via the IF-MIB), and it is a counter for bytes (also known as octets) in and out of a Layer 2 network interface.

Other objects can include the connection counter for a load balancer (to measure connections per second), or CPU utilization.

OID

An OID is a numerical address to retrieve a given object.

Here is an example, from an Alteon MIB:

1.3.6.1.4.1.1872.2.1.8.2.1.1.4      slbStatPortMaintNonTcpFrames
MRTG

MRTG is a program that basically does two things. It polls an OID every five minutes and logs the data, and it graphs the data that it logs.

How The Hell Does This All Fit Together?

Good question.  As simple as I can put it, the load balancers run an SNMP service, with a load balancing specific MIB compiled.  We poll certain OIDs from that MIB using MRTG to graph the data.  See, that wasn't so hard!

Getting Started

Before you start with MRTG and Load Balancers, first explore MRTG itself. Download and run MRTG on a device or two, just to get comfortable with the environment. Once you understand the concepts and implementations of MRTG, setting it up for load balancing monitoring is simple.

What You'll Need

In order to graph MRTG data, you'll need a machine to collect and munge the data. It will need to have a web server installed, as well as Perl. I highly recommend using a UNIX box to do this, something like Linux or Solaris will work, although any UNIX variant should work fine. If you are going to be doing a lot of polling with MRTG, you may want to make it a machine that is dedicated to this task.

For further MRTG performance and installation tips, check out the MRTG home page here.

Google