Have rvitals avoid requesting the same sensor multiple times
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16773 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
0ae570f73d
commit
dbd453d0a6
@ -4726,15 +4726,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