media.cgi: Fix parsing output of iostat

Message ID 20210924091450.23865-1-michael.tremer@ipfire.org
State Accepted
Commit 844f40bee70607943f85174d731d20ab78848123
Headers
Series media.cgi: Fix parsing output of iostat |

Commit Message

Michael Tremer Sept. 24, 2021, 9:14 a.m. UTC
  Since the last update of sysstat, the output of iostat has changed and
the web user interface showed wrong values.

This is now being fixed in this patch.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 html/cgi-bin/media.cgi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Adolf Belka Sept. 25, 2021, 11:34 a.m. UTC | #1
Acked-by: Adolf Belka <adolf.belka@ipfire.org>

Sorry that I missed the change of output of iostat when I tested my 
sysstat update patch.

Thanks for finding and fixing.

On 24/09/2021 11:14, Michael Tremer wrote:
> Since the last update of sysstat, the output of iostat has changed and
> the web user interface showed wrong values.
>
> This is now being fixed in this patch.
>
> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
> ---
>   html/cgi-bin/media.cgi | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi
> index cc8f84d0a..af75d1bf3 100644
> --- a/html/cgi-bin/media.cgi
> +++ b/html/cgi-bin/media.cgi
> @@ -135,8 +135,8 @@ 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}');
> +my @iostat2 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print \$6}');
> +my @iostat3 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print \$7}');
>   print "<tr><td colspan='3'>&nbsp;\n<tr><td colspan='3'><h3>transfers</h3></td></tr>";
>   my $i=0;
>
  
Michael Tremer Sept. 27, 2021, 6:43 p.m. UTC | #2
Hello,

No problem :)

> On 25 Sep 2021, at 12:34, Adolf Belka <adolf.belka@ipfire.org> wrote:
> 
> Acked-by: Adolf Belka <adolf.belka@ipfire.org>
> 
> Sorry that I missed the change of output of iostat when I tested my sysstat update patch.
> 
> Thanks for finding and fixing.
> 
> On 24/09/2021 11:14, Michael Tremer wrote:
>> Since the last update of sysstat, the output of iostat has changed and
>> the web user interface showed wrong values.
>> 
>> This is now being fixed in this patch.
>> 
>> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
>> ---
>>  html/cgi-bin/media.cgi | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi
>> index cc8f84d0a..af75d1bf3 100644
>> --- a/html/cgi-bin/media.cgi
>> +++ b/html/cgi-bin/media.cgi
>> @@ -135,8 +135,8 @@ 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}');
>> +my @iostat2 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print \$6}');
>> +my @iostat3 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print \$7}');
>>  print "<tr><td colspan='3'>&nbsp;\n<tr><td colspan='3'><h3>transfers</h3></td></tr>";
>>  my $i=0;
>>  
> 
> -- 
> Sent from my laptop
  

Patch

diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi
index cc8f84d0a..af75d1bf3 100644
--- a/html/cgi-bin/media.cgi
+++ b/html/cgi-bin/media.cgi
@@ -135,8 +135,8 @@  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}');
+my @iostat2 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print \$6}');
+my @iostat3 = qx(/usr/bin/iostat -dm -p | grep -v "Linux" | awk '{print \$7}');
 print "<tr><td colspan='3'>&nbsp;\n<tr><td colspan='3'><h3>transfers</h3></td></tr>";
 my $i=0;