mirror of https://github.com/mikaku/Monitorix.git
Add use_nan_for_missing_data to nvme.pm
This commit is contained in:
parent
1dfa33d662
commit
c87fe89db4
|
@ -189,6 +189,7 @@ sub nvme_update {
|
||||||
my ($package, $config, $debug) = @_;
|
my ($package, $config, $debug) = @_;
|
||||||
my $rrd = $config->{base_lib} . $package . ".rrd";
|
my $rrd = $config->{base_lib} . $package . ".rrd";
|
||||||
my $nvme = $config->{nvme};
|
my $nvme = $config->{nvme};
|
||||||
|
my $use_nan_for_missing_data = lc($nvme->{use_nan_for_missing_data} || "") eq "y" ? 1 : 0;
|
||||||
|
|
||||||
my $temp;
|
my $temp;
|
||||||
my @smart;
|
my @smart;
|
||||||
|
@ -200,8 +201,8 @@ sub nvme_update {
|
||||||
# values delimitted by ", " (comma + space)
|
# values delimitted by ", " (comma + space)
|
||||||
my @dsk = split(', ', $nvme->{list}->{$k});
|
my @dsk = split(', ', $nvme->{list}->{$k});
|
||||||
for($n = 0; $n < $max_number_of_hds; $n++) {
|
for($n = 0; $n < $max_number_of_hds; $n++) {
|
||||||
$temp = 0;
|
$temp = $use_nan_for_missing_data ? (0+"nan") : 0;
|
||||||
@smart = (0) x $max_number_of_smart_values_in_rrd;
|
@smart = ($use_nan_for_missing_data ? (0+"nan") : 0) x $max_number_of_smart_values_in_rrd;
|
||||||
|
|
||||||
if($dsk[$n]) {
|
if($dsk[$n]) {
|
||||||
my $d = trim($dsk[$n]);
|
my $d = trim($dsk[$n]);
|
||||||
|
|
Loading…
Reference in New Issue