Skip to content

Commit 3c1b260

Browse files
committed
changed the way how 'ztool iostat' command get the read/write values of the
Operations/Bandwidth graphs #242
1 parent 28ed22b commit 3c1b260

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Changes

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Changed how the values in 'fail2ban.pm' are shown. Now it shows the Bans as
1919
absolute values. The new option 'graph_mode' permits switching between
2020
'absolute' (default) and 'rate'. [#241]
21+
- Changed the way how 'ztool iostat' command get the read/write values of the
22+
Operations/Bandwidth graphs. [#242]
2123
- Fixed the copyright year in 'monitorix.cgi'.
2224
- Fixed in 'mail.pm to use the option 'mail_log' instead the hard coded path I
2325
forgot to remove when adding the Exim support.

lib/zfs.pm

+8-2
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ sub zfs_update {
267267
my $pool = (split(',', $zfs->{list}))[$n] || "";
268268
if($pool) {
269269
my @zpool;
270+
my @data;
270271

271272
$free = trim(`zfs get -Hp -o value available $pool`);
272273
$udata = trim(`zfs get -Hp -o value used $pool`);
@@ -282,8 +283,13 @@ sub zfs_update {
282283
}
283284
$cap =~ s/%//;
284285
$fra =~ s/[%-]//g; $fra = $fra || 0;
285-
@zpool = split(' ', `zpool iostat -Hp $pool` || "");
286-
(undef, undef, undef, $oper, $opew, $banr, $banw) = @zpool;
286+
287+
open(IN, "zpool iostat -Hp $pool 5 2 |");
288+
while(<IN>) {
289+
push(@data, $_);
290+
}
291+
close(IN);
292+
(undef, undef, undef, $oper, $opew, $banr, $banw) = split(' ', $data[1]);
287293
}
288294

289295
$rrdata .= ":$free:$udata:$usnap:$cap:$fra:$oper:$opew:$banr:$banw:0";

0 commit comments

Comments
 (0)