Monitoring Current Users on the Nomadix USG II
with MRTG/Perl
Version 1.0 – July 27th, 2004
Matthew Evans

 

 

 First, just a little background on why this page exists….

 

 The Nomadix Universal Subscriber Gateway II is one of the most well known “Hotspot” management gateways in the world. I installed it for a free WiFi hotspot in downtown Greensboro, NC, located here.

 Since I needed to be able to graph how many users were logged in, MRTG naturally came to mind. After playing around with the SNMP monitoring capabilities of the USG II, I noticed there wasn’t a universal OID that would tell you the number of currently logged in subscribers as a total.

 However, if you are using the AAA Services of the USG II, an SNMP OID is created for each user that is logged in. Good, but not ideal for MRTG. I set out to find a way to make MRTG and the USG II play nicely together until Nomadix updates their SNMP MIB for the USG II.

 So, with that out of the way, let’s get down to it….

 

 
NOTE:
 
This article assumes a few things:
 

1)       You currently have MRTG/Perl installed and functioning on some level.

2)       You have SNMP enabled on the Nomadix USG II and have run a successful GET.

3)       You have a copy of SNMPUTIL.EXE (or an equivalent on *nix based platforms).

 

 

Step 1:

 

We need to create a Perl script that will query the SNMP OIDs of the USG II, until no more logged in users are found.

 

 You can download this file here. (Right-click, Save Target As…, then extract)

 

 Copy this file to your MRTG bin directory.

 

 Note: It would be wise to run the Perl script to make sure it is functioning properly and returning the correct number of subscribers logged in.

 

 
Step 2:
 
Add an entry to your mrtg.cfg file along these lines:
 

 

##################################################  ####################

# System: Your System

# Description: Your Description

# Contact: You

# Location: Your Location

##################################################  ####################

##################################################  ####################

Target[online]: `c:\perl\bin\wperl.exe c:\mrtg\bin\cursub.pl`

PageTop[online]: <h1></h1>

MaxBytes[online]: 250

Title[online]: Users Online

LegendI[online]:  Users:

LegendO[online]:   

YLegend[online]: Current Users

ShortLegend[online]:     

Options[online]:  nopercent, noinfo, gauge

 

 
 
Step 3:
 

 We don’t need to stinkin’ step 3!

 

 Really, that’s it!

 

 

 All you need to do is run MRTG, tweak the output to your liking and you should be good to go!

 

 If you have any questions, feel free to drop by The Coder’s Cubicle at TripOnThis.Net and myself, or the Uber-Perl-God Kosh Vorlon, who wrote the Perl script, the key to this working I might add, will be glad to try and help out.