mirror of https://github.com/mikaku/Monitorix.git
Add respect_standby to disk.pm to avoid waking up sleeping disks.
This commit is contained in:
parent
25de78d2bd
commit
276e04fd83
|
@ -182,6 +182,7 @@ sub disk_update {
|
|||
my ($package, $config, $debug) = @_;
|
||||
my $rrd = $config->{base_lib} . $package . ".rrd";
|
||||
my $disk = $config->{disk};
|
||||
my $respect_standby = lc($disk->{respect_standby} || "") eq "y" ? 1 : 0;
|
||||
|
||||
my $temp;
|
||||
my $smart1;
|
||||
|
@ -208,8 +209,12 @@ sub disk_update {
|
|||
$d = abs_path(dirname($d) . "/" . readlink($d));
|
||||
chomp($d);
|
||||
}
|
||||
my $smartctl_options = "-A";
|
||||
if($respect_standby) {
|
||||
$smartctl_options .= " -n standby";
|
||||
}
|
||||
|
||||
open(IN, "smartctl -A $d |");
|
||||
open(IN, "smartctl $smartctl_options $d |");
|
||||
while(<IN>) {
|
||||
if(/^ 5/ && /Reallocated_Sector_Ct/) {
|
||||
my @tmp = split(' ', $_);
|
||||
|
@ -243,7 +248,7 @@ sub disk_update {
|
|||
}
|
||||
}
|
||||
close(IN);
|
||||
if(!$temp) {
|
||||
if(!$temp && !$respect_standby) {
|
||||
if(open(IN, "hddtemp -wqn $d |")) {
|
||||
$temp = <IN>;
|
||||
close(IN);
|
||||
|
|
|
@ -1354,7 +1354,7 @@ This is a list of groups of disk drives that you want to monitor. Each group wil
|
|||
.P
|
||||
WARNING: Every time the number of groups in this option changes, Monitorix will resize the \fIdisk.rrd\fP file accordingly, removing all historical data.
|
||||
.P
|
||||
To collect the disk drive temperatures and health the \fIsmartmontools\fP or the \fIhddtemp\fP command are required.
|
||||
To collect the disk drive temperatures and health the \fIsmartmontools\fP or the \fIhddtemp\fP command are required. \fIsmartmontools\fP will wake up sleeping disk. To avoid this set \fIrespect_standby = y\fP.
|
||||
.P
|
||||
It is recommended that you first check if either \fIsmartctl\fP(8) or \fIhddtemp\fP are able to collect data from the disk drive(s) that you plan to monitor. You may test this with the following command:
|
||||
.P
|
||||
|
|
Loading…
Reference in New Issue