Have rvitals avoid requesting the same sensor multiple times
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16770 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
3e67ba3e19
commit
2a998b99d9
@ -4789,15 +4789,18 @@ sub vitals {
|
||||
}
|
||||
|
||||
$sessdata->{sensorstoread} = [];
|
||||
my %usedkeys;
|
||||
foreach(keys %sensor_filters) {
|
||||
my $filter = $_;
|
||||
if ($filter eq "energy" or $filter eq "leds") { next; }
|
||||
|
||||
foreach $key (sort {$sdr_hash{$a}->id_string cmp $sdr_hash{$b}->id_string} keys %sdr_hash) {
|
||||
if ($usedkeys{$key}) { next; } #avoid duplicate requests for sensor data
|
||||
my $sdr = $sdr_hash{$key};
|
||||
if(($doall and not $sdr->rec_type == 0x11 and not $sdr->sensor_type==0xed) or ($sdr->rec_type == 0x01 and $sdr->sensor_type == $filter)) {
|
||||
my $lformat = $format;
|
||||
push @{$sessdata->{sensorstoread}},$sdr;
|
||||
$usedkeys{$key}=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user