newspaint

Documenting Problems That Were Difficult To Find The Answer To

Monitoring the Billion 7404VGO-M ADSL Router

I have had, for some time, a Billion BiPAC 7404VGO-M ADSL router bought in Australia. I doubt the model is still available however I am documenting the following anyway in case anybody else is using such a (or similar) model.

Billion BiPAC 7404VGO-M ADSL2+ Router

Billion BiPAC 7404VGO-M ADSL2+ Router

It should be worth noting that this ADSL router works just fine in the UK using the Australian software. I am presently getting 15Mb/s downstream and 1Mb/s upstream.

This has been a rock-solid router for 4 years now. I have been very, very happy with it. It wasn’t the cheapest when I bought it but I have had no problems with it over the years.

What else do I like about this router? Monitoring it using SNMP. I presently monitor a number of parameters:

  • attenuation up/down stream
  • signal-to-noise ratio up/down stream
  • line speed up/down stream
  • data transferred up/down stream

Monitoring Script

I am posting my quick-and-dirty Perl script used for monitoring this router. Note that I have the router on IP address 192.168.1.254 (I have long forgotten what the default is for this router).

The script is run by cron every 5 minutes on a Debian/Ubuntu server and requires the rrdtool and snmp packages to be installed.

#!/usr/bin/perl -w

use strict;

print( scalar(localtime()) . " ---- \n" );

###
# THE following commands should be run manually at a Linux command line
# before running this script for the first time. It creates the data files
# (databases) into which monitoring data will be placed.
#
# rrdtool create adsl-speed.rrd -s 300 DS:up:GAUGE:600:0:999999999 DS:down:GAUGE:600:0:999999999 RRA:AVERAGE:0.5:1:2016 RRA:MIN:0.5:1:2016 RRA:MAX:0.5:1:2016 RRA:AVERAGE:0.5:12:8760 RRA:MIN:0.5:12:8760 RRA:MAX:0.5:12:8760
# rrdtool create adsl-snr.rrd -s 300 DS:up:GAUGE:600:0:9999 DS:down:GAUGE:600:0:9999 RRA:AVERAGE:0.5:1:2016 RRA:MIN:0.5:1:2016 RRA:MAX:0.5:1:2016 RRA:AVERAGE:0.5:12:8760 RRA:MIN:0.5:12:8760 RRA:MAX:0.5:12:8760
# rrdtool create adsl-att.rrd -s 300 DS:up:GAUGE:600:0:9999 DS:down:GAUGE:600:0:9999 RRA:AVERAGE:0.5:1:2016 RRA:MIN:0.5:1:2016 RRA:MAX:0.5:1:2016 RRA:AVERAGE:0.5:12:8760 RRA:MIN:0.5:12:8760 RRA:MAX:0.5:12:8760
# rrdtool create adsl-transfer.rrd -s 300 DS:up:DERIVE:600:0:99999999 DS:down:DERIVE:600:0:99999999 RRA:AVERAGE:0.5:1:2016 RRA:MIN:0.5:1:2016 RRA:MAX:0.5:1:2016 RRA:AVERAGE:0.5:12:8760 RRA:MIN:0.5:12:8760 RRA:MAX:0.5:12:8760

my $routerip = "192.168.1.254";
my $rrdspeed = "adsl-speed.rrd";
my $rrdsnr = "adsl-snr.rrd";
my $rrdatt = "adsl-att.rrd";
my $rrdtransfer = "adsl-transfer.rrd";

my %oid = (
  upspeed => '.1.3.6.1.2.1.10.94.1.1.5.1.2.3',
  downspeed => '.1.3.6.1.2.1.10.94.1.1.4.1.2.3',
  upsnr => '.1.3.6.1.2.1.10.94.1.1.3.1.4.3',
  downsnr => '.1.3.6.1.2.1.10.94.1.1.2.1.4.3',
  upattenuation => '.1.3.6.1.2.1.10.94.1.1.3.1.5.3',
  downattenuation => '.1.3.6.1.2.1.10.94.1.1.2.1.5.3',
  ifInOctets => '.1.3.6.1.2.1.2.2.1.10',
  ifOutOctets => '.1.3.6.1.2.1.2.2.1.16',
);

###
# GET LINESPEED
#

my $cmd_speed = "snmpget -v 1 $routerip -c public " . $oid{downspeed} . " " . $oid{upspeed};
my $result = `$cmd_speed`;

my %var = ();
if (
    $result =~ m{
        \A[^\r\n]+\s+([0-9]+)[\r\n]+
        [^\r\n]+\s+([0-9]+)[\r\n]+
    }sx
) {
    $var{downspeed} = $1;
    $var{upspeed} = $2;
}

if ( $var{downspeed} && $var{upspeed} ) {
    my $cmd_update = "rrdtool update $rrdspeed --template up:down N:" . join( ":", $var{upspeed}, $var{downspeed} );
    print( $cmd_update . "\n" );
    my $result2 = `$cmd_update`;
}

###
# GET SIGNAL-TO-NOISE RATIO
#

my $cmd_snr = "snmpget -v 1 $routerip -c public " . $oid{downsnr} . " " . $oid{upsnr};
$result = `$cmd_snr`;

if (
    $result =~ m{
        \A[^\r\n]+\s+([0-9]+)[\r\n]+
        [^\r\n]+\s+([0-9]+)[\r\n]+
    }sx
) {
    $var{downsnr} = $1 / 10;
    $var{upsnr} = $2 / 10;
}

if ( $var{downsnr} && $var{upsnr} ) {
    my $cmd_update = "rrdtool update $rrdsnr --template up:down N:" . join( ":", $var{upsnr}, $var{downsnr} );
    print( $cmd_update . "\n" );
    my $result2 = `$cmd_update`;
}

###
# GET LINE ATTENUATION
#

my $cmd_att = "snmpget -v 1 $routerip -c public " . $oid{downattenuation} . " " . $oid{upattenuation};
$result = `$cmd_att`;

if (
    $result =~ m{
        \A[^\r\n]+\s+([0-9]+)[\r\n]+
        [^\r\n]+\s+([0-9]+)[\r\n]+
    }sx
) {
    $var{downatt} = $1 / 10;
    $var{upatt} = $2 / 10;
}

if ( $var{downatt} && $var{upatt} ) {
    my $cmd_update = "rrdtool update $rrdatt --template up:down N:" . join( ":", $var{upatt}, $var{downatt} );
    print( $cmd_update . "\n" );
    my $result2 = `$cmd_update`;
}

###
# GET DATA TRANSFERRED
#

my $iface = "6";
my $cmd_transfer = "snmpget -v 1 $routerip -c public " . $oid{ifInOctets} . ".$iface " . $oid{ifOutOctets} . ".$iface";
$result = `$cmd_transfer`;

if (
    $result =~ m{
        \A[^\r\n]+\s+([0-9]+)[\r\n]+
        [^\r\n]+\s+([0-9]+)[\r\n]+
    }sx
) {
    $var{inoctets} = $1;
    $var{outoctets} = $2;
}

if ( defined($var{inoctets}) && defined($var{outoctets}) ) {
    my $cmd_update = "rrdtool update $rrdtransfer --template up:down N:" . join( ":", $var{outoctets}, $var{inoctets} );
    print( $cmd_update . "\n" );
    my $result2 = `$cmd_update`;
}

Graphing Script

This script processes the RRD data files and creates PNG images in the local directory. It then copies the images to the /var/www/monitor subdirectory and changes the permissions on the files (to ensure they can be overwritten in the future).

The script is run by cron every 5 minutes on a Debian/Ubuntu server and requires the rrdtool package to be installed.

#!/usr/bin/perl -w

use strict;

print( scalar(localtime()) . "\n" );
my $now = scalar(localtime());
$now =~ s/:/\\:/g;

my $rrdspeed = "adsl-speed.rrd";
my $rrdsnr = "adsl-snr.rrd";
my $rrdatt = "adsl-att.rrd";
my $rrdtransfer = "adsl-transfer.rrd";

my $width = 800;
my $height = 380;

foreach my $settings (
    [ $height, $width, "365d" ],
    [ $height, $width, "31d" ],
    [ $height, $width, "7d", ],
    [ $height, $width, "24h", ],
) {
    graph_them(
        $settings->[0],
        $settings->[1],
        $settings->[2],
    );
}

sub graph_them {
    my ( $height, $width, $period ) = @_;

    my $cmd_rrdgraph = "rrdtool graph adsl-speed-${period}.png";
    $cmd_rrdgraph .= " -s 'now-$period'";
    $cmd_rrdgraph .= " -e now";
    $cmd_rrdgraph .= " -t 'ADSL Router Speed'";
    $cmd_rrdgraph .= " -v  bps";
    $cmd_rrdgraph .= " -w $width -h $height";
    $cmd_rrdgraph .= " --lower-limit 0";
    $cmd_rrdgraph .= " DEF:up=$rrdspeed:up:AVERAGE";
    $cmd_rrdgraph .= " DEF:down=$rrdspeed:down:AVERAGE";
    $cmd_rrdgraph .= " 'LINE2:up#f02020:  upstream'";
    $cmd_rrdgraph .= " 'GPRINT:up:MIN:Min %8.0lf bps'";
    $cmd_rrdgraph .= " 'GPRINT:up:AVERAGE:Avg %8.0lf bps'";
    $cmd_rrdgraph .= " 'GPRINT:up:MAX:Max %8.0lf bps'";
    $cmd_rrdgraph .= " 'GPRINT:up:LAST:Last %8.0lf bps'";
    $cmd_rrdgraph .= " 'COMMENT:\\l'";
    $cmd_rrdgraph .= " 'LINE2:down#1040e8:downstream'";
    $cmd_rrdgraph .= " 'GPRINT:down:MIN:Min %8.0lf bps'";
    $cmd_rrdgraph .= " 'GPRINT:down:AVERAGE:Avg %8.0lf bps'";
    $cmd_rrdgraph .= " 'GPRINT:down:MAX:Max %8.0lf bps'";
    $cmd_rrdgraph .= " 'GPRINT:down:LAST:Last %8.0lf bps'";
    $cmd_rrdgraph .= " 'COMMENT:\\l'";
    $cmd_rrdgraph .= " 'COMMENT:Created $now\\r'";

    print `$cmd_rrdgraph`;

    $cmd_rrdgraph = "rrdtool graph adsl-snr-${period}.png";
    $cmd_rrdgraph .= " -s 'now-$period'";
    $cmd_rrdgraph .= " -e now";
    $cmd_rrdgraph .= " -t 'ADSL Signal-to-Noise Ratio'";
    $cmd_rrdgraph .= " -v  dB";
    $cmd_rrdgraph .= " -w $width -h $height";
    $cmd_rrdgraph .= " --lower-limit 0";
    $cmd_rrdgraph .= " 'DEF:up=$rrdsnr:up:AVERAGE'";
    $cmd_rrdgraph .= " 'DEF:down=$rrdsnr:down:AVERAGE'";
    $cmd_rrdgraph .= " 'LINE2:up#f02020:  upstream'";
    $cmd_rrdgraph .= " 'GPRINT:up:MIN:Min %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:up:AVERAGE:Avg %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:up:MAX:Max %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:up:LAST:Last %5.1lf dB\\l'";
    $cmd_rrdgraph .= " 'LINE2:down#1040e8:downstream'";
    $cmd_rrdgraph .= " 'GPRINT:down:MIN:Min %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:down:AVERAGE:Avg %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:down:MAX:Max %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:down:LAST:Last %5.1lf dB\\l'";
    $cmd_rrdgraph .= " 'COMMENT:Created $now\\r'";

    print `$cmd_rrdgraph`;

    $cmd_rrdgraph = "rrdtool graph adsl-att-${period}.png";
    $cmd_rrdgraph .= " -s 'now-$period'";
    $cmd_rrdgraph .= " -e now";
    $cmd_rrdgraph .= " -t 'ADSL Line Attenuation'";
    $cmd_rrdgraph .= " -v  dB";
    $cmd_rrdgraph .= " -w $width -h $height";
    $cmd_rrdgraph .= " --lower-limit 0";
    $cmd_rrdgraph .= " DEF:up=$rrdatt:up:AVERAGE";
    $cmd_rrdgraph .= " DEF:down=$rrdatt:down:AVERAGE";
    $cmd_rrdgraph .= " 'LINE2:up#f02020:  upstream'";
    $cmd_rrdgraph .= " 'GPRINT:up:MIN:Min %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:up:AVERAGE:Avg %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:up:MAX:Max %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:up:LAST:Last %5.1lf dB\\l'";
    $cmd_rrdgraph .= " 'LINE2:down#1040e8:downstream'";
    $cmd_rrdgraph .= " 'GPRINT:down:MIN:Min %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:down:AVERAGE:Avg %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:down:MAX:Max %5.1lf dB'";
    $cmd_rrdgraph .= " 'GPRINT:down:LAST:Last %5.1lf dB\\l'";
    $cmd_rrdgraph .= " 'COMMENT:Created $now\\r'";

    print `$cmd_rrdgraph`;

    $cmd_rrdgraph = "rrdtool graph adsl-transfer-${period}.png";
    $cmd_rrdgraph .= " -s 'now-$period'";
    $cmd_rrdgraph .= " -e now";
    $cmd_rrdgraph .= " -t 'ADSL Data Transferred (5 min average)'";
    $cmd_rrdgraph .= " -v 'Bytes/s'";
    $cmd_rrdgraph .= " -w $width -h $height";
    $cmd_rrdgraph .= " --lower-limit 0";
    $cmd_rrdgraph .= " DEF:up=$rrdtransfer:up:AVERAGE";
    $cmd_rrdgraph .= " DEF:down=$rrdtransfer:down:AVERAGE";
    $cmd_rrdgraph .= " CDEF:cup=up,1024,1024,1024,*,*,/";
    $cmd_rrdgraph .= " CDEF:cdown=down,1024,1024,1024,*,*,/";
    $cmd_rrdgraph .= " VDEF:tup=cup,TOTAL";
    $cmd_rrdgraph .= " VDEF:tdown=cdown,TOTAL";
    $cmd_rrdgraph .= " 'LINE2:up#f02020:  upstream'";
    $cmd_rrdgraph .= " 'GPRINT:up:MIN:Min %8.0lf B/s'";
    $cmd_rrdgraph .= " 'GPRINT:up:AVERAGE:Avg %8.0lf B/s'";
    $cmd_rrdgraph .= " 'GPRINT:up:MAX:Max %8.0lf B/s'";
    $cmd_rrdgraph .= " 'GPRINT:up:LAST:Last %8.0lf B/s'";
    $cmd_rrdgraph .= " 'GPRINT:tup:Total %7.3lf GBytes'";
    $cmd_rrdgraph .= " 'COMMENT:\\l'";
    $cmd_rrdgraph .= " 'LINE2:down#1040e8:downstream'";
    $cmd_rrdgraph .= " 'GPRINT:down:MIN:Min %8.0lf B/s'";
    $cmd_rrdgraph .= " 'GPRINT:down:AVERAGE:Avg %8.0lf B/s'";
    $cmd_rrdgraph .= " 'GPRINT:down:MAX:Max %8.0lf B/s'";
    $cmd_rrdgraph .= " 'GPRINT:down:LAST:Last %8.0lf B/s'";
    $cmd_rrdgraph .= " 'GPRINT:tdown:Total %7.3lf GBytes'";
    $cmd_rrdgraph .= " 'COMMENT:\\l'";
    $cmd_rrdgraph .= " 'COMMENT:Created $now\\r'";

    print `$cmd_rrdgraph`;

    for my $graph ( qw(att snr speed transfer) ) {
        `cp "adsl-${graph}-${period}.png" "/var/www/monitor/"`;
        `chmod 666 "/var/www/monitor/adsl-${graph}-${period}.png"`;
    }
}

Resulting Graphs

Real-world example of signal-to-noise ratio over a year

Real-world example of signal-to-noise ratio over a year

The above is the output from my server showing the changes in signal-to-noise ratio from the same location over the period of a full year.

One response to “Monitoring the Billion 7404VGO-M ADSL Router

  1. Jez December 7, 2012 at 11:45 am

    Thank you for a very informative and useful article!

    I have a Billion 7800N and here are the SNMP MIBs for this particular version:

    upspeed => ‘.1.3.6.1.2.1.10.94.1.1.2.1.8.3’,
    downspeed => ‘.1.3.6.1.2.1.10.94.1.1.3.1.8.3’,
    upsnr => ‘.1.3.6.1.2.1.10.94.1.1.2.1.4.3’,
    downsnr => ‘.1.3.6.1.2.1.10.94.1.1.3.1.4.3’,
    upattenuation => ‘.1.3.6.1.2.1.10.94.1.1.2.1.5.3’,
    downattenuation => ‘.1.3.6.1.2.1.10.94.1.1.3.1.5.3’,
    ifInOctets => ‘.1.3.6.1.2.1.2.2.1.10’,
    ifOutOctets => ‘.1.3.6.1.2.1.2.2.1.16’,

    Line 188: my $iface = “5”;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: