#!/usr/bin/perl

use strict;
use warnings;

# this script just makes the entries for mrtg

# $Id: mrtg_make.pl 68 2007-10-26 22:22:53Z ed $
# $URL: svn+ssh://fw/repos/code/perl/cablemodem/mrtg_make.pl $

# Use at your own risk. Author not responsible for use.
# Updates at http://www.s5h.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

my @keys = qw( downstream_channel_id downstream_frequency downstream_receive_power_leavel downstream_snr downstream_symbol_rate upstream_channel_id upstream_frequency upstream_symbol_rate upstream_transmit_power_level );

if( !defined( $ARGV[0] ) ) {
	print( "Usage: mrtg_make.pl <path to ntl_virgin_media.pl>\n" );
	exit(1);
}

foreach( @keys ) {
	print( "Title[$_]: $_\n" .
	"MaxBytes[$_]: 1000\n" .
	"AbsMax[$_]: 100000\n" .
	"Options[$_]: gauge,growright\n" .
	"Target[$_]: `/usr/bin/perl ${ARGV[0]} $_`\n" .
	"PageTop[$_]: <B>$_</B><BR>\n" .
	"ShortLegend[$_]: &nbsp;\n" .
	"YLegend[$_]: $_\n" .
	"Legend1[$_]: $_\n" .
	"LegendI[$_]: $_\n" .
	"LegendO[$_]: $_\n" .
	"WithPeak[$_]: ymwd\n" .
	"XSize[$_]: 350\n" .
	"YSize[$_]: 150\n" .
	"\n" );

	print( STDERR "<tr><td><b><a href=\"$_.html\">$_</a> " .
		"(5 Minute average)</b><br />" .
		"<a href=\"$_.html\"><img src=\"$_-day.png\" " .
			"alt=\"day\" " .
			"style=\"border:0px\" /></a></td>\n" .
		"<td>&nbsp;</td>\n" .
		"</tr>\n" );
}


