changed the way how 'ztool iostat' command get the read/write values of the

Operations/Bandwidth graphs #242
This commit is contained in:
Jordi Sanfeliu 2019-05-15 10:51:00 +02:00
parent 28ed22b311
commit 3c1b2602a3
2 changed files with 10 additions and 2 deletions

View File

@ -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.

View File

@ -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`);
@ -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";