Mrtg logging for Dachstein/LEAF

Pete Dubler

2003-12-11

Revision History
Revision 1.32003-12-11PD
added mrtg.cfg information under "Configuring for snmpd on Dachstein"
Revision 1.22002-10-18PD
added note regarding importance "/" in mrtg.cfg section.
Revision 1.12002-03-13PD
Corrected Appendix B to add Dachstein Feature.
Revision 1.02002-03-11PD
converted to html, changed dublerfamily links to sourceforge

Table of Contents

Introduction
Scope
Concept
Prerequisits
Install and Configure
A. Using MRTG to Log Signal Strength and Quality on a Wireless Dachstein LEAF
B. Workaround for syslinux.cfg Line Length Limit

Introduction

Copyright and License

This document, Mrtg logging for Dachstein/LEAF, is copyrighted (c) 2002, 2003 by Pete Dubler. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html.

Linux is a registered trademark of Linus Torvalds.

Disclaimer

No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies, that could be damaging to your system. Proceed with caution, and although this is highly unlikely, the author(s) do not take any responsibility.

All copyrights are held by their by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.

Feedback

Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address : .

Scope

Provide a helpful guide to getting the necessary stuff in place to run mrtg logging of a Dachstein/LEAF system. Mrtg is run on another linux system (in my case Redhat 7.1). Mrtg is highly configurable and flexible. One can log anything from network traffic to weather history with mrtg. We will only worry about getting a Dachstein-based LEAF router set-up to be accessed by another system which is running mrtg.

Appendix A, Using MRTG to Log Signal Strength and Quality on a Wireless Dachstein LEAF provides information on using mrtg to remotely log signal strength and quality for a Cisco Aironet 802.11b wireless lan card in your Dachstein system.

Concept

Mrtg provides a full set of automatically scaled, automatically updated graphs for each NIC specified on a given router. Mrtg automatically assembles the graphs into a web page for each NIC. The router must be running a version of snmpd to allow mrtg to gather the necessary information. The html files generated by mrtg are most easily accessed if the mrtg server has a web server (like apache).

Prerequisits

Files Needed

On the router

netsnmpd.lrp
libm.lrp
libdb.lrp

This is the most complete and functional version I have found and includes my edited snmpd.conf file). This .conf file is also a great reference as it is loaded with comments and explanations. (It also has the hooks in it, ready to be un-commented, for implementing radio signal logging

On the mrtg server

perl

must be running on your server since large parts of mrtg are written in perl

mrtg

You can build it from source from: http://people.ee.ethz.ch/~oetiker/webtools/mrtg/

OR, you can find an rpm and get on the air right away… http://www.rpmfind.net

Documentation Recommended

The following documentation tells you how to build mrtg, but also provides valuable configuration and start-up information: http://people.ee.ethz.ch/~oetiker/webtools/mrtg/unix-guide.html

Information Needed

You must have the following information available:

  • IP address of interfaces on router you wish to monitor.

  • IP address of the server on which you will be running mrtg

Install and Configure

Adding snmp to Dachstein

  1. Download netsnmpd.lrp, libm.lrp, and libdb.lrp files listed above. Save them on your Dachstein system where all of your other .lrp files are saved.

  2. Edit syslinux.cfg on Dachstein system. Add netsnmpd, libm, and libdb to list of lrps loaded.

    Note

    If the length of the lines in your syslinux.cfg file must not exceed 256 characters or the lrp's will not load correctly. There is a workaround in the Dachstein release, and a generic workaround, written by Jim Moy, in Appendix B, Workaround for syslinux.cfg Line Length Limit

  3. Reboot Dachstein system

  4. Check that netsmnpd is running by looking for smnpd in output of: ps –ef If it is not running, you can start it via:

    /etc/init.d/smnpd start

    If it is running, you can restart it via:

    /etc/init.d/snmpd restart

Configuring for snmpd on Dachstein

  1. On the Dachstein system, run lrcfg. Select network, edit network.conf:

    - Set SNMP_BLOCK=NO in /etc/network.conf so the firewall isn't blocking ports 161:162.

  2. Set SNMP_MANAGER_IPS, to the IP of the machine on which you will be running mrtg.

  3. In snmpd.conf, I commented out the com2sec, group, view, and access lines and added these in their respective places (see "Details" in Appendix A below for an explanation of these changes):

    com2sec notConfigUser default public
    group notConfigGroup v1 notConfigUser
    group notConfigGroup v2c notConfigUser
    view all included .1 80
    access notConfigGroup "" any noauth exact all none none

Install mrtg on server

Here you are kinda on your own. The simplest method is to find an rpm for your system and run "rpm –i" on it.

Configure mrtg on server

You now just have to edit the mrtg.conf file to tell it what router to monitor and how often. My mrtg.conf file lives in /etc/mrtg (yours may be elsewhere). Edit the file as follows:

# mrtg.cfg
WorkDir: /var/www//html/mrtg                            #this is as directory on your web server
Options[_]: growright,bits                              #this makes the charts grow from l to r
RunAsDaemon: Yes                                        #you can choose yes or no, see doc
Interval: 5                                             #probe router every 5 minutes
Target[fwext]: /123.456.123.456:public@123.555.666.777
MaxBytes[fwext]: 1250000
Title[fwext]: Stats for External
PageTop[fwext]: <H1>Stats for External</H1>
# end of mrtg.cfg

123.456.123.456 is the ip of the port of the router you will be monitoring (eg. the external port {eth0}). NOTE: The "/" is very important. It tells mrtg to use the ip address. If you do not include the leading "/", mrtg will try to use interface number 456 in this case.

123.555.666.777 is the ip of the port of the router that your mrtg server can access (eg. the internal port {eth1})

fwext is the name you assign for mrtg to use for the files it will store related to these statistics

The Title and PageTop are up to you. Keep it simple at first.

Note

There must be no spaces at the beginning of each line of the mrtg.conf file for the parameters to take.

Run mrtg

I can’t add any value here. Please just read the RUNNING MRTG section of the above referenced documentation: http://people.ee.ethz.ch/~oetiker/webtools/mrtg/unix-guide.html.

View mrgt files via server’s web server

Files will have names like fwext.html (based on the on the name you assigned in step 4 above. Wow! Can you believe how easy it was to create such detailed, auto-scaling, auto-updating graphic web pages!

You can do lots more with mrtg, just check out the mrtg website: www.mrtg.org for more ideas.