PNG generation has been moved to getrrdimage.cgi
Signed-off-by: Leo-Andres Hofmann hofmann@leo-andres.de --- html/cgi-bin/entropy.cgi | 11 ----------- html/cgi-bin/hardwaregraphs.cgi | 32 -------------------------------- html/cgi-bin/media.cgi | 11 ----------- html/cgi-bin/memory.cgi | 14 -------------- html/cgi-bin/netexternal.cgi | 11 ----------- html/cgi-bin/netinternal.cgi | 17 ----------------- html/cgi-bin/netother.cgi | 19 ------------------- html/cgi-bin/netovpnrw.cgi | 10 ---------- html/cgi-bin/netovpnsrv.cgi | 14 -------------- html/cgi-bin/qos.cgi | 11 ----------- html/cgi-bin/system.cgi | 18 ------------------ 11 files changed, 168 deletions(-)
diff --git a/html/cgi-bin/entropy.cgi b/html/cgi-bin/entropy.cgi index f8045db5a..6cfcadd1c 100644 --- a/html/cgi-bin/entropy.cgi +++ b/html/cgi-bin/entropy.cgi @@ -30,16 +30,6 @@ require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; require "${General::swroot}/graphs.pl";
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'hour' unless defined $querry[1]; - -if ( $querry[0] ne~ "") { - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updateentropygraph($querry[1]); - -} else { &Header::showhttpheaders(); &Header::openpage($Lang::tr{'entropy'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -86,7 +76,6 @@ EOF
&Header::closebigbox(); &Header::closepage(); -}
sub has_rdrand() { open(FILE, "/proc/cpuinfo") or return 0; diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index e8f0fa362..be45a8c99 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -90,35 +90,6 @@ if (@thermal_zone_sensors) { } }
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'hour' unless defined $querry[1]; - -if ( $querry[0] =~ "hwtemp"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatehwtempgraph($querry[1]); -}elsif ( $querry[0] =~ "hwfan"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatehwfangraph($querry[1]); -}elsif ( $querry[0] =~ "hwvolt"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatehwvoltgraph($querry[1]); -}elsif ( $querry[0] =~ "thermaltemp"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatethermaltempgraph($querry[1]); -}elsif ( $querry[0] =~ "sd?" ){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatehddgraph($querry[0],$querry[1]); -}elsif ( $querry[0] =~ "nvme?" ){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatehddgraph($querry[0],$querry[1]); -}else{ &Header::showhttpheaders(); &Header::openpage($Lang::tr{'hardware graphs'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -184,9 +155,6 @@ if ( $querry[0] =~ "hwtemp"){ &Header::closebigbox(); &Header::closepage();
-} - - sub sensorsbox { &Header::openbox('100%', 'center', "$Lang::tr{'mbmon settings'}");
diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi index f574729ed..835565811 100644 --- a/html/cgi-bin/media.cgi +++ b/html/cgi-bin/media.cgi @@ -41,18 +41,8 @@ undef (@dummy);
my %cgiparams=();
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'hour' unless defined $querry[1]; - my @devices = `ls -1 /sys/block | grep -E '^sd|^mmcblk|^nvme|^xvd|^vd|^md' | sort | uniq`;
-if ( $querry[0] =~ "sd?" || $querry[0] =~ "mmcblk?" || $querry[0] =~ "nvme?n?" || $querry[0] =~ "xvd??" || $querry[0] =~ "vd?" || $querry[0] =~ "md*" ){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - - &Graphs::updatediskgraph($querry[0],$querry[1]); -}else{ &Header::showhttpheaders(); &Header::openpage($Lang::tr{'media information'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -162,7 +152,6 @@ END
&Header::closebigbox(); &Header::closepage(); -}
sub percentbar { diff --git a/html/cgi-bin/memory.cgi b/html/cgi-bin/memory.cgi index 441b1d4e7..037d5800b 100644 --- a/html/cgi-bin/memory.cgi +++ b/html/cgi-bin/memory.cgi @@ -35,19 +35,6 @@ my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", %mainsettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", %color);
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'hour' unless defined $querry[1]; - -if ( $querry[0] =~ "memory"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatememorygraph($querry[1]); -}elsif ( $querry[0] =~ "swap"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updateswapgraph($querry[1]); -}else{ &Header::showhttpheaders(); &Header::openpage($Lang::tr{'memory information'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -139,7 +126,6 @@ END
&Header::closebigbox(); &Header::closepage(); -}
sub percentbar{ my $percent = $_[0]; diff --git a/html/cgi-bin/netexternal.cgi b/html/cgi-bin/netexternal.cgi index 1e3760c2b..704cd8727 100644 --- a/html/cgi-bin/netexternal.cgi +++ b/html/cgi-bin/netexternal.cgi @@ -43,16 +43,6 @@ my %netsettings=(); my @graphs=(); my %dhcpinfo=();
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'hour' unless defined $querry[1]; - -if ( $querry[0] ne~ ""){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updateifgraph($querry[0],$querry[1]); -}else{ - &Header::showhttpheaders(); &Header::openpage($Lang::tr{'network traffic graphs external'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -163,4 +153,3 @@ END
&Header::closebigbox(); &Header::closepage(); -} diff --git a/html/cgi-bin/netinternal.cgi b/html/cgi-bin/netinternal.cgi index 3c2828fbf..8d7105e36 100644 --- a/html/cgi-bin/netinternal.cgi +++ b/html/cgi-bin/netinternal.cgi @@ -40,22 +40,6 @@ my %netsettings=(); my @graphs=(); my @wireless=();
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'hour' unless defined $querry[1]; -$querry[2] = '' unless defined $querry[2]; - -if ( $querry[0] =~ /wireless/ ){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - $querry[0] =~ s/wireless//g; - &Graphs::updatewirelessgraph($querry[0],$querry[1]); -}elsif ( $querry[0] ne "" ){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updateifgraph($querry[0],$querry[1]); -}else{ - &Header::showhttpheaders(); &Header::openpage($Lang::tr{'network traffic graphs internal'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -84,4 +68,3 @@ if ( $querry[0] =~ /wireless/ ){
&Header::closebigbox(); &Header::closepage(); -} diff --git a/html/cgi-bin/netother.cgi b/html/cgi-bin/netother.cgi index cbd2bc228..c1d6a64a0 100755 --- a/html/cgi-bin/netother.cgi +++ b/html/cgi-bin/netother.cgi @@ -37,24 +37,6 @@ my %mainsettings = ();
my @pings=();
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'hour' unless defined $querry[1]; - -if ( $querry[0] eq "conntrack") { - print "Content-Type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updateconntrackgraph($querry[1]); -} elsif ( $querry[0] =~ "fwhits"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatefwhitsgraph($querry[1]); -}elsif ( $querry[0] ne ""){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatepinggraph($querry[0],$querry[1]); -}else{ - &Header::showhttpheaders(); &Header::openpage($Lang::tr{'network traffic graphs others'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -103,4 +85,3 @@ if ( $querry[0] eq "conntrack") {
&Header::closebigbox(); &Header::closepage(); -} diff --git a/html/cgi-bin/netovpnrw.cgi b/html/cgi-bin/netovpnrw.cgi index 00ef35337..fc2e43508 100755 --- a/html/cgi-bin/netovpnrw.cgi +++ b/html/cgi-bin/netovpnrw.cgi @@ -37,15 +37,6 @@ my %mainsettings = ();
my @vpns=();
-my @querry = split(/?/,uri_unescape($ENV{'QUERY_STRING'})); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'week' unless defined $querry[1]; - -if ( $querry[0] ne "" && $querry[0] ne "UNDEF"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatevpngraph($querry[0],$querry[1]); -}else{ &Header::showhttpheaders(); &Header::openpage($Lang::tr{'vpn statistic rw'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -69,4 +60,3 @@ if ( $querry[0] ne "" && $querry[0] ne "UNDEF"){
&Header::closebigbox(); &Header::closepage(); -} diff --git a/html/cgi-bin/netovpnsrv.cgi b/html/cgi-bin/netovpnsrv.cgi index a53090f0f..6ff6e17fe 100755 --- a/html/cgi-bin/netovpnsrv.cgi +++ b/html/cgi-bin/netovpnsrv.cgi @@ -49,19 +49,6 @@ foreach my $key (sort {$vpnsettings{$a}[1] <=> $vpnsettings{$b}[1]} keys %vpnset $ipsecgraphs{$vpnsettings{$key}[1]} = "${interface_mode}${key}"; }
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'week' unless defined $querry[1]; - -if ( $querry[0] ne ""){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - if (grep { $_ eq $querry[0] } values %ipsecgraphs) { - &Graphs::updateifgraph($querry[0],$querry[1]); - } else { - &Graphs::updatevpnn2ngraph($querry[0],$querry[1]); - } -}else{ &Header::showhttpheaders(); &Header::openpage($Lang::tr{'vpn statistic n2n'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -91,4 +78,3 @@ if ( $querry[0] ne ""){
&Header::closebigbox(); &Header::closepage(); -} diff --git a/html/cgi-bin/qos.cgi b/html/cgi-bin/qos.cgi index fa566b523..3410c7353 100644 --- a/html/cgi-bin/qos.cgi +++ b/html/cgi-bin/qos.cgi @@ -111,15 +111,6 @@ my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", %mainsettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", %color);
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'hour' unless defined $querry[1]; - -if ( $querry[0] ne ""){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updateqosgraph($querry[0],$querry[1]); -}else{ &Header::showhttpheaders();
&Header::openpage('QoS', 1, ''); @@ -721,8 +712,6 @@ if ( ($qossettings{'DEFCLASS_INC'} eq '') || ($qossettings{'DEFCLASS_OUT'} eq '' &Header::closebigbox(); &Header::closepage();
-} - ############################################################################################################################ ############################################################################################################################
diff --git a/html/cgi-bin/system.cgi b/html/cgi-bin/system.cgi index 67c479736..595ca0eab 100644 --- a/html/cgi-bin/system.cgi +++ b/html/cgi-bin/system.cgi @@ -35,23 +35,6 @@ my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", %mainsettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", %color);
-my @querry = split(/?/,$ENV{'QUERY_STRING'}); -$querry[0] = '' unless defined $querry[0]; -$querry[1] = 'hour' unless defined $querry[1]; - -if ( $querry[0] =~ "cpufreq"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatecpufreqgraph($querry[1]); -}elsif ( $querry[0] =~ "cpu"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updatecpugraph($querry[1]); -}elsif ( $querry[0] =~ "load"){ - print "Content-type: image/png\n\n"; - binmode(STDOUT); - &Graphs::updateloadgraph($querry[1]); -}else{ &Header::showhttpheaders(); &Header::openpage($Lang::tr{'status information'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -72,4 +55,3 @@ if ( $querry[0] =~ "cpufreq"){
&Header::closebigbox(); &Header::closepage(); -}
Signed-off-by: Leo-Andres Hofmann hofmann@leo-andres.de --- html/cgi-bin/entropy.cgi | 76 ++++++------- html/cgi-bin/hardwaregraphs.cgi | 110 +++++++++---------- html/cgi-bin/media.cgi | 158 +++++++++++++-------------- html/cgi-bin/memory.cgi | 122 ++++++++++----------- html/cgi-bin/netexternal.cgi | 184 ++++++++++++++++---------------- html/cgi-bin/netinternal.cgi | 46 ++++---- html/cgi-bin/netother.cgi | 76 ++++++------- html/cgi-bin/netovpnrw.cgi | 38 +++---- html/cgi-bin/netovpnsrv.cgi | 48 ++++----- html/cgi-bin/qos.cgi | 18 ++-- html/cgi-bin/system.cgi | 32 +++--- 11 files changed, 454 insertions(+), 454 deletions(-)
diff --git a/html/cgi-bin/entropy.cgi b/html/cgi-bin/entropy.cgi index 6cfcadd1c..0a27d2329 100644 --- a/html/cgi-bin/entropy.cgi +++ b/html/cgi-bin/entropy.cgi @@ -30,52 +30,52 @@ require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; require "${General::swroot}/graphs.pl";
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'entropy'}, 1, ''); - &Header::openbigbox('100%', 'left'); +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'entropy'}, 1, ''); +&Header::openbigbox('100%', 'left');
- &Header::openbox('100%', 'center', $Lang::tr{'entropy'}); - &Graphs::makegraphbox("entropy.cgi", "entropy", "day"); - &Header::closebox(); +&Header::openbox('100%', 'center', $Lang::tr{'entropy'}); +&Graphs::makegraphbox("entropy.cgi", "entropy", "day"); +&Header::closebox();
- # Check for hardware support. - my $message; - my $message_colour = $Header::colourred; - if (&has_rdrand()) { - $message = $Lang::tr{'system has rdrand'}; - $message_colour = $Header::colourgreen; - } +# Check for hardware support. +my $message; +my $message_colour = $Header::colourred; +if (&has_rdrand()) { + $message = $Lang::tr{'system has rdrand'}; + $message_colour = $Header::colourgreen; +}
- my $rngd_status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>"; - if (&rngd_is_running()) { - $rngd_status = "<td align='center' bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>"; - } +my $rngd_status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>"; +if (&rngd_is_running()) { + $rngd_status = "<td align='center' bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>"; +}
- &Header::openbox('100%', 'center', $Lang::tr{'hardware support'}); - if ($message) { - print <<EOF; - <p style="color: $message_colour; text-align: center;">$message</p> +&Header::openbox('100%', 'center', $Lang::tr{'hardware support'}); +if ($message) { + print <<EOF; + <p style="color: $message_colour; text-align: center;">$message</p> EOF - } +}
- print <<EOF; - <table width='80%' cellspacing='1' class='tbl'> - <tr> - <th align='center'><b>$Lang::tr{'service'}</b></th> - <th align='center'><b>$Lang::tr{'status'}</b></th> - </tr> - <tr> - <td align='center'> - $Lang::tr{'random number generator daemon'} - </td> - $rngd_status - </tr> - </table> +print <<EOF; + <table width='80%' cellspacing='1' class='tbl'> + <tr> + <th align='center'><b>$Lang::tr{'service'}</b></th> + <th align='center'><b>$Lang::tr{'status'}</b></th> + </tr> + <tr> + <td align='center'> + $Lang::tr{'random number generator daemon'} + </td> + $rngd_status + </tr> + </table> EOF - &Header::closebox(); +&Header::closebox();
- &Header::closebigbox(); - &Header::closepage(); +&Header::closebigbox(); +&Header::closepage();
sub has_rdrand() { open(FILE, "/proc/cpuinfo") or return 0; diff --git a/html/cgi-bin/hardwaregraphs.cgi b/html/cgi-bin/hardwaregraphs.cgi index be45a8c99..9e3fe60d5 100644 --- a/html/cgi-bin/hardwaregraphs.cgi +++ b/html/cgi-bin/hardwaregraphs.cgi @@ -90,70 +90,70 @@ if (@thermal_zone_sensors) { } }
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'hardware graphs'}, 1, ''); - &Header::openbigbox('100%', 'left'); - - &Header::getcgihash(%sensorsettings); - - if ( $sensorsettings{'ACTION'} eq $Lang::tr{'save'} ) { - foreach(@sensorsgraphs){ - chomp($_); - $_ =~ //(.*)sensors-(.*)/(.*).rrd/; - my $label = $2.$3;$label=~ s/-//g; - if ( $sensorsettings{'LINE-'.$label} ne "on" ){ - $sensorsettings{'LINE-'.$label} = 'off'; - } elsif ($sensorsettings{'LINE-'.$label} eq "on" ){ - $sensorsettings{'LINE-'.$label} = 'checked'; - } - $sensorsettings{'LABEL-'.$label} =~ s/\W//g; - } - &General::writehash("${General::swroot}/sensors/settings", %sensorsettings); +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'hardware graphs'}, 1, ''); +&Header::openbigbox('100%', 'left'); + +&Header::getcgihash(%sensorsettings); + +if ( $sensorsettings{'ACTION'} eq $Lang::tr{'save'} ) { + foreach(@sensorsgraphs){ + chomp($_); + $_ =~ //(.*)sensors-(.*)/(.*).rrd/; + my $label = $2.$3;$label=~ s/-//g; + if ( $sensorsettings{'LINE-'.$label} ne "on" ){ + $sensorsettings{'LINE-'.$label} = 'off'; + } elsif ($sensorsettings{'LINE-'.$label} eq "on" ){ + $sensorsettings{'LINE-'.$label} = 'checked'; + } + $sensorsettings{'LABEL-'.$label} =~ s/\W//g; } + &General::writehash("${General::swroot}/sensors/settings", %sensorsettings); +}
- # This should be save, because no user given content will be processed. - #my @disks = `ls -1 /sys/block | grep -E '^sd|^nvme' | sort | uniq`; - my @disks = &get_disks(); +# This should be save, because no user given content will be processed. +#my @disks = `ls -1 /sys/block | grep -E '^sd|^nvme' | sort | uniq`; +my @disks = &get_disks();
- foreach (@disks){ - my $disk = $_; - chomp $disk; - my @array = split(///,$disk); +foreach (@disks){ + my $disk = $_; + chomp $disk; + my @array = split(///,$disk);
- &Header::openbox('100%', 'center', "$array[$#array] $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi",$array[$#array],"day"); - &Header::closebox(); - } + &Header::openbox('100%', 'center', "$array[$#array] $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi",$array[$#array],"day"); + &Header::closebox(); +}
- if ( grep(/thermal-thermal_zone/, @sensorsgraphs) ) { - &Header::openbox('100%', 'center', "ACPI Thermal-Zone Temp $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","thermaltemp","day"); - &Header::closebox(); - } +if ( grep(/thermal-thermal_zone/, @sensorsgraphs) ) { + &Header::openbox('100%', 'center', "ACPI Thermal-Zone Temp $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","thermaltemp","day"); + &Header::closebox(); +}
- if ( grep(/temperature-/, @sensorsgraphs) ) { - &Header::openbox('100%', 'center', "hwtemp $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day"); - Header::closebox(); - } +if ( grep(/temperature-/, @sensorsgraphs) ) { + &Header::openbox('100%', 'center', "hwtemp $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day"); + Header::closebox(); +}
- if ( grep(/fanspeed-/, @sensorsgraphs) ) { - &Header::openbox('100%', 'center', "hwfan $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","hwfan","day"); - &Header::closebox(); - } +if ( grep(/fanspeed-/, @sensorsgraphs) ) { + &Header::openbox('100%', 'center', "hwfan $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","hwfan","day"); + &Header::closebox(); +}
- if ( grep(/voltage-/, @sensorsgraphs) ) { - &Header::openbox('100%', 'center', "hwvolt $Lang::tr{'graph'}"); - &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day"); - &Header::closebox(); - } +if ( grep(/voltage-/, @sensorsgraphs) ) { + &Header::openbox('100%', 'center', "hwvolt $Lang::tr{'graph'}"); + &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day"); + &Header::closebox(); +}
- if ( @sensorsgraphs ) { - sensorsbox(); - } - &Header::closebigbox(); - &Header::closepage(); +if ( @sensorsgraphs ) { + sensorsbox(); +} +&Header::closebigbox(); +&Header::closepage();
sub sensorsbox { &Header::openbox('100%', 'center', "$Lang::tr{'mbmon settings'}"); diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi index 835565811..cc8f84d0a 100644 --- a/html/cgi-bin/media.cgi +++ b/html/cgi-bin/media.cgi @@ -43,115 +43,115 @@ my %cgiparams=();
my @devices = `ls -1 /sys/block | grep -E '^sd|^mmcblk|^nvme|^xvd|^vd|^md' | sort | uniq`;
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'media information'}, 1, ''); - &Header::openbigbox('100%', 'left'); - - foreach (@devices) { - my $device = $_; - chomp($device); - my @array = split(///,$device); - &Header::openbox('100%', 'center', "$array[$#array] $Lang::tr{'graph'}"); - diskbox($array[$#array]); - &Graphs::makegraphbox("media.cgi",$array[$#array],"day"); - &Header::closebox(); - } +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'media information'}, 1, ''); +&Header::openbigbox('100%', 'left'); + +foreach (@devices) { + my $device = $_; + chomp($device); + my @array = split(///,$device); + &Header::openbox('100%', 'center', "$array[$#array] $Lang::tr{'graph'}"); + diskbox($array[$#array]); + &Graphs::makegraphbox("media.cgi",$array[$#array],"day"); + &Header::closebox(); +} +
- - &Header::openbox('100%', 'center', $Lang::tr{'disk usage'}); - print "<table width='95%' cellspacing='5'>\n"; - open(DF,'/bin/df -P -B M -x rootfs|'); - while(<DF>){ - if ($_ =~ m/^Filesystem/ ){ - print <<END +&Header::openbox('100%', 'center', $Lang::tr{'disk usage'}); +print "<table width='95%' cellspacing='5'>\n"; +open(DF,'/bin/df -P -B M -x rootfs|'); +while(<DF>){ + if ($_ =~ m/^Filesystem/ ){ + print <<END <tr> -<td align='center' class='boldbase'><b>$Lang::tr{'device'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'mounted on'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td> -<td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'device'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'mounted on'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td> + <td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td> </tr> END ; - }else{ - my ($device,$size,$used,$free,$percent,$mount) = split; - print <<END + }else{ + my ($device,$size,$used,$free,$percent,$mount) = split; + print <<END <tr> -<td align='center'>$device</td> -<td align='center'>$mount</td> -<td align='center'>$size</td> -<td align='center'>$used</td> -<td align='center'>$free</td> -<td align='left'> + <td align='center'>$device</td> + <td align='center'>$mount</td> + <td align='center'>$size</td> + <td align='center'>$used</td> + <td align='center'>$free</td> + <td align='left'> END ; - &percentbar($percent); - print <<END + &percentbar($percent); + print <<END </td> -<td align='left'>$percent</td> + <td align='left'>$percent</td> </tr> END ; - } } - close DF; - print "<tr><td colspan='7'> \n<tr><td colspan='7'><h3>Inodes</h3>\n"; +} +close DF; +print "<tr><td colspan='7'> \n<tr><td colspan='7'><h3>Inodes</h3>\n";
- open(DF,'/bin/df -P -i -x rootfs|'); - while(<DF>){ - if ($_ =~ m/^Filesystem/ ){ - print <<END +open(DF,'/bin/df -P -i -x rootfs|'); +while(<DF>){ + if ($_ =~ m/^Filesystem/ ){ + print <<END <tr> -<td align='center' class='boldbase'><b>$Lang::tr{'device'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'mounted on'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td> -<td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'device'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'mounted on'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td> + <td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td> </tr> END ; - }else{ - my ($device,$size,$used,$free,$percent,$mount) = split; - print <<END + }else{ + my ($device,$size,$used,$free,$percent,$mount) = split; + print <<END <tr> -<td align='center'>$device</td> -<td align='center'>$mount</td> -<td align='center'>$size</td> -<td align='center'>$used</td> -<td align='center'>$free</td> + <td align='center'>$device</td> + <td align='center'>$mount</td> + <td align='center'>$size</td> + <td align='center'>$used</td> + <td align='center'>$free</td> <td> END ; - &percentbar($percent); - print <<END + &percentbar($percent); + print <<END </td> <td align='left'>$percent</td> </tr> END ; - } } - close DF; - my @iostat1 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print $1}'); - my @iostat2 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print $5}'); - my @iostat3 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print $6}'); - print "<tr><td colspan='3'> \n<tr><td colspan='3'><h3>transfers</h3></td></tr>"; - my $i=0; - - for(my $i = 1; $i <= $#iostat1; $i++){ - if ( $i eq '1' ){ - print "<tr><td align='center' class='boldbase'><b>$Lang::tr{'device'}</b></td><td align='center' class='boldbase'><b>$Lang::tr{'MB read'}</b></td><td align='center' class='boldbase'><b>$Lang::tr{'MB written'}</b></td></tr>"; - }else{ - print "<tr><td align='center'>$iostat1[$i]</td><td align='center'>$iostat2[$i]</td><td align='center'>$iostat3[$i]</td></tr>"; - } +} +close DF; +my @iostat1 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print $1}'); +my @iostat2 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print $5}'); +my @iostat3 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print $6}'); +print "<tr><td colspan='3'> \n<tr><td colspan='3'><h3>transfers</h3></td></tr>"; +my $i=0; + +for(my $i = 1; $i <= $#iostat1; $i++){ + if ( $i eq '1' ){ + print "<tr><td align='center' class='boldbase'><b>$Lang::tr{'device'}</b></td><td align='center' class='boldbase'><b>$Lang::tr{'MB read'}</b></td><td align='center' class='boldbase'><b>$Lang::tr{'MB written'}</b></td></tr>"; + }else{ + print "<tr><td align='center'>$iostat1[$i]</td><td align='center'>$iostat2[$i]</td><td align='center'>$iostat3[$i]</td></tr>"; } - print "</table>\n"; - &Header::closebox(); +} +print "</table>\n"; +&Header::closebox();
- &Header::closebigbox(); - &Header::closepage(); +&Header::closebigbox(); +&Header::closepage();
sub percentbar { diff --git a/html/cgi-bin/memory.cgi b/html/cgi-bin/memory.cgi index 037d5800b..814063dfb 100644 --- a/html/cgi-bin/memory.cgi +++ b/html/cgi-bin/memory.cgi @@ -35,85 +35,85 @@ my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", %mainsettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", %color);
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'memory information'}, 1, ''); - &Header::openbigbox('100%', 'left'); +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'memory information'}, 1, ''); +&Header::openbigbox('100%', 'left');
- &Header::openbox('100%', 'center', "Memory $Lang::tr{'graph'}"); - &Graphs::makegraphbox("memory.cgi","memory","day"); +&Header::openbox('100%', 'center', "Memory $Lang::tr{'graph'}"); +&Graphs::makegraphbox("memory.cgi","memory","day"); +&Header::closebox(); + +if (-f "$mainsettings{'RRDLOG'}/collectd/localhost/swap") { + &Header::openbox('100%', 'center', "Swap $Lang::tr{'graph'}"); + &Graphs::makegraphbox("memory.cgi","swap","day"); &Header::closebox(); +}
- if (-f "$mainsettings{'RRDLOG'}/collectd/localhost/swap") { - &Header::openbox('100%', 'center', "Swap $Lang::tr{'graph'}"); - &Graphs::makegraphbox("memory.cgi","swap","day"); - &Header::closebox(); - } - - &Header::openbox('100%', 'center', $Lang::tr{'memory'}); - print "<table width='95%' cellspacing='5'>"; - my $size=0; - my $used=0; - my $free=0; - my $percent=0; - my $shared=0; - my $buffers=0; - my $cached=0; - my $available=0; +&Header::openbox('100%', 'center', $Lang::tr{'memory'}); +print "<table width='95%' cellspacing='5'>"; +my $size=0; +my $used=0; +my $free=0; +my $percent=0; +my $shared=0; +my $buffers=0; +my $cached=0; +my $available=0;
- # output format: kibibytes, wide mode (buffers and cache in two columns) - open(my $cmd_fh, "-|", '/usr/bin/free -k -w') or die $!; - while(<$cmd_fh>){ - if ($_ =~ m/^\s+total\s+used\s+free\s+shared\s+buffers\s+cache\s+available$/ ){ - print <<END +# output format: kibibytes, wide mode (buffers and cache in two columns) +open(my $cmd_fh, "-|", '/usr/bin/free -k -w') or die $!; +while(<$cmd_fh>){ + if ($_ =~ m/^\s+total\s+used\s+free\s+shared\s+buffers\s+cache\s+available$/ ){ + print <<END <tr> -<td align='center'> </td> -<td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td> -<td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td> -<td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td> + <td align='center'> </td> + <td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td> + <td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td> + <td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td> </tr> END ; - }else{ - if ($_ =~ m/^Mem:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/){ - ($size,$used,$free,$shared,$buffers,$cached,$available) = ($1,$2,$3,$4,$5,$6,$7); - ($percent = ($used/$size)*100) =~ s/^(\d+)(.\d+)?$/$1%/; - print <<END + }else{ + if ($_ =~ m/^Mem:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/){ + ($size,$used,$free,$shared,$buffers,$cached,$available) = ($1,$2,$3,$4,$5,$6,$7); + ($percent = ($used/$size)*100) =~ s/^(\d+)(.\d+)?$/$1%/; + print <<END <tr> -<td class='boldbase'><b>$Lang::tr{'ram'}</b></td> + <td class='boldbase'><b>$Lang::tr{'ram'}</b></td> END ; - }elsif($_ =~ m/^Swap:\s+(\d+)\s+(\d+)\s+(\d+)$/){ - ($size,$used,$free) = ($1,$2,$3); - if ($size != 0){ - ($percent = ($used/$size)*100) =~ s/^(\d+)(.\d+)?$/$1%/; - }else{ - ($percent = ''); - } - print <<END + }elsif($_ =~ m/^Swap:\s+(\d+)\s+(\d+)\s+(\d+)$/){ + ($size,$used,$free) = ($1,$2,$3); + if ($size != 0){ + ($percent = ($used/$size)*100) =~ s/^(\d+)(.\d+)?$/$1%/; + }else{ + ($percent = ''); + } + print <<END <tr> -<td class='boldbase'><b>$Lang::tr{'swap'}</b></td> + <td class='boldbase'><b>$Lang::tr{'swap'}</b></td> END ; - } - print <<END -<td align='center'>$size KiB</td> -<td align='center'>$used KiB</td> -<td align='center'>$free KiB</td> -<td> + } + print <<END + <td align='center'>$size KiB</td> + <td align='center'>$used KiB</td> + <td align='center'>$free KiB</td> + <td> END ; - &percentbar($percent); - print <<END + &percentbar($percent); + print <<END </td> -<td align='left'>$percent</td> + <td align='left'>$percent</td> </tr> END ; - } } - close($cmd_fh); - print <<END +} +close($cmd_fh); +print <<END <tr><td colspan='6'><br /></td></tr> <tr><td class='boldbase'><b>$Lang::tr{'shared'}</b></td><td align='center'>$shared KiB</td></tr> <tr><td class='boldbase'><b>$Lang::tr{'buffers'}</b></td><td align='center'>$buffers KiB</td></tr> @@ -122,10 +122,10 @@ END </table> END ; - &Header::closebox(); +&Header::closebox();
- &Header::closebigbox(); - &Header::closepage(); +&Header::closebigbox(); +&Header::closepage();
sub percentbar{ my $percent = $_[0]; diff --git a/html/cgi-bin/netexternal.cgi b/html/cgi-bin/netexternal.cgi index 704cd8727..cc5667044 100644 --- a/html/cgi-bin/netexternal.cgi +++ b/html/cgi-bin/netexternal.cgi @@ -43,113 +43,113 @@ my %netsettings=(); my @graphs=(); my %dhcpinfo=();
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'network traffic graphs external'}, 1, ''); - &Header::openbigbox('100%', 'left'); +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'network traffic graphs external'}, 1, ''); +&Header::openbigbox('100%', 'left');
- if ($netsettings{'RED_TYPE'} ne 'PPPOE'){ - if ($netsettings{'RED_DEV'} ne $netsettings{'GREEN_DEV'}){ - push (@graphs, ($netsettings{'RED_DEV'})); - } - }else{ - push (@graphs, "ppp0"); - } - - if (-e "/var/log/rrd/collectd/localhost/interface/if_octets-ipsec0.rrd"){ - push (@graphs, ("ipsec0")); - } - - if (-e "/var/log/rrd/collectd/localhost/interface/if_octets-tun0.rrd"){ - push (@graphs, ("tun0")); - } - - foreach (@graphs) { - &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); - &Graphs::makegraphbox("netexternal.cgi",$_,"day"); - &Header::closebox(); +if ($netsettings{'RED_TYPE'} ne 'PPPOE'){ + if ($netsettings{'RED_DEV'} ne $netsettings{'GREEN_DEV'}){ + push (@graphs, ($netsettings{'RED_DEV'})); } - - if ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} eq "DHCP"){ - - &Header::openbox('100%', 'left', "RED $Lang::tr{'dhcp configuration'}"); - if (-s "${General::swroot}/dhcpc/dhcpcd-$netsettings{'RED_DEV'}.info") { - - &General::readhash("${General::swroot}/dhcpc/dhcpcd-$netsettings{'RED_DEV'}.info", %dhcpinfo); - - my ($DNS1, $DNS2) = split(/ /, $dhcpinfo{'domain_name_servers'}); - - my $lsetme=0; - my $leasetime=""; - if ($dhcpinfo{'dhcp_lease_time'} ne "") { - $lsetme=$dhcpinfo{'dhcp_lease_time'}; - $lsetme=($lsetme/60); - - if ($lsetme > 59) { - $lsetme=($lsetme/60); $leasetime=$lsetme." Hour"; - }else{ - $leasetime=$lsetme." Minute"; - } - - if ($lsetme > 1) { - $leasetime=$leasetime."s"; - } +}else{ + push (@graphs, "ppp0"); +} + +if (-e "/var/log/rrd/collectd/localhost/interface/if_octets-ipsec0.rrd"){ + push (@graphs, ("ipsec0")); +} + +if (-e "/var/log/rrd/collectd/localhost/interface/if_octets-tun0.rrd"){ + push (@graphs, ("tun0")); +} + +foreach (@graphs) { + &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); + &Graphs::makegraphbox("netexternal.cgi",$_,"day"); + &Header::closebox(); +} + +if ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} eq "DHCP"){ + + &Header::openbox('100%', 'left', "RED $Lang::tr{'dhcp configuration'}"); + if (-s "${General::swroot}/dhcpc/dhcpcd-$netsettings{'RED_DEV'}.info") { + + &General::readhash("${General::swroot}/dhcpc/dhcpcd-$netsettings{'RED_DEV'}.info", %dhcpinfo); + + my ($DNS1, $DNS2) = split(/ /, $dhcpinfo{'domain_name_servers'}); + + my $lsetme=0; + my $leasetime=""; + if ($dhcpinfo{'dhcp_lease_time'} ne "") { + $lsetme=$dhcpinfo{'dhcp_lease_time'}; + $lsetme=($lsetme/60); + + if ($lsetme > 59) { + $lsetme=($lsetme/60); $leasetime=$lsetme." Hour"; + }else{ + $leasetime=$lsetme." Minute"; } + + if ($lsetme > 1) { + $leasetime=$leasetime."s"; + } + }
- my $rentme=0; - my $rnwltime=""; - - if ($dhcpinfo{'dhcp_renewal_time'} ne "") { - $rentme=$dhcpinfo{'dhcp_renewal_time'}; - $rentme=($rentme/60); - - if ($rentme > 59){ - $rentme=($rentme/60); $rnwltime=$rentme." Hour"; - }else{ - $rnwltime=$rentme." Minute"; - } - - if ($rentme > 1){ - $rnwltime=$rnwltime."s"; - } + my $rentme=0; + my $rnwltime=""; + + if ($dhcpinfo{'dhcp_renewal_time'} ne "") { + $rentme=$dhcpinfo{'dhcp_renewal_time'}; + $rentme=($rentme/60); + + if ($rentme > 59){ + $rentme=($rentme/60); $rnwltime=$rentme." Hour"; + }else{ + $rnwltime=$rentme." Minute"; } + + if ($rentme > 1){ + $rnwltime=$rnwltime."s"; + } + }
- my $maxtme=0; - my $maxtime=""; + my $maxtme=0; + my $maxtime="";
- if ($dhcpinfo{'dhcp_rebinding_time'} ne "") { - $maxtme=$dhcpinfo{'dhcp_rebinding_time'}; - $maxtme=($maxtme/60); + if ($dhcpinfo{'dhcp_rebinding_time'} ne "") { + $maxtme=$dhcpinfo{'dhcp_rebinding_time'}; + $maxtme=($maxtme/60);
- if ($maxtme > 59){ - $maxtme=($maxtme/60); $maxtime=$maxtme." Hour"; - } else { - $maxtime=$maxtme." Minute"; - } + if ($maxtme > 59){ + $maxtme=($maxtme/60); $maxtime=$maxtme." Hour"; + } else { + $maxtime=$maxtme." Minute"; + }
- if ($maxtme > 1) { - $maxtime=$maxtime."s"; - } + if ($maxtme > 1) { + $maxtime=$maxtime."s"; } + }
- print <<END + print <<END <table width='100%'> -<tr><td width='30%'>$Lang::tr{'domain'}</td><td>$dhcpinfo{'domain_name'}</td></tr> -<tr><td>$Lang::tr{'gateway'}</td><td>$dhcpinfo{'routers'}</td></tr> -<tr><td>$Lang::tr{'primary dns'}</td><td>$DNS1</td></tr> -<tr><td>$Lang::tr{'secondary dns'}</td><td>$DNS2</td></tr> -<tr><td>$Lang::tr{'dhcp server'}</td><td>$dhcpinfo{'dhcp_server_identifier'}</td></tr> -<tr><td>$Lang::tr{'def lease time'}</td><td>$leasetime</td></tr> -<tr><td>$Lang::tr{'default renewal time'}</td><td>$rnwltime</td></tr> -<tr><td>$Lang::tr{'max renewal time'}</td><td>$maxtime</td></tr> + <tr><td width='30%'>$Lang::tr{'domain'}</td><td>$dhcpinfo{'domain_name'}</td></tr> + <tr><td>$Lang::tr{'gateway'}</td><td>$dhcpinfo{'routers'}</td></tr> + <tr><td>$Lang::tr{'primary dns'}</td><td>$DNS1</td></tr> + <tr><td>$Lang::tr{'secondary dns'}</td><td>$DNS2</td></tr> + <tr><td>$Lang::tr{'dhcp server'}</td><td>$dhcpinfo{'dhcp_server_identifier'}</td></tr> + <tr><td>$Lang::tr{'def lease time'}</td><td>$leasetime</td></tr> + <tr><td>$Lang::tr{'default renewal time'}</td><td>$rnwltime</td></tr> + <tr><td>$Lang::tr{'max renewal time'}</td><td>$maxtime</td></tr> </table> END ; - }else{ - print "$Lang::tr{'no dhcp lease'}"; - } - &Header::closebox(); + }else{ + print "$Lang::tr{'no dhcp lease'}"; } + &Header::closebox(); +}
- &Header::closebigbox(); - &Header::closepage(); +&Header::closebigbox(); +&Header::closepage(); diff --git a/html/cgi-bin/netinternal.cgi b/html/cgi-bin/netinternal.cgi index 8d7105e36..472f61efe 100644 --- a/html/cgi-bin/netinternal.cgi +++ b/html/cgi-bin/netinternal.cgi @@ -40,31 +40,31 @@ my %netsettings=(); my @graphs=(); my @wireless=();
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'network traffic graphs internal'}, 1, ''); - &Header::openbigbox('100%', 'left'); +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'network traffic graphs internal'}, 1, ''); +&Header::openbigbox('100%', 'left');
- push (@graphs, ($netsettings{'GREEN_DEV'})); - if (&Header::blue_used() && $netsettings{'BLUE_DEV'}) {push (@graphs, ($netsettings{'BLUE_DEV'})); } - if (&Header::orange_used() && $netsettings{'ORANGE_DEV'}) {push (@graphs, ($netsettings{'ORANGE_DEV'})); } +push (@graphs, ($netsettings{'GREEN_DEV'})); +if (&Header::blue_used() && $netsettings{'BLUE_DEV'}) {push (@graphs, ($netsettings{'BLUE_DEV'})); } +if (&Header::orange_used() && $netsettings{'ORANGE_DEV'}) {push (@graphs, ($netsettings{'ORANGE_DEV'})); }
- my @wirelessgraphs = `ls -dA /var/log/rrd/collectd/localhost/wireless* 2>/dev/null`; - foreach (@wirelessgraphs){ - $_ =~ /(.*)/wireless-(.*)/; - push(@wireless,$2); - } +my @wirelessgraphs = `ls -dA /var/log/rrd/collectd/localhost/wireless* 2>/dev/null`; +foreach (@wirelessgraphs){ + $_ =~ /(.*)/wireless-(.*)/; + push(@wireless,$2); +}
- foreach (@graphs) { - &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); - &Graphs::makegraphbox("netinternal.cgi",$_,"day"); - &Header::closebox(); - } +foreach (@graphs) { + &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); + &Graphs::makegraphbox("netinternal.cgi",$_,"day"); + &Header::closebox(); +}
- foreach (@wireless) { - &Header::openbox('100%', 'center', "Wireless $_ $Lang::tr{'graph'}"); - &Graphs::makegraphbox("netinternal.cgi","wireless".$_,"day"); - &Header::closebox(); - } +foreach (@wireless) { + &Header::openbox('100%', 'center', "Wireless $_ $Lang::tr{'graph'}"); + &Graphs::makegraphbox("netinternal.cgi","wireless".$_,"day"); + &Header::closebox(); +}
- &Header::closebigbox(); - &Header::closepage(); +&Header::closebigbox(); +&Header::closepage(); diff --git a/html/cgi-bin/netother.cgi b/html/cgi-bin/netother.cgi index c1d6a64a0..667777153 100755 --- a/html/cgi-bin/netother.cgi +++ b/html/cgi-bin/netother.cgi @@ -37,51 +37,51 @@ my %mainsettings = ();
my @pings=();
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'network traffic graphs others'}, 1, ''); - &Header::openbigbox('100%', 'left'); - - my @pinggraphs = `ls -dA /var/log/rrd/collectd/localhost/ping/ping-*`; - foreach (@pinggraphs){ - $_ =~ /(.*)/ping/ping-(.*).rrd/; - push(@pings,$2); - } +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'network traffic graphs others'}, 1, ''); +&Header::openbigbox('100%', 'left');
- foreach (@pings) { - &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); - &Graphs::makegraphbox("netother.cgi",$_,"day"); - &Header::closebox(); - } +my @pinggraphs = `ls -dA /var/log/rrd/collectd/localhost/ping/ping-*`; +foreach (@pinggraphs){ + $_ =~ /(.*)/ping/ping-(.*).rrd/; + push(@pings,$2); +}
- &Header::openbox('100%', 'center', "$Lang::tr{'connection tracking'}"); - &Graphs::makegraphbox("netother.cgi", "conntrack", "day"); +foreach (@pings) { + &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); + &Graphs::makegraphbox("netother.cgi",$_,"day"); &Header::closebox(); +}
- &Header::openbox('100%', 'center', "$Lang::tr{'firewallhits'} $Lang::tr{'graph'}"); - &Graphs::makegraphbox("netother.cgi","fwhits","day"); - &Header::closebox(); +&Header::openbox('100%', 'center', "$Lang::tr{'connection tracking'}"); +&Graphs::makegraphbox("netother.cgi", "conntrack", "day"); +&Header::closebox();
- my $output = ''; - - &Header::openbox('100%', 'left', $Lang::tr{'routing table entries'}); - $output = `/sbin/ip route show`; - $output = &Header::cleanhtml($output,"y"); - print "<pre>$output</pre>\n"; - &Header::closebox(); +&Header::openbox('100%', 'center', "$Lang::tr{'firewallhits'} $Lang::tr{'graph'}"); +&Graphs::makegraphbox("netother.cgi","fwhits","day"); +&Header::closebox();
- $output = `/sbin/ip route list table 220`; - if ( $output ) { - &Header::openbox('100%', 'left', $Lang::tr{'ipsec routing table entries'}); - $output = &Header::cleanhtml($output,"y"); - print "<pre>$output</pre>\n"; - &Header::closebox() - } +my $output = '';
- &Header::openbox('100%', 'left', $Lang::tr{'arp table entries'}); - $output = `/sbin/ip neigh show`; +&Header::openbox('100%', 'left', $Lang::tr{'routing table entries'}); +$output = `/sbin/ip route show`; +$output = &Header::cleanhtml($output,"y"); +print "<pre>$output</pre>\n"; +&Header::closebox(); + +$output = `/sbin/ip route list table 220`; +if ( $output ) { + &Header::openbox('100%', 'left', $Lang::tr{'ipsec routing table entries'}); $output = &Header::cleanhtml($output,"y"); print "<pre>$output</pre>\n"; - &Header::closebox(); + &Header::closebox() +} + +&Header::openbox('100%', 'left', $Lang::tr{'arp table entries'}); +$output = `/sbin/ip neigh show`; +$output = &Header::cleanhtml($output,"y"); +print "<pre>$output</pre>\n"; +&Header::closebox();
- &Header::closebigbox(); - &Header::closepage(); +&Header::closebigbox(); +&Header::closepage(); diff --git a/html/cgi-bin/netovpnrw.cgi b/html/cgi-bin/netovpnrw.cgi index fc2e43508..5014f9a55 100755 --- a/html/cgi-bin/netovpnrw.cgi +++ b/html/cgi-bin/netovpnrw.cgi @@ -37,26 +37,26 @@ my %mainsettings = ();
my @vpns=();
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'vpn statistic rw'}, 1, ''); - &Header::openbigbox('100%', 'left'); +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'vpn statistic rw'}, 1, ''); +&Header::openbigbox('100%', 'left');
- my @vpngraphs = `find /var/log/rrd/collectd/localhost/openvpn-*/ -not -path *openvpn-UNDEF* -not -path *openvpn-*n2n* -name *.rrd 2>/dev/null|sort`; - foreach (@vpngraphs){ - if($_ =~ /(.*)/openvpn-(.*)/if_octets_derive.rrd/){ - push(@vpns,$2); - } +my @vpngraphs = `find /var/log/rrd/collectd/localhost/openvpn-*/ -not -path *openvpn-UNDEF* -not -path *openvpn-*n2n* -name *.rrd 2>/dev/null|sort`; +foreach (@vpngraphs){ + if($_ =~ /(.*)/openvpn-(.*)/if_octets_derive.rrd/){ + push(@vpns,$2); } - if(@vpns){ - foreach (@vpns) { - &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); - &Graphs::makegraphbox("netovpnrw.cgi",$_, "day"); - &Header::closebox(); - } - }else{ - print "<center>".$Lang::tr{'no data'}."</center>"; +} +if(@vpns){ + foreach (@vpns) { + &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); + &Graphs::makegraphbox("netovpnrw.cgi",$_, "day"); + &Header::closebox(); } - my $output = ''; +}else{ + print "<center>".$Lang::tr{'no data'}."</center>"; +} +my $output = '';
- &Header::closebigbox(); - &Header::closepage(); +&Header::closebigbox(); +&Header::closepage(); diff --git a/html/cgi-bin/netovpnsrv.cgi b/html/cgi-bin/netovpnsrv.cgi index 6ff6e17fe..1fb66e7a4 100755 --- a/html/cgi-bin/netovpnsrv.cgi +++ b/html/cgi-bin/netovpnsrv.cgi @@ -49,32 +49,32 @@ foreach my $key (sort {$vpnsettings{$a}[1] <=> $vpnsettings{$b}[1]} keys %vpnset $ipsecgraphs{$vpnsettings{$key}[1]} = "${interface_mode}${key}"; }
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'vpn statistic n2n'}, 1, ''); - &Header::openbigbox('100%', 'left'); +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'vpn statistic n2n'}, 1, ''); +&Header::openbigbox('100%', 'left');
- my @vpngraphs = `find /var/log/rrd/collectd/localhost/openvpn-*-n2n/ -not -path *openvpn-UNDEF* -name *traffic.rrd 2>/dev/null|sort`; - foreach (@vpngraphs){ - if($_ =~ /(.*)/openvpn-(.*)/if_octets_derive-traffic.rrd/){ - push(@vpns,$2); - } +my @vpngraphs = `find /var/log/rrd/collectd/localhost/openvpn-*-n2n/ -not -path *openvpn-UNDEF* -name *traffic.rrd 2>/dev/null|sort`; +foreach (@vpngraphs){ + if($_ =~ /(.*)/openvpn-(.*)/if_octets_derive-traffic.rrd/){ + push(@vpns,$2); + } +} +if (@vpns || %ipsecgraphs) { + foreach my $name (sort keys %ipsecgraphs) { + &Header::openbox('100%', 'center', "$Lang::tr{'ipsec connection'}: $name"); + &Graphs::makegraphbox("netovpnsrv.cgi", "ipsec-$ipsecgraphs{$name}", "day"); + &Header::closebox(); } - if (@vpns || %ipsecgraphs) { - foreach my $name (sort keys %ipsecgraphs) { - &Header::openbox('100%', 'center', "$Lang::tr{'ipsec connection'}: $name"); - &Graphs::makegraphbox("netovpnsrv.cgi", "ipsec-$ipsecgraphs{$name}", "day"); - &Header::closebox(); - }
- foreach (@vpns) { - &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); - &Graphs::makegraphbox("netovpnsrv.cgi",$_, "day"); - &Header::closebox(); - } - }else{ - print "<center>".$Lang::tr{'no data'}."</center>"; + foreach (@vpns) { + &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}"); + &Graphs::makegraphbox("netovpnsrv.cgi",$_, "day"); + &Header::closebox(); } - my $output = ''; +}else{ + print "<center>".$Lang::tr{'no data'}."</center>"; +} +my $output = '';
- &Header::closebigbox(); - &Header::closepage(); +&Header::closebigbox(); +&Header::closepage(); diff --git a/html/cgi-bin/qos.cgi b/html/cgi-bin/qos.cgi index 3410c7353..1a0354ed0 100644 --- a/html/cgi-bin/qos.cgi +++ b/html/cgi-bin/qos.cgi @@ -111,10 +111,10 @@ my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", %mainsettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", %color);
- &Header::showhttpheaders(); +&Header::showhttpheaders();
- &Header::openpage('QoS', 1, ''); - &Header::openbigbox('100%', 'left', '', $errormessage); +&Header::openpage('QoS', 1, ''); +&Header::openbigbox('100%', 'left', '', $errormessage);
############################################################################################################################ ############################################################################################################################ @@ -699,12 +699,12 @@ if ( ($qossettings{'DEFCLASS_INC'} eq '') || ($qossettings{'DEFCLASS_OUT'} eq '' exit }
- &Header::openbox('100%', 'center', "$qossettings{'RED_DEV'} $Lang::tr{'graph'}, $Lang::tr{'uplink'}"); - &Graphs::makegraphbox("qos.cgi",$qossettings{'RED_DEV'},"hour"); - &Header::closebox(); - &Header::openbox('100%', 'center', "$qossettings{'IMQ_DEV'} $Lang::tr{'graph'}, $Lang::tr{'downlink'}"); - &Graphs::makegraphbox("qos.cgi",$qossettings{'IMQ_DEV'},"hour"); - &Header::closebox(); +&Header::openbox('100%', 'center', "$qossettings{'RED_DEV'} $Lang::tr{'graph'}, $Lang::tr{'uplink'}"); +&Graphs::makegraphbox("qos.cgi",$qossettings{'RED_DEV'},"hour"); +&Header::closebox(); +&Header::openbox('100%', 'center', "$qossettings{'IMQ_DEV'} $Lang::tr{'graph'}, $Lang::tr{'downlink'}"); +&Graphs::makegraphbox("qos.cgi",$qossettings{'IMQ_DEV'},"hour"); +&Header::closebox();
&showclasses($qossettings{'RED_DEV'}); &showclasses($qossettings{'IMQ_DEV'}); diff --git a/html/cgi-bin/system.cgi b/html/cgi-bin/system.cgi index 595ca0eab..c1da5f536 100644 --- a/html/cgi-bin/system.cgi +++ b/html/cgi-bin/system.cgi @@ -35,23 +35,23 @@ my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", %mainsettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", %color);
- &Header::showhttpheaders(); - &Header::openpage($Lang::tr{'status information'}, 1, ''); - &Header::openbigbox('100%', 'left'); +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'status information'}, 1, ''); +&Header::openbigbox('100%', 'left');
- &Header::openbox('100%', 'center', "CPU $Lang::tr{'graph'}"); - &Graphs::makegraphbox("system.cgi","cpu","day"); - &Header::closebox(); - - if ( -e "$mainsettings{'RRDLOG'}/collectd/localhost/cpufreq/cpufreq-0.rrd"){ - &Header::openbox('100%', 'center', "$Lang::tr{'cpu frequency'} $Lang::tr{'graph'}"); - &Graphs::makegraphbox("system.cgi","cpufreq","day"); - &Header::closebox(); - } +&Header::openbox('100%', 'center', "CPU $Lang::tr{'graph'}"); +&Graphs::makegraphbox("system.cgi","cpu","day"); +&Header::closebox();
- &Header::openbox('100%', 'center', "$Lang::tr{'uptime load average'} $Lang::tr{'graph'}"); - &Graphs::makegraphbox("system.cgi","load","day"); +if ( -e "$mainsettings{'RRDLOG'}/collectd/localhost/cpufreq/cpufreq-0.rrd"){ + &Header::openbox('100%', 'center', "$Lang::tr{'cpu frequency'} $Lang::tr{'graph'}"); + &Graphs::makegraphbox("system.cgi","cpufreq","day"); &Header::closebox(); +} + +&Header::openbox('100%', 'center', "$Lang::tr{'uptime load average'} $Lang::tr{'graph'}"); +&Graphs::makegraphbox("system.cgi","load","day"); +&Header::closebox();
- &Header::closebigbox(); - &Header::closepage(); +&Header::closebigbox(); +&Header::closepage();