mirror of https://github.com/mikaku/Monitorix.git
fixed more messages of use of uninitialized values at fs.pm in lines 765 and 766. This mainly happens in OpenVZ VPS where '/proc/diskstats' file does not exist.
This commit is contained in:
parent
2fe19df4ed
commit
55e6915423
3
Changes
3
Changes
|
@ -1,6 +1,9 @@
|
||||||
3.N.N - DD-MMM-2014
|
3.N.N - DD-MMM-2014
|
||||||
====================
|
====================
|
||||||
- Fixed some bugs in the new Makefile. [#63]
|
- Fixed some bugs in the new Makefile. [#63]
|
||||||
|
- Fixed more messages of use of uninitialized values at fs.pm in lines 765 and
|
||||||
|
766. This mainly happens in OpenVZ VPS where '/proc/diskstats' file does not
|
||||||
|
exist.
|
||||||
|
|
||||||
|
|
||||||
3.6.0 - 20-Aug-2014
|
3.6.0 - 20-Aug-2014
|
||||||
|
|
|
@ -713,7 +713,7 @@ sub fs_update {
|
||||||
if($d) {
|
if($d) {
|
||||||
if($config->{os} eq "Linux") {
|
if($config->{os} eq "Linux") {
|
||||||
if($config->{kernel} gt "2.4") {
|
if($config->{kernel} gt "2.4") {
|
||||||
open(IN, "/proc/diskstats");
|
if(open(IN, "/proc/diskstat")) {
|
||||||
while(<IN>) {
|
while(<IN>) {
|
||||||
if(/ $d /) {
|
if(/ $d /) {
|
||||||
@tmp = split(' ', $_);
|
@tmp = split(' ', $_);
|
||||||
|
@ -721,6 +721,7 @@ sub fs_update {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(IN);
|
close(IN);
|
||||||
|
}
|
||||||
(undef, undef, undef, $read_cnt, undef, undef, $read_sec, $write_cnt, undef, undef, $write_sec) = @tmp;
|
(undef, undef, undef, $read_cnt, undef, undef, $read_sec, $write_cnt, undef, undef, $write_sec) = @tmp;
|
||||||
} else {
|
} else {
|
||||||
my $io;
|
my $io;
|
||||||
|
@ -761,8 +762,8 @@ sub fs_update {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ioa = $read_cnt + $write_cnt;
|
$ioa = ($read_cnt || 0) + ($write_cnt || 0);
|
||||||
$tim = $read_sec + $write_sec;
|
$tim = ($read_sec || 0) + ($write_sec || 0);
|
||||||
|
|
||||||
$str = $e . "_ioa" . $n;
|
$str = $e . "_ioa" . $n;
|
||||||
$val = $ioa;
|
$val = $ioa;
|
||||||
|
|
Loading…
Reference in New Issue