Add use_nan_for_missing_data opton to disk.pm

This commit is contained in:
Andreas Bachlechner 2021-10-10 00:07:13 +02:00
parent 276e04fd83
commit d0c81115a2
1 changed files with 4 additions and 3 deletions

View File

@ -183,6 +183,7 @@ sub disk_update {
my $rrd = $config->{base_lib} . $package . ".rrd";
my $disk = $config->{disk};
my $respect_standby = lc($disk->{respect_standby} || "") eq "y" ? 1 : 0;
my $use_nan_for_missing_data = lc($disk->{use_nan_for_missing_data} || "") eq "y" ? 1 : 0;
my $temp;
my $smart1;
@ -195,9 +196,9 @@ sub disk_update {
# values delimitted by ", " (comma + space)
my @dsk = split(', ', $disk->{list}->{$k});
for($n = 0; $n < 8; $n++) {
$temp = 0;
$smart1 = 0;
$smart2 = 0;
$temp = $use_nan_for_missing_data ? (0+"nan") : 0;
$smart1 = $use_nan_for_missing_data ? (0+"nan") : 0;
$smart2 = $use_nan_for_missing_data ? (0+"nan") : 0;
if($dsk[$n]) {
my $d = trim($dsk[$n]);
$d =~ s/^\"//;