mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
Net-Traffic aktualisiert
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@595 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -293,6 +293,60 @@ print <<END;
|
||||
|
||||
END
|
||||
|
||||
require "${General::swroot}/net-traffic/net-traffic-admin.pl";
|
||||
|
||||
if($NETTRAFF::settings{'SHOW_AT_HOME'} eq 'on')
|
||||
{
|
||||
my %calc = ();
|
||||
$calc{'CALC_VOLUME_TOTAL'} = 0;
|
||||
$calc{'CALC_VOLUME_IN'} = 0;
|
||||
$calc{'CALC_VOLUME_OUT'} = 0;
|
||||
$calc{'CALC_WEEK_TOTAL'} = 0;
|
||||
$calc{'CALC_WEEK_IN'} = 0;
|
||||
$calc{'CALC_WEEK_OUT'} = 0;
|
||||
$calc{'CALC_LAST_RUN'} = 0;
|
||||
$calc{'CALC_PERCENT'} = 0;
|
||||
|
||||
&General::readhash($NETTRAFF::logfile, \%calc);
|
||||
|
||||
my $calctime = &NETTRAFF::getFormatedDate($calc{'CALC_LAST_RUN'});
|
||||
|
||||
print <<END;
|
||||
<hr /><br />
|
||||
|
||||
<table width='80%'>
|
||||
<tr>
|
||||
<td colspan='4' align='center' nowrap='nowrap' >$Lang::tr{'traffic monitor'} ($Lang::tr{'traffic calc time'} $calctime)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='center' nowrap='nowrap' > </td>
|
||||
<td align='center' nowrap='nowrap' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficin'}</b></font></td>
|
||||
<td align='center' nowrap='nowrap' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficout'}</b></font></td>
|
||||
<td align='center' nowrap='nowrap' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficsum'}</b></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='center' nowrap='nowrap' >$Lang::tr{'this weeks volume'} (MB):</td>
|
||||
<td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_WEEK_IN'}</td>
|
||||
<td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_WEEK_OUT'}</td>
|
||||
<td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_WEEK_TOTAL'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='center' nowrap='nowrap' >$Lang::tr{'this months volume'} (MB):</td>
|
||||
<td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_VOLUME_IN'}</td>
|
||||
<td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_VOLUME_OUT'}</td>
|
||||
<td align='center' nowrap='nowrap' class='boldbase'>$calc{'CALC_VOLUME_TOTAL'}</td>
|
||||
</tr>
|
||||
END
|
||||
|
||||
if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on')
|
||||
{
|
||||
print "<tr><td align='center'>max. $NETTRAFF::settings{'MONTHLY_VOLUME'} MB</td><td align='left' colspan='3' nowrap='nowrap'>";
|
||||
&NETTRAFF::traffPercentbar("$calc{'CALC_PERCENT'}%");
|
||||
print "</td><td align='left' nowrap='nowrap'> $calc{'CALC_PERCENT'}%</td></tr>";
|
||||
}
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
&Header::closebox();
|
||||
|
||||
&Header::closebigbox();
|
||||
|
||||
@@ -6,6 +6,16 @@
|
||||
#
|
||||
# (c) The SmoothWall Team
|
||||
#
|
||||
# $Id: traffic.cgi,v 1.19 2007/01/09 18:59:23 dotzball Exp $
|
||||
#
|
||||
# traffic.cgi, v1.1.0 2003/10/18
|
||||
# supports now:
|
||||
# * IPCop v1.3.0
|
||||
# * choosing year
|
||||
#
|
||||
# 18 June 2004 Achim Weber
|
||||
# - added functionality to work with IPCop 1.4.0
|
||||
# - use some functions from ipacsum
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -16,111 +26,128 @@ use CGI::Carp 'fatalsToBrowser';
|
||||
require '/var/ipfire/general-functions.pl';
|
||||
require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
require '/var/ipfire/net-traffic/net-traffic-lib.pl';
|
||||
require "${General::swroot}/net-traffic/net-traffic-admin.pl";
|
||||
require "${General::swroot}/net-traffic/net-traffic-lib.pl";
|
||||
|
||||
my %color = ();
|
||||
my %mainsettings = ();
|
||||
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
|
||||
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
|
||||
|
||||
my %cgiparams;
|
||||
my @dummy = (@NETTRAFF::months, @NETTRAFF::longmonths, $NETTRAFF::colorOk, $NETTRAFF::colorWarn, $NETTRAFF::colorMax);
|
||||
undef(@dummy);
|
||||
|
||||
my %cgiparams;
|
||||
my %pppsettings;
|
||||
my %netsettings;
|
||||
|
||||
&General::readhash("${General::swroot}/ppp/settings", \%pppsettings);
|
||||
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
|
||||
|
||||
my ($s, $min, $h, $d, $m,$y) = localtime(time);
|
||||
$y+=1900;
|
||||
$m+=1;
|
||||
$m = $m < 10 ? $m = "0".$m : $m;
|
||||
my @now = localtime(time);
|
||||
|
||||
$now[5] = $now[5]+1900;
|
||||
|
||||
$cgiparams{'STARTYEAR'} = $now[5];
|
||||
$cgiparams{'STARTMONTH'} = $now[4];
|
||||
|
||||
my $startDay = '1';
|
||||
my $endDay = '1';
|
||||
|
||||
if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on')
|
||||
{
|
||||
$startDay = $NETTRAFF::settings{'STARTDAY'};
|
||||
$endDay = $NETTRAFF::settings{'STARTDAY'};
|
||||
}
|
||||
|
||||
# this periode started last month
|
||||
if ($now[3] < $startDay)
|
||||
{
|
||||
# when current month is january we start in last year december
|
||||
if ($now[4] == 0) {
|
||||
$cgiparams{'STARTYEAR'} = $now[5]-1;
|
||||
$cgiparams{'STARTMONTH'} = 11;
|
||||
}
|
||||
else
|
||||
{
|
||||
$cgiparams{'STARTYEAR'} = $now[5];
|
||||
$cgiparams{'STARTMONTH'} = $now[4]-1;
|
||||
}
|
||||
}
|
||||
|
||||
$cgiparams{'MONTH'} = $m;
|
||||
&Header::getcgihash(\%cgiparams);
|
||||
$cgiparams{'YEAR'} = $y;
|
||||
&Header::getcgihash(\%cgiparams);
|
||||
|
||||
my $selectYearALL = "";
|
||||
$selectYearALL = 'selected=\'selected\'' if($cgiparams{'STARTYEAR'} eq '????');
|
||||
|
||||
my $selectMonthALL = "";
|
||||
$selectMonthALL = 'selected=\'selected\'' if($cgiparams{'STARTMONTH'} eq '??');
|
||||
|
||||
&Header::showhttpheaders();
|
||||
|
||||
my %selectYear;
|
||||
$selectYear{'YEAR'}{'2007'} = '';
|
||||
$selectYear{'YEAR'}{'2008'} = '';
|
||||
$selectYear{'YEAR'}{'2009'} = '';
|
||||
$selectYear{'YEAR'}{'2010'} = '';
|
||||
$selectYear{'YEAR'}{'2011'} = '';
|
||||
$selectYear{'YEAR'}{'2012'} = '';
|
||||
$selectYear{'YEAR'}{'????'} = '';
|
||||
$selectYear{'YEAR'}{$cgiparams{'YEAR'}} = 'selected=\'selected\'';
|
||||
|
||||
|
||||
my %selected;
|
||||
|
||||
$selected{'MONTH'}{'01'} = '';
|
||||
$selected{'MONTH'}{'02'} = '';
|
||||
$selected{'MONTH'}{'03'} = '';
|
||||
$selected{'MONTH'}{'04'} = '';
|
||||
$selected{'MONTH'}{'05'} = '';
|
||||
$selected{'MONTH'}{'06'} = '';
|
||||
$selected{'MONTH'}{'07'} = '';
|
||||
$selected{'MONTH'}{'08'} = '';
|
||||
$selected{'MONTH'}{'09'} = '';
|
||||
$selected{'MONTH'}{'10'} = '';
|
||||
$selected{'MONTH'}{'11'} = '';
|
||||
$selected{'MONTH'}{'12'} = '';
|
||||
$selected{'MONTH'}{'??'} = '';
|
||||
$selected{'MONTH'}{$cgiparams{'MONTH'}} = 'selected=\'selected\'';
|
||||
|
||||
&Header::openpage($Lang::tr{'sstraffic'}, 1, '');
|
||||
|
||||
&Header::openbigbox('100%', 'left');
|
||||
&Header::openbox('100%', 'left', "");
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'settings'});
|
||||
my $firstDayTxt = '';
|
||||
|
||||
if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on')
|
||||
{
|
||||
$firstDayTxt = " ($Lang::tr{'monthly volume start day short'}: $NETTRAFF::settings{'STARTDAY'}.)";
|
||||
}
|
||||
|
||||
print <<END;
|
||||
<table width='80%' align='center'>
|
||||
<table width='100%' align='center'>
|
||||
<tr>
|
||||
<td width='95%' align='left' nowrap='nowrap'>
|
||||
<td width='90%' align='left' nowrap='nowrap'>
|
||||
<form method='post' action='/cgi-bin/traffic.cgi'>
|
||||
$Lang::tr{'selecttraffic'}
|
||||
<select name='MONTH'>
|
||||
<option $selected{'MONTH'}{'01'} value='01'>$Lang::tr{'january'}</option>
|
||||
<option $selected{'MONTH'}{'02'} value='02'>$Lang::tr{'february'}</option>
|
||||
<option $selected{'MONTH'}{'03'} value='03'>$Lang::tr{'march'}</option>
|
||||
<option $selected{'MONTH'}{'04'} value='04'>$Lang::tr{'april'}</option>
|
||||
<option $selected{'MONTH'}{'05'} value='05'>$Lang::tr{'may'}</option>
|
||||
<option $selected{'MONTH'}{'06'} value='06'>$Lang::tr{'june'}</option>
|
||||
<option $selected{'MONTH'}{'07'} value='07'>$Lang::tr{'july'}</option>
|
||||
<option $selected{'MONTH'}{'08'} value='08'>$Lang::tr{'august'}</option>
|
||||
<option $selected{'MONTH'}{'09'} value='09'>$Lang::tr{'september'}</option>
|
||||
<option $selected{'MONTH'}{'10'} value='10'>$Lang::tr{'october'}</option>
|
||||
<option $selected{'MONTH'}{'11'} value='11'>$Lang::tr{'november'}</option>
|
||||
<option $selected{'MONTH'}{'12'} value='12'>$Lang::tr{'december'}</option>
|
||||
<option $selected{'MONTH'}{'??'} value='??'>$Lang::tr{'allmsg'}</option>
|
||||
$Lang::tr{'selecttraffic'}$firstDayTxt:
|
||||
<select name='STARTMONTH'>
|
||||
END
|
||||
|
||||
foreach my $month (@NETTRAFF::months)
|
||||
{
|
||||
print "\t<option ";
|
||||
if ("$month" eq "$cgiparams{'STARTMONTH'}") {
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$month'>$NETTRAFF::longmonths[$month]</option>\n";
|
||||
}
|
||||
|
||||
print <<END;
|
||||
<option $selectMonthALL value='??'>$Lang::tr{'allmsg'}</option>
|
||||
</select>
|
||||
<select name='YEAR'>
|
||||
<option $selectYear{'YEAR'}{'2007'} value='2007'>2007</option>
|
||||
<option $selectYear{'YEAR'}{'2008'} value='2008'>2008</option>
|
||||
<option $selectYear{'YEAR'}{'2009'} value='2009'>2009</option>
|
||||
<option $selectYear{'YEAR'}{'2010'} value='2010'>2010</option>
|
||||
<option $selectYear{'YEAR'}{'2011'} value='2011'>2011</option>
|
||||
<option $selectYear{'YEAR'}{'2012'} value='2012'>2012</option>
|
||||
<option $selectYear{'YEAR'}{'????'} value='????'>$Lang::tr{'allmsg'}</option>
|
||||
<select name='STARTYEAR'>
|
||||
END
|
||||
|
||||
for (my $index=0; $index<=$#NETTRAFF::years; $index++) {
|
||||
print "\t<option ";
|
||||
if ("$NETTRAFF::years[$index]" eq "$cgiparams{'STARTYEAR'}") {
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$NETTRAFF::years[$index]'>$NETTRAFF::years[$index]</option>\n";
|
||||
}
|
||||
|
||||
print <<END;
|
||||
<option $selectYearALL value='????'>$Lang::tr{'allmsg'}</option>
|
||||
</select>
|
||||
<input type='submit' name='ACTION' value='$Lang::tr{'update'}' />
|
||||
</form>
|
||||
</td>
|
||||
</td>
|
||||
<td width='5%' align='center'>
|
||||
<form method='post' action='/cgi-bin/trafficadm.cgi'>
|
||||
<input type='submit' name='ACTION' value='$Lang::tr{'net-traffic configuration'}' />
|
||||
</form>
|
||||
</td>
|
||||
<td width='5%' align='center'>
|
||||
<form method='post' action='/cgi-bin/traffics.cgi'>
|
||||
<input type='submit' name='ACTION' value=' > ' />
|
||||
</form>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
END
|
||||
|
||||
&Header::closebox();
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'traffics'});
|
||||
&Header::openbox('100%', 'left', "$Lang::tr{'traffics'}");
|
||||
|
||||
my $dateWidth = '20%';
|
||||
my $netWidth = '34%';
|
||||
@@ -154,36 +181,36 @@ if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/) {
|
||||
print "<td width='$netWidth' align='center' class='boldbase' ><b>$Lang::tr{'trafficorange'}</b></td>";
|
||||
}
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/) {
|
||||
print "<td width='$netWidth' align='center' class='boldbase'><b>$Lang::tr{'trafficred'}</b></td>";
|
||||
}
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/) {
|
||||
print "<td width='$netWidth' align='center' class='boldbase'><b>$Lang::tr{'trafficred'}</b></td>";
|
||||
}
|
||||
print <<END;
|
||||
</tr>
|
||||
</table>
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td width='$dateWidth' align='center' class='boldbase'><b>$Lang::tr{'trafficdate'}</b></td>
|
||||
<td width='$inOutWidth' align='center' class='boldbase'><font color='#16A61D'><b>$Lang::tr{'trafficin'}</b></font></td>
|
||||
<td width='$inOutWidth' align='center' class='boldbase'><font color='#16A61D'><b>$Lang::tr{'trafficout'}</b></font></td>
|
||||
<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourgreen'><b>$Lang::tr{'trafficin'}</b></font></td>
|
||||
<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourgreen'><b>$Lang::tr{'trafficout'}</b></font></td>
|
||||
END
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
|
||||
{
|
||||
{
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='${Header::colourblue}'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='${Header::colourblue}'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
|
||||
{
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#FF9933'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#FF9933'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
}
|
||||
{
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourorange'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourorange'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
}
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#CE1B31'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#CE1B31'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
}
|
||||
print"</tr>";
|
||||
print "</tr>";
|
||||
|
||||
my $total_blue_in=0;
|
||||
my $total_blue_out=0;
|
||||
@@ -195,68 +222,156 @@ my $total_red_in=0;
|
||||
my $total_red_out=0;
|
||||
my $lines=0;
|
||||
|
||||
my $displayMode = "daily";
|
||||
my $startMonth = $cgiparams{'MONTH'};
|
||||
my $endMonth = $cgiparams{'MONTH'};
|
||||
|
||||
if ($cgiparams{'MONTH'} eq '??') {
|
||||
$displayMode = "monthly";
|
||||
$startMonth = '01';
|
||||
$endMonth = '12';
|
||||
|
||||
my $startYear = $cgiparams{'STARTYEAR'};
|
||||
my $endYear = $cgiparams{'STARTYEAR'};
|
||||
my $startMonth = $cgiparams{'STARTMONTH'};
|
||||
my $endMonth = $cgiparams{'STARTMONTH'};
|
||||
my $displayMode = "daily_multi";
|
||||
$startDay = '1';
|
||||
$endDay = '1';
|
||||
my $selectedMonth = '0';
|
||||
|
||||
if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on')
|
||||
{
|
||||
$startDay = $NETTRAFF::settings{'STARTDAY'};
|
||||
$endDay = $NETTRAFF::settings{'STARTDAY'};
|
||||
}
|
||||
|
||||
my $start = "$cgiparams{'YEAR'}$startMonth"."01";
|
||||
my $end = "$cgiparams{'YEAR'}$endMonth"."32";
|
||||
# "show All ?
|
||||
if ($cgiparams{'STARTYEAR'} eq '????')
|
||||
{
|
||||
# 'show all month' + 'show all years'
|
||||
# OR <selected Month> + 'show all years'
|
||||
|
||||
# if we have a <selected Month>, we read all traffic but display only the selected month
|
||||
if($cgiparams{'STARTMONTH'} ne '??')
|
||||
{
|
||||
$selectedMonth = $cgiparams{'STARTMONTH'} + 1;
|
||||
$selectedMonth = $selectedMonth < 10 ? $selectedMonth = "0".$selectedMonth : $selectedMonth;
|
||||
}
|
||||
|
||||
$displayMode = "monthly";
|
||||
# start with 1970-01-01
|
||||
$startYear = 1970;
|
||||
$startMonth = '1';
|
||||
$startDay = '1';
|
||||
# end with next year: 20xx-01-01
|
||||
$endYear = $now[5] + 1;
|
||||
$endMonth = '1';
|
||||
$endDay = '1';
|
||||
}
|
||||
elsif ($cgiparams{'STARTMONTH'} eq '??')
|
||||
{
|
||||
# 'show all month' + 200x
|
||||
$displayMode = "monthly";
|
||||
# start with 200x-01-01
|
||||
$startMonth = '1';
|
||||
$startDay = '1';
|
||||
# end with (200x+1)-01-01
|
||||
$endYear = $startYear + 1;
|
||||
$endMonth = '1';
|
||||
$endDay = '1';
|
||||
}
|
||||
else
|
||||
{
|
||||
# no "Show All"
|
||||
$startMonth++;
|
||||
$endMonth = $endMonth + 2;
|
||||
|
||||
# this periode started last month
|
||||
if ($now[3] < $startDay)
|
||||
{
|
||||
# when current month is january we start in last year december
|
||||
if ($endMonth == 1) {
|
||||
$startYear--;
|
||||
$startMonth = 12;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# when we are in december, this periode ends next year january
|
||||
if ($startMonth == 12) {
|
||||
$endYear++;
|
||||
$endMonth = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$startMonth = $startMonth < 10 ? $startMonth = "0".$startMonth : $startMonth;
|
||||
$endMonth = $endMonth < 10 ? $endMonth = "0".$endMonth : $endMonth;
|
||||
$startDay = $startDay < 10 ? $startDay = "0".$startDay : $startDay;
|
||||
$endDay = $endDay < 10 ? $endDay = "0".$endDay : $endDay;
|
||||
|
||||
my $start = "$startYear$startMonth$startDay";
|
||||
my $end = "$endYear$endMonth$endDay";
|
||||
|
||||
my %allDaysBytes = ();
|
||||
my @allDays = &Traffic::calcTraffic(\%allDaysBytes,$start,$end, $displayMode);
|
||||
|
||||
|
||||
foreach (@allDays) {
|
||||
foreach (@allDays)
|
||||
{
|
||||
# special code for: <selected Month> + 'show all years'
|
||||
if($cgiparams{'STARTMONTH'} ne '??' && $cgiparams{'STARTYEAR'} eq '????')
|
||||
{
|
||||
# show only those traffic in the selected month
|
||||
if($allDaysBytes{$_}{'Day'} !~ /^\d\d\d\d-$selectedMonth$/)
|
||||
{
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
$total_green_in += $allDaysBytes{$_}{${Traffic::green_in}};
|
||||
$total_green_out += $allDaysBytes{$_}{${Traffic::green_out}};
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
|
||||
{
|
||||
$total_blue_in += $allDaysBytes{$_}{${Traffic::blue_in}};
|
||||
$total_blue_out += $allDaysBytes{$_}{${Traffic::blue_out}};
|
||||
}
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
|
||||
{
|
||||
$total_orange_in += $allDaysBytes{$_}{${Traffic::orange_in}};
|
||||
$total_orange_out += $allDaysBytes{$_}{${Traffic::orange_out}};
|
||||
}
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
{
|
||||
$total_red_in += $allDaysBytes{$_}{${Traffic::red_in}};
|
||||
$total_red_out += $allDaysBytes{$_}{${Traffic::red_out}};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($lines % 2) {
|
||||
print "<tr bgcolor='$color{'color20'}'>"; }
|
||||
else {
|
||||
print "<tr bgcolor='$color{'color22'}'>"; }
|
||||
|
||||
print "<tr bgcolor='$color{'color22'}}'>"; }
|
||||
|
||||
printf "<td align='center' nowrap='nowrap'>%s</td>\n", $allDaysBytes{$_}{'Day'};
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::green_in}}/1048576);
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::green_out}}/1048576);
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
|
||||
{
|
||||
{
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::blue_in}}/1048576);
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::blue_out}}/1048576);
|
||||
}
|
||||
}
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
|
||||
{
|
||||
{
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::orange_in}}/1048576);
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::orange_out}}/1048576);
|
||||
}
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
}
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::red_in}}/1048576);
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td></tr>\n", ($allDaysBytes{$_}{${Traffic::red_out}}/1048576);
|
||||
}
|
||||
}
|
||||
|
||||
$lines++;
|
||||
}
|
||||
|
||||
@@ -265,42 +380,62 @@ $total_green_out=sprintf("%.2f", ($total_green_out/1048576));
|
||||
$total_blue_in=sprintf("%.2f", ($total_blue_in/1048576));
|
||||
$total_blue_out=sprintf("%.2f", ($total_blue_out/1048576));
|
||||
$total_orange_in=sprintf("%.2f", ($total_orange_in/1048576));
|
||||
$total_orange_out=sprintf("%.2f", ($total_orange_out/1048576));
|
||||
$total_orange_out=sprintf("%.2f", ($total_orange_out/1048576));
|
||||
$total_red_in=sprintf("%.2f", ($total_red_in/1048576));
|
||||
$total_red_out=sprintf("%.2f", ($total_red_out/1048576));
|
||||
|
||||
|
||||
if ($lines % 2) {print "<tr bgcolor='$color{'color20'}'>"; }
|
||||
else {print "<tr bgcolor='$color{'color22'}'>"; }
|
||||
|
||||
|
||||
print <<END;
|
||||
<td align='center' class='boldbase' height='20' nowrap='nowrap'><b>$Lang::tr{'trafficsum'}</b></td>
|
||||
<td align='center' class='boldbase' nowrap='nowrap'><b>$total_green_in MB</b></td>
|
||||
<td align='center' class='boldbase' nowrap='nowrap'><b>$total_green_out MB</b></td>
|
||||
END
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
|
||||
{
|
||||
{
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_blue_in MB</b></td>";
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_blue_out MB</b></td>";
|
||||
}
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
|
||||
{
|
||||
{
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_orange_in MB</b></td>";
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_orange_out MB</b></td>";
|
||||
}
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_in MB</b></td>";
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_out MB</b></td>";
|
||||
}
|
||||
print <<END;
|
||||
</tr>
|
||||
</table>
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_in MB</b></td>";
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_out MB</b></td>";
|
||||
}
|
||||
print "</tr></table>";
|
||||
|
||||
if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on')
|
||||
{
|
||||
my $total_red_all = sprintf("%.2f", ($total_red_in + $total_red_out));
|
||||
|
||||
my $color = $NETTRAFF::colorOk;
|
||||
|
||||
my $warnTraff = ($NETTRAFF::settings{'MONTHLY_VOLUME'} * $NETTRAFF::settings{'WARN'} / 100);
|
||||
if($NETTRAFF::settings{'WARN_ON'} eq 'on'
|
||||
&& $warnTraff < $total_red_all)
|
||||
{
|
||||
$color = $NETTRAFF::colorWarn;
|
||||
}
|
||||
if($NETTRAFF::settings{'MONTHLY_VOLUME'} < $total_red_all)
|
||||
{
|
||||
$color = $NETTRAFF::colorMax;
|
||||
}
|
||||
|
||||
print <<END;
|
||||
<table width='100%'>
|
||||
<tr><td align='center' class='boldbase' nowrap='nowrap' ><b>$Lang::tr{'monthly volume'} ($NETTRAFF::settings{'MONTHLY_VOLUME'} MB)</b></td></tr>
|
||||
<tr><td align='center' class='boldbase' nowrap='nowrap' bgcolor='$color'><b>$total_red_all MB</b></td></tr>
|
||||
</table>
|
||||
END
|
||||
}
|
||||
|
||||
&Header::closebox();
|
||||
|
||||
&Header::closebigbox();
|
||||
|
||||
&Header::closepage();
|
||||
|
||||
407
html/cgi-bin/trafficadm.cgi
Normal file
407
html/cgi-bin/trafficadm.cgi
Normal file
@@ -0,0 +1,407 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# This code is distributed under the terms of the GPL
|
||||
#
|
||||
# Copyright (c) 2005 Achim Weber
|
||||
#
|
||||
# $Id: trafficadm.cgi,v 1.21 2006/12/31 14:33:18 dotzball Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
# enable only the following on debugging purpose
|
||||
use warnings;
|
||||
use CGI::Carp 'fatalsToBrowser';
|
||||
|
||||
require '/var/ipfire/general-functions.pl';
|
||||
require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
require "${General::swroot}/net-traffic/net-traffic-admin.pl";
|
||||
|
||||
my %cgiparams;
|
||||
my $errormessage = '';
|
||||
my $infomessage = '';
|
||||
my $saveerror = 0;
|
||||
my @days = ( 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 );
|
||||
my @warnLevels = ( 50,60,70,80,90,100 );
|
||||
|
||||
my @dummy = ($NETTRAFF::settingsfile, ${Header::colourred});
|
||||
undef(@dummy);
|
||||
|
||||
&Header::showhttpheaders();
|
||||
|
||||
# Init parameters
|
||||
$cgiparams{'MONTHLY_VOLUME_ON'} = 'off';
|
||||
$cgiparams{'MONTHLY_VOLUME'} = '';
|
||||
$cgiparams{'STARTDAY'} = '1';
|
||||
$cgiparams{'WARN_ON'} = 'off';
|
||||
$cgiparams{'WARN'} = '80';
|
||||
$cgiparams{'CALC_INTERVAL'} = '60';
|
||||
$cgiparams{'SHOW_AT_HOME'} = 'off';
|
||||
$cgiparams{'SEND_EMAIL_ON'} = 'off';
|
||||
$cgiparams{'EMAIL_TO'} = '';
|
||||
$cgiparams{'EMAIL_FROM'} = '';
|
||||
$cgiparams{'EMAIL_USR'} = '';
|
||||
$cgiparams{'EMAIL_PW'} = '';
|
||||
$cgiparams{'EMAIL_SERVER'} = '';
|
||||
$cgiparams{'VERSION_CHECK_ON'} = 'off';
|
||||
|
||||
|
||||
&Header::getcgihash(\%cgiparams);
|
||||
|
||||
if ($cgiparams{'ACTION'} eq $Lang::tr{'save'})
|
||||
{
|
||||
&validSave();
|
||||
|
||||
if ($errormessage) {
|
||||
$saveerror = 1;
|
||||
}
|
||||
else { # no error, all right, save new settings
|
||||
&General::writehash($NETTRAFF::settingsfile, \%cgiparams);
|
||||
# calculate traffic
|
||||
`/usr/local/bin/monitorTraff --force < /dev/null > /dev/null 2>&1 &`;
|
||||
}
|
||||
} # end if ($cgiparams{'ACTION'} eq $Lang::tr{'save'})
|
||||
|
||||
|
||||
# if user want to save settings and get a errormessage, we don<6F>t
|
||||
# overwrite users input
|
||||
unless ($saveerror) {
|
||||
|
||||
&NETTRAFF::readSettings();
|
||||
|
||||
$cgiparams{'MONTHLY_VOLUME_ON'} = $NETTRAFF::settings{'MONTHLY_VOLUME_ON'};
|
||||
$cgiparams{'MONTHLY_VOLUME'} = $NETTRAFF::settings{'MONTHLY_VOLUME'};
|
||||
$cgiparams{'STARTDAY'} = $NETTRAFF::settings{'STARTDAY'};
|
||||
$cgiparams{'WARN_ON'} = $NETTRAFF::settings{'WARN_ON'};
|
||||
$cgiparams{'WARN'} = $NETTRAFF::settings{'WARN'};
|
||||
$cgiparams{'CALC_INTERVAL'} = $NETTRAFF::settings{'CALC_INTERVAL'};
|
||||
$cgiparams{'SHOW_AT_HOME'} = $NETTRAFF::settings{'SHOW_AT_HOME'};
|
||||
$cgiparams{'SEND_EMAIL_ON'} = $NETTRAFF::settings{'SEND_EMAIL_ON'};
|
||||
$cgiparams{'EMAIL_TO'} = $NETTRAFF::settings{'EMAIL_TO'};
|
||||
$cgiparams{'EMAIL_FROM'} = $NETTRAFF::settings{'EMAIL_FROM'};
|
||||
$cgiparams{'EMAIL_USR'} = $NETTRAFF::settings{'EMAIL_USR'};
|
||||
$cgiparams{'EMAIL_PW'} = $NETTRAFF::settings{'EMAIL_PW'};
|
||||
$cgiparams{'EMAIL_SERVER'} = $NETTRAFF::settings{'EMAIL_SERVER'};
|
||||
$cgiparams{'VERSION_CHECK_ON'} = $NETTRAFF::settings{'VERSION_CHECK_ON'};
|
||||
|
||||
} # end unless ($saveerror)
|
||||
|
||||
|
||||
if ($cgiparams{'ACTION'} eq $Lang::tr{'send test mail'})
|
||||
{
|
||||
# send test email
|
||||
my $return = `/usr/local/bin/monitorTraff --testEmail`;
|
||||
|
||||
if($return =~ /Email was sent successfully!/)
|
||||
{
|
||||
$infomessage = "$Lang::tr{'test email was sent'}<br/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$errormessage = "$Lang::tr{'test email could not be sent'}:<br/>";
|
||||
$errormessage .= "$return <br />";
|
||||
}
|
||||
|
||||
|
||||
} # end if ($cgiparams{'ACTION'} eq $Lang::tr{'send test mail'})
|
||||
|
||||
|
||||
|
||||
my %selected;
|
||||
$selected{'CALC_INTERVAL'}{'5'} = '';
|
||||
$selected{'CALC_INTERVAL'}{'10'} = '';
|
||||
$selected{'CALC_INTERVAL'}{'15'} = '';
|
||||
$selected{'CALC_INTERVAL'}{'30'} = '';
|
||||
$selected{'CALC_INTERVAL'}{'60'} = '';
|
||||
$selected{'CALC_INTERVAL'}{$cgiparams{'CALC_INTERVAL'}} = "selected='selected'";
|
||||
|
||||
my %checked;
|
||||
$checked{'MONTHLY_VOLUME_ON'}{'off'} = '';
|
||||
$checked{'MONTHLY_VOLUME_ON'}{'on'} = '';
|
||||
$checked{'MONTHLY_VOLUME_ON'}{$cgiparams{'MONTHLY_VOLUME_ON'}} = "checked='checked'";
|
||||
|
||||
$checked{'WARN_ON'}{'off'} = '';
|
||||
$checked{'WARN_ON'}{'on'} = '';
|
||||
$checked{'WARN_ON'}{$cgiparams{'WARN_ON'}} = "checked='checked'";
|
||||
|
||||
$checked{'SHOW_AT_HOME'}{'off'} = '';
|
||||
$checked{'SHOW_AT_HOME'}{'on'} = '';
|
||||
$checked{'SHOW_AT_HOME'}{$cgiparams{'SHOW_AT_HOME'}} = "checked='checked'" ;
|
||||
|
||||
$checked{'SEND_EMAIL_ON'}{'off'} = '';
|
||||
$checked{'SEND_EMAIL_ON'}{'on'} = '';
|
||||
$checked{'SEND_EMAIL_ON'}{$cgiparams{'SEND_EMAIL_ON'}} = "checked='checked'" ;
|
||||
|
||||
$checked{'VERSION_CHECK_ON'}{'off'} = '';
|
||||
$checked{'VERSION_CHECK_ON'}{'on'} = '';
|
||||
$checked{'VERSION_CHECK_ON'}{$cgiparams{'VERSION_CHECK_ON'}} = "checked='checked'" ;
|
||||
|
||||
|
||||
my $btnTestmailDisabled = "";
|
||||
$btnTestmailDisabled = "disabled='disabled'" if($cgiparams{'SEND_EMAIL_ON'} ne 'on');
|
||||
|
||||
&Header::openpage($Lang::tr{'traffic monitor'}, 1, '');
|
||||
&Header::openbigbox('100%', 'left');
|
||||
|
||||
if ($errormessage) {
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
|
||||
print "<class name='base'><font color='${Header::colourred}'>$errormessage\n</font>";
|
||||
print " </class>\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
if($infomessage) {
|
||||
&Header::openbox('100%', 'left', "$Lang::tr{'traffic info messages'}:");
|
||||
print "<class name='base'>$infomessage\n";
|
||||
print " </class>\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
&Header::openbox('100%', 'left', "$Lang::tr{'net-traffic configuration'}:");
|
||||
|
||||
print <<END;
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td align='left' class='base' width='1%'>
|
||||
<input type="checkbox" name="SHOW_AT_HOME" $checked{'SHOW_AT_HOME'}{'on'} />
|
||||
</td>
|
||||
<td align='left' class='base' nowrap='nowrap' colspan="3">
|
||||
$Lang::tr{'display traffic at home'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base'>
|
||||
<input type="checkbox" name="MONTHLY_VOLUME_ON" $checked{'MONTHLY_VOLUME_ON'}{'on'} />
|
||||
</td>
|
||||
<td align='left' class='base' nowrap='nowrap' colspan="2">
|
||||
$Lang::tr{'monthly volume'} (MByte):
|
||||
</td>
|
||||
<td align='left' class='base' >
|
||||
<input type='text' name='MONTHLY_VOLUME' value='$cgiparams{'MONTHLY_VOLUME'}' size='20' maxlength='17' />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base' colspan="2"></td>
|
||||
<td align='left' class='base' nowrap='nowrap' >
|
||||
$Lang::tr{'monthly volume start day'}:
|
||||
</td>
|
||||
<td align='left' class='base' >
|
||||
<select name='STARTDAY'>
|
||||
END
|
||||
|
||||
foreach my $day (@days)
|
||||
{
|
||||
print " <option ";
|
||||
if ($day == $cgiparams{'STARTDAY'}) {
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$day'>$day</option>\n";
|
||||
}
|
||||
print <<END;
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base' width='1%'></td>
|
||||
<td align='left' class='base' width='1%'>
|
||||
<input type="checkbox" name="WARN_ON" $checked{'WARN_ON'}{'on'} />
|
||||
</td>
|
||||
<td align='left' class='base' width='20%' nowrap='nowrap'>
|
||||
$Lang::tr{'warn when traffic reaches'}:
|
||||
</td>
|
||||
<td align='left' class='base' width='78%'>
|
||||
<select name='WARN'>
|
||||
END
|
||||
|
||||
foreach my $level (@warnLevels)
|
||||
{
|
||||
print " <option ";
|
||||
if ($level == $cgiparams{'WARN'}) {
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$level'>$level</option>\n";
|
||||
}
|
||||
print <<END;
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base' colspan="2"></td>
|
||||
<td align='left' class='base' nowrap='nowrap' >
|
||||
$Lang::tr{'calc traffic all x minutes'}:
|
||||
</td>
|
||||
<td align='left' class='base' >
|
||||
<select name='CALC_INTERVAL'>
|
||||
<option value='5' $selected{'CALC_INTERVAL'}{'5'} > 5</option>
|
||||
<option value='10' $selected{'CALC_INTERVAL'}{'10'}>10</option>
|
||||
<option value='15' $selected{'CALC_INTERVAL'}{'15'}>15</option>
|
||||
<option value='30' $selected{'CALC_INTERVAL'}{'30'}>30</option>
|
||||
<option value='60' $selected{'CALC_INTERVAL'}{'60'}>60</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base'> </td>
|
||||
<td align='left' class='base'>
|
||||
<input type="checkbox" name="SEND_EMAIL_ON" $checked{'SEND_EMAIL_ON'}{'on'} />
|
||||
</td>
|
||||
<td align='left' class='base' colspan="2" nowrap='nowrap' >
|
||||
$Lang::tr{'send email notification'}:
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base' colspan="2"> </td>
|
||||
<td align='left' class='base' nowrap='nowrap'>
|
||||
$Lang::tr{'to email adr'}:
|
||||
</td>
|
||||
<td align='left' class='base' >
|
||||
<input type='text' name='EMAIL_TO' value='$cgiparams{'EMAIL_TO'}' size='25' />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base' colspan="2"> </td>
|
||||
<td align='left' class='base' nowrap='nowrap'>
|
||||
$Lang::tr{'from email adr'}:
|
||||
</td>
|
||||
<td align='left' class='base' >
|
||||
<input type='text' name='EMAIL_FROM' value='$cgiparams{'EMAIL_FROM'}' size='25' />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base' colspan="2"> </td>
|
||||
<td align='left' class='base' nowrap='nowrap'>
|
||||
$Lang::tr{'from email user'}:
|
||||
</td>
|
||||
<td align='left' class='base' >
|
||||
<input type='text' name='EMAIL_USR' value='$cgiparams{'EMAIL_USR'}' size='25' />
|
||||
<img src='/blob.gif' alt='*' />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base' colspan="2"> </td>
|
||||
<td align='left' class='base' nowrap='nowrap'>
|
||||
$Lang::tr{'from email pw'}:
|
||||
</td>
|
||||
<td align='left' class='base' >
|
||||
<input type='password' name='EMAIL_PW' value='$cgiparams{'EMAIL_PW'}' size='25' />
|
||||
<img src='/blob.gif' alt='*' />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base' colspan="2"> </td>
|
||||
<td align='left' class='base' nowrap='nowrap'>
|
||||
$Lang::tr{'from email server'}:
|
||||
</td>
|
||||
<td align='left' class='base' >
|
||||
<input type='text' name='EMAIL_SERVER' value='$cgiparams{'EMAIL_SERVER'}' size='25' />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left' class='base' colspan="2"> </td>
|
||||
<td align='left' class='base' colspan="2">
|
||||
<input type='submit' name='ACTION' value='$Lang::tr{'send test mail'}' $btnTestmailDisabled />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr />
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td align='left' class='base' nowrap='nowrap' width='2%'>
|
||||
<img src='/blob.gif' alt ='*' align='top' />
|
||||
<font class='base'>$Lang::tr{'this field may be blank'}</font>
|
||||
</td>
|
||||
<td align='center' class='base' width='48%'>
|
||||
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
|
||||
END
|
||||
|
||||
# if user input cause an error
|
||||
# and user want a reset, we re-read settings from settingsfile
|
||||
if ($errormessage ne '') {
|
||||
print "<input type='submit' name='ACTION' value='$Lang::tr{'reset'}' />";
|
||||
}
|
||||
else {
|
||||
print "<input type='reset' name='ACTION' value='$Lang::tr{'reset'}' />";
|
||||
}
|
||||
|
||||
print <<END;
|
||||
</td>
|
||||
<td align='left' class='base' nowrap='nowrap' width='50%'> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<hr />
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td align='left' class='base' width='2%'>
|
||||
|
||||
</td>
|
||||
<td align='left' class='base' width='98%'>
|
||||
<form method='post' action='/cgi-bin/traffic.cgi'>
|
||||
<input type='submit' name='ACTION' value='$Lang::tr{'traffic back'}' />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
END
|
||||
|
||||
&Header::closebox();
|
||||
&Header::closebigbox();
|
||||
&Header::closepage();
|
||||
|
||||
|
||||
sub validSave
|
||||
{
|
||||
if ($cgiparams{'SHOW_AT_HOME'} ne 'on' ) {
|
||||
$cgiparams{'SHOW_AT_HOME'} = 'off';
|
||||
}
|
||||
|
||||
if ($cgiparams{'MONTHLY_VOLUME_ON'} ne 'on' ) {
|
||||
$cgiparams{'MONTHLY_VOLUME_ON'} = 'off';
|
||||
}
|
||||
|
||||
if($cgiparams{'MONTHLY_VOLUME_ON'} eq 'on')
|
||||
{
|
||||
if($cgiparams{'MONTHLY_VOLUME'} !~ /^\d+$/ || $cgiparams{'MONTHLY_VOLUME'} < 1) {
|
||||
$errormessage .= "$Lang::tr{'monthly traffic bad'}<br/>";
|
||||
}
|
||||
|
||||
if($cgiparams{'STARTDAY'} < 1 || 31 < $cgiparams{'STARTDAY'}) {
|
||||
$errormessage .= "$Lang::tr{'monthly start day bad'}<br/>";
|
||||
}
|
||||
|
||||
if ($cgiparams{'WARN_ON'} ne 'on' ) {
|
||||
$cgiparams{'WARN_ON'} = 'off';
|
||||
}
|
||||
|
||||
if($cgiparams{'WARN_ON'} eq 'on' && $cgiparams{'WARN'} !~ /^\d+$/) {
|
||||
$errormessage .= "$Lang::tr{'traffic warn level bad'}<br/>";
|
||||
}
|
||||
|
||||
if($cgiparams{'CALC_INTERVAL'} < 5 || 60 < $cgiparams{'CALC_INTERVAL'}) {
|
||||
$errormessage .= "$Lang::tr{'traffic calc time bad'}<br/>";
|
||||
}
|
||||
|
||||
if ($cgiparams{'SEND_EMAIL_ON'} ne 'on' ) {
|
||||
$cgiparams{'SEND_EMAIL_ON'} = 'off';
|
||||
}
|
||||
|
||||
if($cgiparams{'SEND_EMAIL_ON'} eq 'on' )
|
||||
{
|
||||
if($cgiparams{'EMAIL_TO'} eq '' || (! &General::validemail($cgiparams{'EMAIL_TO'})) ) {
|
||||
$errormessage .= "$Lang::tr{'to warn email bad'}<br/>";
|
||||
}
|
||||
|
||||
if($cgiparams{'EMAIL_FROM'} eq '' || (! &General::validemail($cgiparams{'EMAIL_FROM'}))) {
|
||||
$errormessage .= "$Lang::tr{'from warn email bad'}<br/>";
|
||||
}
|
||||
|
||||
if($cgiparams{'EMAIL_SERVER'} eq '') {
|
||||
$errormessage .= "$Lang::tr{'email server can not be empty'}<br/>";
|
||||
}
|
||||
}
|
||||
} # monthly volumne == on
|
||||
|
||||
if ($cgiparams{'VERSION_CHECK_ON'} ne 'on' ) {
|
||||
$cgiparams{'VERSION_CHECK_ON'} = 'off';
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,12 @@
|
||||
#
|
||||
# (c) The SmoothWall Team
|
||||
#
|
||||
# $Id: traffics.cgi,v 1.12 2006/11/15 21:14:02 dotzball Exp $
|
||||
#
|
||||
# traffics.cgi, v1.1.0 2003/10/18
|
||||
# supports now:
|
||||
# * IPCop v1.3.0
|
||||
# * choosing year
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -16,94 +22,89 @@ use CGI::Carp 'fatalsToBrowser';
|
||||
require '/var/ipfire/general-functions.pl';
|
||||
require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
require '/var/ipfire/net-traffic/net-traffic-lib.pl';
|
||||
require "${General::swroot}/net-traffic/net-traffic-admin.pl";
|
||||
require "${General::swroot}/net-traffic/net-traffic-lib.pl";
|
||||
|
||||
my %color = ();
|
||||
my %mainsettings = ();
|
||||
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
|
||||
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
|
||||
|
||||
my %cgiparams;
|
||||
my %cgiparams;
|
||||
my %netsettings;
|
||||
|
||||
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
|
||||
|
||||
my @years=("2007","2008","2009","2010","2011","2012","2013","2014","2015");
|
||||
|
||||
my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
|
||||
$Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
|
||||
$Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
|
||||
$Lang::tr{'december'} );
|
||||
|
||||
my @months = ( 0,1,2,3,4,5,6,7,8,9,10,11 );
|
||||
my @days = ( 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 );
|
||||
|
||||
my @now = localtime(time);
|
||||
my @now = localtime(time);
|
||||
|
||||
$now[5] = $now[5]+1900;
|
||||
|
||||
$cgiparams{'STARTDAY'} = 10;
|
||||
$cgiparams{'STOPDAY'} = 11;
|
||||
$cgiparams{'STARTYEAR'} = $now[5];
|
||||
$cgiparams{'STOPYEAR'} = $now[5];
|
||||
$cgiparams{'STARTDAY'} = 10;
|
||||
$cgiparams{'STOPDAY'} = 11;
|
||||
$cgiparams{'STARTYEAR'} = $now[5];
|
||||
$cgiparams{'STOPYEAR'} = $now[5];
|
||||
|
||||
if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on')
|
||||
{
|
||||
$cgiparams{'STARTDAY'} = $NETTRAFF::settings{'STARTDAY'};
|
||||
$cgiparams{'STOPDAY'} = $NETTRAFF::settings{'STARTDAY'};
|
||||
}
|
||||
|
||||
# this periode started last month
|
||||
if ($now[3] < 10) {
|
||||
if ($now[3] < $cgiparams{'STARTDAY'}) {
|
||||
$cgiparams{'STARTMONTH'} = $now[4]-1;
|
||||
$cgiparams{'STOPMONTH'} = $now[4];
|
||||
# when current month is january we start in last year december
|
||||
if ($now[4] == 0) {
|
||||
if ($cgiparams{'STOPMONTH'} == 0) {
|
||||
$cgiparams{'STARTYEAR'} = $now[5]-1;
|
||||
$cgiparams{'STARTMONTH'} = 11;
|
||||
$cgiparams{'STARTMONTH'} = 11;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$cgiparams{'STARTMONTH'} = $now[4];
|
||||
$cgiparams{'STOPMONTH'} = $now[4]+1;
|
||||
# when we are december, this periode ends next year january
|
||||
if ($now[4] == 11) {
|
||||
$cgiparams{'STOPYEAR'} = $now[5]+1;
|
||||
# when we are in december, this periode ends next year january
|
||||
if ($cgiparams{'STARTMONTH'} == 11) {
|
||||
$cgiparams{'STOPYEAR'} = $now[5]+1;
|
||||
$cgiparams{'STOPMONTH'} = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&Header::getcgihash(\%cgiparams);
|
||||
|
||||
&Header::showhttpheaders();
|
||||
|
||||
&Header::openpage($Lang::tr{'sstraffic'}, 1, '');
|
||||
|
||||
&Header::openbigbox('100%', 'left');
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'settings'});
|
||||
&Header::openbox('100%', 'left', "");
|
||||
|
||||
print <<END;
|
||||
<table width='100%' align='center'>
|
||||
<tr>
|
||||
<td width='95%' class='base' align='center'>
|
||||
<td width='90%' class='base' align='center'>
|
||||
<form method='post' action='/cgi-bin/traffics.cgi'>
|
||||
$Lang::tr{'trafficfrom'}
|
||||
<select name='STARTDAY'>
|
||||
END
|
||||
|
||||
foreach (@days)
|
||||
foreach my $day (@days)
|
||||
{
|
||||
print "\t<option ";
|
||||
if ($_ == $cgiparams{'STARTDAY'}) {
|
||||
if ($day == $cgiparams{'STARTDAY'}) {
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$_'>$_</option>\n";
|
||||
print "value='$day'>$day</option>\n";
|
||||
}
|
||||
print <<END;
|
||||
</select>
|
||||
<select name='STARTMONTH'>
|
||||
END
|
||||
|
||||
foreach (@months)
|
||||
foreach my $month (@NETTRAFF::months)
|
||||
{
|
||||
print "\t<option ";
|
||||
if ($_ == $cgiparams{'STARTMONTH'}) {
|
||||
if ($month == $cgiparams{'STARTMONTH'}) {
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$_'>$longmonths[$_]</option>\n";
|
||||
print "value='$month'>$NETTRAFF::longmonths[$month]</option>\n";
|
||||
}
|
||||
|
||||
print <<END;
|
||||
@@ -111,11 +112,11 @@ print <<END;
|
||||
<select name='STARTYEAR'>
|
||||
END
|
||||
|
||||
for (my $index=0; $index<=$#years; $index++) {
|
||||
foreach my $year (@NETTRAFF::years) {
|
||||
print "\t<option ";
|
||||
if ($years[$index] == $cgiparams{'STARTYEAR'}) {
|
||||
if ($year == $cgiparams{'STARTYEAR'}) {
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$years[$index]'>$years[$index]</option>\n";
|
||||
print "value='$year'>$year</option>\n";
|
||||
}
|
||||
|
||||
print <<END;
|
||||
@@ -124,13 +125,13 @@ print <<END;
|
||||
<select name='STOPDAY'>
|
||||
END
|
||||
|
||||
foreach (@days)
|
||||
foreach my $day (@days)
|
||||
{
|
||||
print "\t<option ";
|
||||
if ($_ == $cgiparams{'STOPDAY'})
|
||||
if ($day == $cgiparams{'STOPDAY'})
|
||||
{
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$_'>$_</option>\n";
|
||||
print "value='$day'>$day</option>\n";
|
||||
}
|
||||
|
||||
print <<END;
|
||||
@@ -138,12 +139,12 @@ print <<END;
|
||||
<select name='STOPMONTH'>
|
||||
END
|
||||
|
||||
foreach (@months)
|
||||
foreach my $month (@NETTRAFF::months)
|
||||
{
|
||||
print "\t<option ";
|
||||
if ($_ == $cgiparams{'STOPMONTH'}) {
|
||||
if ($month == $cgiparams{'STOPMONTH'}) {
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$_'>$longmonths[$_]</option>\n";
|
||||
print "value='$month'>$NETTRAFF::longmonths[$month]</option>\n";
|
||||
}
|
||||
|
||||
print <<END;
|
||||
@@ -151,31 +152,31 @@ print <<END;
|
||||
<select name='STOPYEAR'>
|
||||
END
|
||||
|
||||
for (my $index = 0; $index <=$#years; $index++) {
|
||||
foreach my $year (@NETTRAFF::years) {
|
||||
print "\t<option ";
|
||||
if ($years[$index] == $cgiparams{'STOPYEAR'}) {
|
||||
if ($year == $cgiparams{'STOPYEAR'}) {
|
||||
print 'selected=\'selected\' '; }
|
||||
print "value='$years[$index]'>$years[$index]</option>\n";
|
||||
print "value='$year'>$year</option>\n";
|
||||
}
|
||||
|
||||
|
||||
print <<END;
|
||||
</select>
|
||||
<input type='submit' name='ACTION' value='$Lang::tr{'update'}' />
|
||||
</form>
|
||||
</td>
|
||||
</form>
|
||||
</td>
|
||||
<td width='5%' align='center'>
|
||||
<form method='post' action='/cgi-bin/traffic.cgi'>
|
||||
<input type='submit' name='ACTION' value=' > ' />
|
||||
</form>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
END
|
||||
|
||||
&Header::closebox();
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'traffics'});
|
||||
&Header::openbox('100%', 'left', "$Lang::tr{'traffics'}");
|
||||
|
||||
my $dateWidth = '20%';
|
||||
my $netWidth = '34%';
|
||||
@@ -209,38 +210,37 @@ if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/) {
|
||||
print "<td width='$netWidth' align='center' class='boldbase' ><b>$Lang::tr{'trafficorange'}</b></td>";
|
||||
}
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/) {
|
||||
print "<td width='$netWidth' align='center' class='boldbase'><b>$Lang::tr{'trafficred'}</b></td>";
|
||||
}
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
print "<td width='$netWidth' align='center' class='boldbase'><b>$Lang::tr{'trafficred'}</b></td>";
|
||||
}
|
||||
print <<END;
|
||||
<td width='$netWidth' align='center' class='boldbase'><b>$Lang::tr{'trafficred'}</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td width='$dateWidth' align='center' class='boldbase'><b>$Lang::tr{'trafficdate'}</b></td>
|
||||
<td width='$inOutWidth' align='center' class='boldbase'><font color='#16A61D'><b>$Lang::tr{'trafficin'}</b></font></td>
|
||||
<td width='$inOutWidth' align='center' class='boldbase'><font color='#16A61D'><b>$Lang::tr{'trafficout'}</b></font></td>
|
||||
<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourgreen'><b>$Lang::tr{'trafficin'}</b></font></td>
|
||||
<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourgreen'><b>$Lang::tr{'trafficout'}</b></font></td>
|
||||
END
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
|
||||
{
|
||||
{
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='${Header::colourblue}'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='${Header::colourblue}'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
|
||||
{
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#FF9933'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#FF9933'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
}
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#CE1B31'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#CE1B31'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
{
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourorange'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourorange'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
}
|
||||
print"</tr>";
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficin'}</b></font></td>";
|
||||
print "<td width='$inOutWidth' align='center' class='boldbase'><font color='$Header::colourred'><b>$Lang::tr{'trafficout'}</b></font></td>";
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
my $total_blue_in=0;
|
||||
my $total_blue_out=0;
|
||||
@@ -279,49 +279,49 @@ my @allDays = &Traffic::calcTraffic(\%allDaysBytes,$start,$end, $displayMode);
|
||||
foreach (@allDays) {
|
||||
$total_green_in += $allDaysBytes{$_}{${Traffic::green_in}};
|
||||
$total_green_out += $allDaysBytes{$_}{${Traffic::green_out}};
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
|
||||
{
|
||||
$total_blue_in += $allDaysBytes{$_}{${Traffic::blue_in}};
|
||||
$total_blue_out += $allDaysBytes{$_}{${Traffic::blue_out}};
|
||||
}
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
|
||||
{
|
||||
$total_orange_in += $allDaysBytes{$_}{${Traffic::orange_in}};
|
||||
$total_orange_out += $allDaysBytes{$_}{${Traffic::orange_out}};
|
||||
}
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
$total_red_in += $allDaysBytes{$_}{${Traffic::red_in}};
|
||||
$total_red_out += $allDaysBytes{$_}{${Traffic::red_out}};
|
||||
}
|
||||
|
||||
|
||||
if ($lines % 2) {
|
||||
print "<tr bgcolor='$color{'color20'}'>"; }
|
||||
else {
|
||||
print "<tr bgcolor='$color{'color22'}'>"; }
|
||||
|
||||
|
||||
printf "<td align='center' nowrap='nowrap'>%s</td>\n", $allDaysBytes{$_}{'Day'};
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::green_in}}/1048576);
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::green_out}}/1048576);
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
|
||||
{
|
||||
{
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::blue_in}}/1048576);
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::blue_out}}/1048576);
|
||||
}
|
||||
}
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
|
||||
{
|
||||
{
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::orange_in}}/1048576);
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::orange_out}}/1048576);
|
||||
}
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
}
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::red_in}}/1048576);
|
||||
printf "<td align='center' nowrap='nowrap'>%.3f</td></tr>\n", ($allDaysBytes{$_}{${Traffic::red_out}}/1048576);
|
||||
}
|
||||
}
|
||||
$lines++;
|
||||
}
|
||||
|
||||
@@ -330,42 +330,38 @@ $total_green_out=sprintf("%.2f", ($total_green_out/1048576));
|
||||
$total_blue_in=sprintf("%.2f", ($total_blue_in/1048576));
|
||||
$total_blue_out=sprintf("%.2f", ($total_blue_out/1048576));
|
||||
$total_orange_in=sprintf("%.2f", ($total_orange_in/1048576));
|
||||
$total_orange_out=sprintf("%.2f", ($total_orange_out/1048576));
|
||||
$total_orange_out=sprintf("%.2f", ($total_orange_out/1048576));
|
||||
$total_red_in=sprintf("%.2f", ($total_red_in/1048576));
|
||||
$total_red_out=sprintf("%.2f", ($total_red_out/1048576));
|
||||
|
||||
if ($lines % 2) {print "<tr bgcolor='$color{'color20'}'>"; }
|
||||
|
||||
if ($lines % 2) {print "<tr bgcolor='$color{'color22'}'>"; }
|
||||
else {print "<tr bgcolor='$color{'color22'}'>"; }
|
||||
|
||||
|
||||
print <<END;
|
||||
<td align='center' class='boldbase' height='20' nowrap='nowrap'><b>$Lang::tr{'trafficsum'}</b></td>
|
||||
<td align='center' class='boldbase' nowrap='nowrap'><b>$total_green_in MB</b></td>
|
||||
<td align='center' class='boldbase' nowrap='nowrap'><b>$total_green_out MB</b></td>
|
||||
END
|
||||
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
|
||||
{
|
||||
{
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_blue_in MB</b></td>";
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_blue_out MB</b></td>";
|
||||
}
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
|
||||
{
|
||||
{
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_orange_in MB</b></td>";
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_orange_out MB</b></td>";
|
||||
}
|
||||
|
||||
if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
|
||||
{
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_in MB</b></td>";
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_out MB</b></td>";
|
||||
}
|
||||
print <<END;
|
||||
</tr>
|
||||
</table>
|
||||
END
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_in MB</b></td>";
|
||||
print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_out MB</b></td>";
|
||||
}
|
||||
print "</tr></table>";
|
||||
|
||||
&Header::closebox();
|
||||
|
||||
&Header::closebigbox();
|
||||
|
||||
&Header::closepage();
|
||||
|
||||
Reference in New Issue
Block a user