Signed-off-by: Leo-Andres Hofmann
---
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 = "$Lang::tr{'stopped'} | ";
- if (&rngd_is_running()) {
- $rngd_status = "$Lang::tr{'running'} | ";
- }
+my $rngd_status = "$Lang::tr{'stopped'} | ";
+if (&rngd_is_running()) {
+ $rngd_status = "$Lang::tr{'running'} | ";
+}
- &Header::openbox('100%', 'center', $Lang::tr{'hardware support'});
- if ($message) {
- print <$message
+&Header::openbox('100%', 'center', $Lang::tr{'hardware support'});
+if ($message) {
+ print <$message
EOF
- }
+}
- print <
-
- $Lang::tr{'service'} |
- $Lang::tr{'status'} |
-
-
-
- $Lang::tr{'random number generator daemon'}
- |
- $rngd_status
-
-
+print <
+
+ $Lang::tr{'service'} |
+ $Lang::tr{'status'} |
+
+
+
+ $Lang::tr{'random number generator daemon'}
+ |
+ $rngd_status
+
+
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 "\n";
- open(DF,'/bin/df -P -B M -x rootfs|');
- while(){
- if ($_ =~ m/^Filesystem/ ){
- print <\n";
+open(DF,'/bin/df -P -B M -x rootfs|');
+while(){
+ if ($_ =~ m/^Filesystem/ ){
+ print <
-$Lang::tr{'device'} |
-$Lang::tr{'mounted on'} |
-$Lang::tr{'size'} |
-$Lang::tr{'used'} |
-$Lang::tr{'free'} |
-$Lang::tr{'percentage'} |
+ $Lang::tr{'device'} |
+ $Lang::tr{'mounted on'} |
+ $Lang::tr{'size'} |
+ $Lang::tr{'used'} |
+ $Lang::tr{'free'} |
+ $Lang::tr{'percentage'} |
END
;
- }else{
- my ($device,$size,$used,$free,$percent,$mount) = split;
- print <
-$device |
-$mount |
-$size |
-$used |
-$free |
-
+ | $device |
+ $mount |
+ $size |
+ $used |
+ $free |
+
END
;
- &percentbar($percent);
- print <
-$percent |
+ $percent |
END
;
- }
}
- close DF;
- print " \n | Inodes\n";
+}
+close DF;
+print " | \n | Inodes\n";
- open(DF,'/bin/df -P -i -x rootfs|');
- while(){
- if ($_ =~ m/^Filesystem/ ){
- print <){
+ if ($_ =~ m/^Filesystem/ ){
+ print <
-$Lang::tr{'device'} |
-$Lang::tr{'mounted on'} |
-$Lang::tr{'size'} |
-$Lang::tr{'used'} |
-$Lang::tr{'free'} |
-$Lang::tr{'percentage'} |
+ $Lang::tr{'device'} |
+ $Lang::tr{'mounted on'} |
+ $Lang::tr{'size'} |
+ $Lang::tr{'used'} |
+ $Lang::tr{'free'} |
+ $Lang::tr{'percentage'} |
|
END
;
- }else{
- my ($device,$size,$used,$free,$percent,$mount) = split;
- print <
-$device |
-$mount |
-$size |
-$used |
-$free |
+ $device |
+ $mount |
+ $size |
+ $used |
+ $free |
END
;
- &percentbar($percent);
- print <
$percent |
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 " \n | transfers | ";
- my $i=0;
-
- for(my $i = 1; $i <= $#iostat1; $i++){
- if ( $i eq '1' ){
- print "$Lang::tr{'device'} | $Lang::tr{'MB read'} | $Lang::tr{'MB written'} | ";
- }else{
- print "$iostat1[$i] | $iostat2[$i] | $iostat3[$i] | ";
- }
+}
+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 " \n | transfers | ";
+my $i=0;
+
+for(my $i = 1; $i <= $#iostat1; $i++){
+ if ( $i eq '1' ){
+ print "$Lang::tr{'device'} | $Lang::tr{'MB read'} | $Lang::tr{'MB written'} | ";
+ }else{
+ print "$iostat1[$i] | $iostat2[$i] | $iostat3[$i] | ";
}
- print " | |
\n";
- &Header::closebox();
+}
+print "\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 "";
- 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 "";
+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 <){
+ if ($_ =~ m/^\s+total\s+used\s+free\s+shared\s+buffers\s+cache\s+available$/ ){
+ print <
- |
-$Lang::tr{'size'} |
-$Lang::tr{'used'} |
-$Lang::tr{'free'} |
-$Lang::tr{'percentage'} |
+ |
+ $Lang::tr{'size'} |
+ $Lang::tr{'used'} |
+ $Lang::tr{'free'} |
+ $Lang::tr{'percentage'} |
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 <
-$Lang::tr{'ram'} |
+ $Lang::tr{'ram'} |
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 <
-$Lang::tr{'swap'} |
+ $Lang::tr{'swap'} |
END
;
- }
- print <$size KiB
-$used KiB |
-$free KiB |
-
+ }
+ print <$size KiB |
+ $used KiB |
+ $free KiB |
+
END
;
- &percentbar($percent);
- print <
-$percent |
+ $percent |
END
;
- }
}
- close($cmd_fh);
- print <
|
$Lang::tr{'shared'} | $shared KiB |
$Lang::tr{'buffers'} | $buffers KiB |
@@ -122,10 +122,10 @@ END
|
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 <
-$Lang::tr{'domain'} | $dhcpinfo{'domain_name'} |
-$Lang::tr{'gateway'} | $dhcpinfo{'routers'} |
-$Lang::tr{'primary dns'} | $DNS1 |
-$Lang::tr{'secondary dns'} | $DNS2 |
-$Lang::tr{'dhcp server'} | $dhcpinfo{'dhcp_server_identifier'} |
-$Lang::tr{'def lease time'} | $leasetime |
-$Lang::tr{'default renewal time'} | $rnwltime |
-$Lang::tr{'max renewal time'} | $maxtime |
+ $Lang::tr{'domain'} | $dhcpinfo{'domain_name'} |
+ $Lang::tr{'gateway'} | $dhcpinfo{'routers'} |
+ $Lang::tr{'primary dns'} | $DNS1 |
+ $Lang::tr{'secondary dns'} | $DNS2 |
+ $Lang::tr{'dhcp server'} | $dhcpinfo{'dhcp_server_identifier'} |
+ $Lang::tr{'def lease time'} | $leasetime |
+ $Lang::tr{'default renewal time'} | $rnwltime |
+ $Lang::tr{'max renewal time'} | $maxtime |
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 "$output
\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 "$output
\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 "$output
\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 "$output
\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 "$output
\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 "".$Lang::tr{'no data'}."";
+}
+if(@vpns){
+ foreach (@vpns) {
+ &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
+ &Graphs::makegraphbox("netovpnrw.cgi",$_, "day");
+ &Header::closebox();
}
- my $output = '';
+}else{
+ print "".$Lang::tr{'no data'}."";
+}
+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 "".$Lang::tr{'no data'}."";
+ foreach (@vpns) {
+ &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
+ &Graphs::makegraphbox("netovpnsrv.cgi",$_, "day");
+ &Header::closebox();
}
- my $output = '';
+}else{
+ print "".$Lang::tr{'no data'}."";
+}
+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();
--
2.27.0.windows.1