Saturday summer photo

flifstat screenshot

flifstat is a simple FLTK-based bandwidth usage monitor that uses SNMP queries to collect the bandwidth usage (both incoming and outgoing) for interfaces on a network device like a router, printer, or server.

Compiling

The source code can be compiled using the fltk-config program:

fltk-config --compile flifstat.cxx

Running

flifstat uses the hostname and interface number from the command-line, if provided. Otherwise, it shows the last host and interface number you entered in the GUI. Run flifstat multiple times to show the usage of multiple devices and/or interfaces.

How It Works

flifstat sends SNMP "Get-Request-PDU" messages to the specified IP address for three Object IDs (OIDs) from the Interface MIB: ifSpeed (speed in bits per second), ifInOctets (number of received bytes), and ifOutOctets (number of sent bytes). Once it has these values, it polls the ifInOctets and ifOutOctets OIDs once a second to get the current receive and send rates and calculate the bandwidth usage.

The graphs are implemented as a FLTK widget (IFDisplay) which collects up to 300 seconds worth of data (MAX_SAMPLES) and displays it.