monitoring Airport basestations with MRTG

Simon R has written and asked about extending the ideas raised by my how-to article, “Network Flow Rates”, published in September 2004′s Australian Macworld article,. He’d like to use MRTG to monitor a couple of Airport Express base stations. Specifically he’d like to be able to monitor his broadband usage, and Airtunes streams.

Now I don’t have any experience with the new Airport Express yet (if someone would like to donate or loan me one for a while I can certainly document my discoveries!) however I have used SNMP with the original graphite Airport and today I had a play with a couple of the latest model Airport Extreme basestations.

There is an official Airport Extreme MIB available from Apple here. It should work with any Airport basestation running v5.1 or above. (It may indeed work with earlier models as well) A MIB file provides you with easier to use nouns allowing you to request various information available from the device via SNMP – without having to use more cumbersome OIDS (object identifiers). Presently it would appear that the information available from a Airport via SNMP is about the physical ethernet interface(s), and information about each of the connected wifi clients including MAC (media access control) addresses, number of packets in and out per second, the number of errors, signal strength, and DHCP records if it is running DHCP. There’s nothing in there about AirTunes but there is a comment that they intend to provide an interface to information about the USB port, connected printers and more network details at some point in the future. It’s fair to assume that Apple will provide an interface for Airtunes as well – or someone else will figure out how to access it.

14 Responses to “monitoring Airport basestations with MRTG”

  1. Martijn

    Hi James,

    I tried to get it working but could not figure out how the config file should be. Didn’t find it on internet and no help in forums either. Could you give me a headstart by telling me what I should put in in the config file?

    Regards,
    Martijn

  2. James Christopher Murty

    Martijn, /sw/bin/cfgmaker will do most of the work for you, just point it at your router and pipe the output into a text file by typing something like:
    cfgmaker ADDRESS_OF_ROUTER > mrtg.cfg
    The only value you’ll definitely need to change in the resulting file is the WordDir – which is where MRTG should be generating the html and images.
    Mine looks a bit like this:

    # Created by
    # /usr/local/bin/cfgmaker 192.168.1.50
    # Global Config Options
    WorkDir: /Library/WebServer/Documents/mrtg
    # Global Defaults
    # to get bits instead of bytes and graphs growing to the right
    Options[_]: growright, bits, noborder, transparent
    ##################################################################
    # System: router.murty.org
    # Description: ADSL Router, VxWorks SNMPv1/v2c Agent, Conexant System, Inc.
    # Contact: James Christopher Murty
    # Location: Hearth
    ##################################################################
    # Interface 1 >> Descr: '[mac0]-Ethernet,-Conexant-Systems,-Inc.' | Name: '' | Ip: '127.0.0.1' | Eth: '
    ' #
    Target[192.168.1.1_1]: -1:public@192.168.1.1:
    SetEnv[192.168.1.1_1]: MRTG_INT_IP="127.0.0.1" MRTG_INT_DESCR="[mac0]-Ethernet,-Conexant-Systems,-Inc."
    MaxBytes1[192.168.1.1_1]: 192000
    MaxBytes2[192.168.1.1_1]: 32768
    Title[192.168.1.1_1]: Traffic Analysis for 1 -- router.murty.org
    PageTop[192.168.1.1_1]: <h1>Traffic Analysis for 1 -- router.murty.org</h1>
    <table>
    <tr><td>System:</td> <td>router.murty.org in Hearth</td></tr>
    <tr><td>Maintainer:</td> <td>James Christopher Murty</td></tr>
    <tr><td>Description:</td><td>[mac0]-Ethernet,-Conexant-Systems,-Inc. </td></tr>
    <tr><td>ifType:</td> <td>ethernetCsmacd (6)</td></tr>
    <tr><td>ifName:</td> <td></td></tr>
    <tr><td>Max Speed:</td> <td>1.5 Mbits/s / 256 Kbits/sec</td></tr>
    <tr><td>Ip:</td> <td>127.0.0.1 (localhost)</td></tr>
    </table>

  3. jpmat296

    I have an Airport Express and I have just finished to configure MRTG for it !

    The most difficult issue was to understand that airport station password must be given as comunity ID to access all SNMP informations. Without password, they are only minimal informations and MRTG can’t work.

    To use cfgmaker on Airport station with password, you must do :


    cfgmaker password@ip_airport

  4. Martijn

    I don’t understand, the password is right, i get the config file but all interfaces are commented out because of zero speed. Any ideas?

  5. Chris

    Hmm…for me, the 1st interface was the loopback and therefore was commented out. The 2nd interface claimed to be the ethernet interface and it was set correctly, but I never see any traffic on it (I think because the only ethernet traffic I have is grouped into interface 3), the 3rd interface was marked as my pppd interface (basically the PPPoE conecntion to my dsl provider, and though it was marked as speed zero, I changed to be the speed of my DSL, uncommented it and everything works fine for that interface. I wish the wireless interface showed up.

  6. Martijn

    I have my dsl modem connected to the WAN interface of an Airport Exterme. Then I have two airport express devices connected with WDS. For none of the devices the wireless connection shows up. I know there is a special MIB for it (its on the cd delivered with the device) but do not know how to adress it. Damn….

  7. James Christopher Murty

    I did have some successes with an airport express base station some time back.
    The relevant lines that needed to be added to mrtg.cfg to access the MIB file were:
    LoadMIBs: /usr/share/snmp/mibs/airport-extreme.txt
    to load the MIB (download it from the link above and place it in /usr/share/snmp/mibs/
    Then to access stuff, use something like:

    ######################################################################
    # System: Base Station 1
    # Description: Apple Base Station V3.84 Compatible
    # Contact:
    # Location: Top Floor - West End
    ######################################################################
    ### Interface 2 >> Descr: 'mirror0' | Name: '' | Ip: '192.168.1.30' | Eth: '00-0d-93-cb-0c-c9' ###
    Target[192.168.1.30_2]: physicalInterfaceNumRX.3&physicalInterfaceNumTX.3:<password>@192.168.1.30:
    SetEnv[192.168.1.30_2]: MRTG_INT_IP="192.168.1.30" MRTG_INT_DESCR="mirror0"
    MaxBytes[192.168.1.30_2]: 1250000
    Title[192.168.1.30_2]: Traffic Analysis for 2 -- Base Station 1
    PageTop[192.168.1.30_2]: <H1>Traffic Analysis for 2 -- Base Station 1</H1>
    <TABLE>
    <TR><TD>System:</TD> <TD>Base Station 1 in Top Floor - West End</TD></TR>
    <TR><TD>Maintainer:</TD> <TD></TD></TR>
    <TR><TD>Description:</TD><TD>mirror0 </TD></TR>
    <TR><TD>ifType:</TD> <TD>ethernetCsmacd (6)</TD></TR>
    <TR><TD>ifName:</TD> <TD></TD></TR>
    <TR><TD>Max Speed:</TD> <TD>1250.0 kBytes/s</TD></TR>
    <TR><TD>Ip:</TD> <TD>192.168.1.30 ()</TD></TR>
    </TABLE>

    The results here are less than satisfactory as only the number of bytes in and out of the wireless interface are recorded – and not the desired bits/second.

  8. Rob

    Did you ever had succes graphing datatraffic using this ?

    Im currently trying monitor two Airport expresses on mrtg with snmp but the graphs never show any lines.

    Rob

  9. james

    Rob, not to a satisfactory degree, no. It’s turned out to be much easier to monitor the ports on a managed switch that each of the Airports are plugged into.

  10. james

    A lot of people appear to be hitting this site looking for further information regarding SNMP and Apple Airport devices. I recently purchased an Apple Timecapsule so my interest has once again risen.

    I noticed this conversation going on at Apple’s discussion site http://discussions.apple.com/thread.jspa?messageID=7902333
    and have added my 2 cents.

    I’ll post something shortly here after I’ve had a chance to investigate further.

  11. james

    so I’m running MRTG over my Time Capsule just fine. My config was generated using regular old cfkmaker. I’m getting graphs out of it that look like this:

  12. Slarti

    HI James,

    Thanks for your posts. I have run into problems using the cfgmaker on my time capsule.

    I got the interfaces in my cfg file (i.E):
    Target[192.168.0.1_1]: 1:public@192.168.0.1:
    SetEnv[192.168.0.1_1]: MRTG_INT_IP=”” MRTG_INT_DESCR=”mgi0″
    MaxBytes[192.168.0.1_1]: 1250000
    Title[192.168.0.1_1]: Traffic Analysis for 1 — magrathea-ii
    PageTop[192.168.0.1_1]: Traffic Analysis for 1 — magrathea-ii…

    but all the graphs are empty. Could you tell me please what I have missed. Maybe if you can send me your cfg file that would be great.

    Thanks for your posts here again.

    Slarti

  13. james

    hey Slarti,

    so I transitioned from MRTG to Cacti back in July 2008 around the time I upgraded my server.

    I’ve just pulled the last MRTG config out of my old backups but there’s nothing special about it.

    Are you sure you have SNMP enabled on the Time Capsule?

    In the Airport Utility app, go to Advanced, Logging and Statistics and check that you have “Allow SNMP” ticked and make sure that you set the community string to something that you use in your MRTG config.

    Do you get anything back from your Time Capsule if you use the snmpwalk utility from Terminal?

    $ snmpwalk -c [community string] [address of time capsule]

    should spew out a bunch of information.

    - james

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>