Skip to content

Commit

Permalink
changed the way how 'ztool iostat' command get the read/write values …
Browse files Browse the repository at this point in the history
…of the

  Operations/Bandwidth graphs #242
  • Loading branch information
mikaku committed May 15, 2019
1 parent 28ed22b commit 3c1b260
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- Changed how the values in 'fail2ban.pm' are shown. Now it shows the Bans as
absolute values. The new option 'graph_mode' permits switching between
'absolute' (default) and 'rate'. [#241]
- Changed the way how 'ztool iostat' command get the read/write values of the
Operations/Bandwidth graphs. [#242]
- Fixed the copyright year in 'monitorix.cgi'.
- Fixed in 'mail.pm to use the option 'mail_log' instead the hard coded path I
forgot to remove when adding the Exim support.
Expand Down
10 changes: 8 additions & 2 deletions lib/zfs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ sub zfs_update {
my $pool = (split(',', $zfs->{list}))[$n] || "";
if($pool) {
my @zpool;
my @data;

$free = trim(`zfs get -Hp -o value available $pool`);
$udata = trim(`zfs get -Hp -o value used $pool`);
Expand All @@ -282,8 +283,13 @@ sub zfs_update {
}
$cap =~ s/%//;
$fra =~ s/[%-]//g; $fra = $fra || 0;
@zpool = split(' ', `zpool iostat -Hp $pool` || "");
(undef, undef, undef, $oper, $opew, $banr, $banw) = @zpool;

open(IN, "zpool iostat -Hp $pool 5 2 |");
while(<IN>) {
push(@data, $_);
}
close(IN);
(undef, undef, undef, $oper, $opew, $banr, $banw) = split(' ', $data[1]);
}

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

0 comments on commit 3c1b260

Please sign in to comment.