push @info, sprintf('%s: %s', $global{'product'}, $global_info{$global_status_map{$global{'status'}}}); my @ts = getEnabledSensors($baseOidTemp . '.1.5'); my @hs = getEnabledSensors($baseOidHumi . '.1.5'); foreach my $s (@ts) { checkTempSensor($s); } foreach my $s (@hs) { checkHumiSensor($s); } } sub checkTempSensor { my $id = shift; my $oid = $baseOidTemp; my %result = fetchOids({ $oid . '.1.1.' . $id => 'description', # Sensor name / description $oid . '.1.14.' . $id => 'degree', # Currently measured degree $oid . '.1.4.' . $id => 'status', # Sensor status, see %status_map $oid . '.1.7.' . $id => 'highWarning', # Configured upper warning threshold $oid . '.1.8.' . $id => 'highCritical', # Configured upper critical threshold $oid . '.1.9.' . $id => 'lowWarning', # Configured lower warning threshold $oid . '.1.10.' . $id => 'lowCritical', # Configured lower critical threshold $oid . '.1.12.' . $id => 'degreeType', # fahr(0), celcius(1) }); $performance{sanitize($result{'description'})} = sprintf( "%.2f%s;%.1f:%.1f;%.1f:%.1f", $result{'degree'} / 10, $degree_map{$result{'degreeType'}}, $result{'lowWarning'}, $result{'highWarning'}, $result{'lowCritical'}, $result{'highCritical'} ); push @info, sprintf( '%s Temperature sensor "%s": %.2f%s (%.1f:%.1f/%.1f:%.1f)', $status_map{$result{'status'}}, $result{'description'}, $result{'degree'} / 10, $degree_map{$result{'degreeType'}}, $result{'lowWarning'}, $result{'highWarning'}, $result{'lowCritical'}, $result{'highCritical'} ); }