5

Monitoring an Apple Airport Express/Extreme with Munin

Posted on Saturday, 29 January 2011

So you have an Apple Airport (Express or Extreme), or a Time Capsule, and you want to monitor things like the signal levels of the connected clients? I thought so! That's why I wrote this post, because I'm thoughtful like that.

While it's not necessary, I'd like to mention that this was made possible by virtue of Apple having put out an SNMP MIB file. Without that, finding the relevant OIDs would have been sufficiently boring that I wouldn't have bothered with this, so yay for that (even if the MIB is suspiciously ancient).

So if you don't need the MIB file, what do you need?


Having all of those things, how do you use it? Simple!

  • Place the munin plugin somewhere (doesn't really matter where, but the munin package probably put the other plugins in /usr/share/munin/plugins/)

  • Make sure you have a hostname or IP address for your Airport(s). If you have more than one you should either make sure they have static IPs configured, or that the one doing DHCP has static leases configured for all the other Airports.

  • Create a symlink for each of the types of graph for each of your Airports. Assuming that your Munin machine can resolve your Airport as 'myairport' you'd want to make the following symlinks:

    • cd /etc/munin/plugins/

    • ln -s /path/to/snmp__airport snmp_myairport_airport_clients

    • ln -s /path/to/snmp__airport snmp_myairport_airport_signal

    • ln -s /path/to/snmp__airport snmp_myairport_airport_noise

    • ln -s /path/to/snmp__airport snmp_myairport_airport_rate




There is an explicit assumption that your SNMP community is the default of 'public'. If it's not then you'll need to hack the script. Otherwise, you're done! Now you win pretty graphs showing lots of juicy information about your Airport. Yay! You're welcome ;)

Discussion

  1. Thanks for posting this. I've wanted to do this for a while, but didn't know where to find the right tools.

    I also needed to add a section like this to /etc/munin/munin.conf to get the graphs to show up:

    [myairport.local]
    address 127.0.0.1
    use_node_name no

    Also, for anyone else reading this, I highly recommend installing this on Linux and not bothering to mess with it on OS X (where it's a huge hassle due to having to install dozens of perl modules, etc.)

    Now I'm wondering if I can figure out how to pull more data out of the SNMP (particularly bandwidth stats--I noticed there are TX/RX packet stats in the MIB).

    ReplyDelete
  2. Dan: Good point about adding the virtual hostname to munin.conf.

    I would like to expand the coverage. I was planning on going through the MIB for interesting other data to graph - now that the basic plugin exists it should be pretty simple to extend it.
    If you do anything along those lines, I would be delighted to incorporate your work into the plugin. if you're not working from my bzr branch then patches or updated files would be fine :)

    ReplyDelete
  3. Dan: Interestingly enough, I've been playing with monitoring the WAN port for its bandwidth usage, and the Net-SNMP python bindings in Ubuntu 10.04 appear to be buggy enough that I can't read the data out, which is quite annoying!

    ReplyDelete
  4. I was working on this for a while yesterday. I was able to pull the WAN stats. I started to feel that munin was a little limited, though (one main thing I want to do is show accumulated traffic over time, and munin doesn't seem to be good at that, only at instantaneous rate), so for now I just threw what I need into a little python script. Next I think I'll dump the data into CouchDB, which I'm learning at the moment, so I can do some more flexible reporting.

    I did put some of the functionality into the munin script before I gave up on it. Here's everything I've done so far: http://dl.dropbox.com/u/285212/snmp-airport.tar.bz2

    I used this thing to find the OIDs: http://ireasoning.com/mibbrowser.shtml

    I'm on Ubuntu 10.10, and pulling the data seems reliable enough.

    Unfortunately none of the SNMP output seems to include traffic per client machine, which is one of the other things I would have liked to have looked at.

    Let me know if you figure out anything else interesting.

    ReplyDelete
  5. Anyone here know how to monitor an Airport Express to see what songs are playing on it? We have several users always piping great music through ours and we'd like to create a real time playlist.

    ReplyDelete