MRTG and Big Brother

MRTG is a cool application that creates trend graphs for just about anything. Out-of-the-box MRTG graphs I/O in bits/second that travel through the interface cards on any SNMP enabled network device, just like the image below:

Current In: 1288 Bytes/s (2.01%) Current Out: 190 Bytes/s (0.30%)
MRTG native graph

MRTG can also be used to graphically trend data from many other sources, like Windows Performance counters, see below:

BBClient001\\TCP_Connections Established Daily Trend


To integrate MRTG graphs with Big Brother, you must install MRTG. The first thing to do is download and install the latest stable release of MRTG for your operating system and read the appropriate documentation and follow the platform specific installation instructions.

After MRTG has been installed, you need to create an MRTG configuration file for the device you're monitoring. After the configuration file has been created, you need to run MRTG against it to produce trending graphs. And, after you've produced the trending graphs, you need to integrate those graphs into the BBDISPLAY with an extension. from the Big Brother user community.

The steps below take you through that process:

1. Create the device configuration file with the $MRTGHOME/bin/cfgmaker script, like:


UNIX/Linux way:

cfgmaker --global 'WorkDir: /var/www/html/mrtg' \
--global 'Options[_]: bits,growright' \
--output /var/www/html/mrtg/router.abc.xyz.cfg \
public@router.abc.xyz

Windows way:

perl cfgmaker public@10.10.10.1 --global "WorkDir: C:\Inetpub\wwwroot\mrtg" --output router.abc.xyz.cfg


  • The WorkDir value should be a directory under the DocumentRoot, or, wwwroot of your web server.
  • The Output file should be named appropriate for the device name.
  • public should be replaced with the correct community string.

    Either way, you'll end up with a .cfg file named router.abc.xyz.cfg.

    2. Now you need to run MRTG against the .cfg file to start producing graphs. And, like before, there's the *NIX way and the Windows way:


    UNIX/Linux way:

    # env LANG=C /usr/local/mrtg-2/bin/mrtg router.abc.xyz.cfg



    Windows way:

    > mrtg.pl router.abc.xyz.cfg




    You might have noticed I executed mrtg against the .cfg file three times and the first two executions produced STDERR, that's normal behavior for MRTG. Subsequent executions against the same .cfg file should not output STDERR.

    3. Now you need to run MRTG against your .cfg file(s) every five minutes to get the trending going, to do this you could create a cron job (*NIX), or, run a VBScript from Windows Task Scheduler.


    UNIX/Linux way:

  • Edit crontab with: crontab -e
  • Add the following line using the correct paths for your environment:

    */5 * * * * env LANG=C /usr/local/mrtg-2/bin/mrtg /var/www/html/mrtg/router.abc.xyz.cfg

    Windows way:

    I recommend using Task Scheduler to a VBScript that executes MRTG against your .cfg file every five minutes. Example VBScript


    Okay, now that MRTG is set to run against your .cfg file every five minutes, the only thing left to do is add it to your BBDISPLAY and you need an extension to do that.

    4. Download and save the extension in $BBHOME/ext.
    5. Edit the extension and add your device(s).
    6. Make it executable (chmod 775 bbmrtg.sh).
    7. Add it to $BBHOME/etc/bb-bbexttab.
    8. Restart Big Brother.

    When BB restarts you'll see the bbmrtg.sh extension listed in STDOUT and shortly after that you should see a new column named "mrtg" on the BBDISPLAY.