Thread iostat per shell und via Perl (2 answers)
Opened by arne at 2015-03-10 17:38

Gast arne
 2015-03-10 17:38
#180098 #180098
Hallo, ich versuche iostat von Perl aus auszuwerten. Die Daten bekomme ich folgendermaßen:

Code: (dl )
my $result = `iostat -xt`;
oder per system(...);

Das Problem ist, das die Werte nicht stimmen. Lasse ich parallel den gleichen Befehl in der Shell laufen bekomme ich andere Werte. Die "Perl Ausgabe" hängt auch noch eine Zeile ran. Die Werte im Terminal sind ok und reagieren auch vernünftig auf Last. Jemand eine Idee?

Shell:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
4,12 0,00 10,31 0,00 0,00 85,57

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
scd0 0,00 0,00 0,00 0 0
sda 0,00 0,00 0,00 0 0
loop0 0,00 0,00 0,00 0 0
loop1 0,00 0,00 0,00 0 0
loop2 0,00 0,00 0,00 0 0
loop3 0,00 0,00 0,00 0 0
loop4 0,00 0,00 0,00 0 0
loop5 0,00 0,00 0,00 0 0
loop6 0,00 0,00 0,00 0 0
loop7 0,00 0,00 0,00 0 0



Perl:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
4,06 0,00 2,56 0,25 0,00 93,12

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
scd0 0,00 0,00 0,00 0 0
sda 2,33 20,79 121,47 994339 5810096
loop0 0,00 0,00 0,00 0 0
loop1 0,00 0,00 0,00 0 0
loop2 0,00 0,00 0,00 0 0
loop3 0,00 0,00 0,00 0 0
loop4 0,00 0,00 0,00 0 0
loop5 0,00 0,00 0,00 0 0
loop6 0,00 0,00 0,00 0 0
loop7 0,00 0,00 0,00 0 0

Linux 3.2.0-4-amd64 (linux) 10.03.2015 _x86_64_ (1 CPU)

Last edited: 2015-03-10 17:47:10 +0100 (CET)

View full thread iostat per shell und via Perl