-Merge r644 and 643 to restore functionality destroyed by r644

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@652 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-03-03 20:51:36 +00:00
parent 7cf13128e6
commit 050c712c01

View File

@ -62,6 +62,7 @@ my $passwd;
my $timeout;
my $port;
my $debug;
my $ndebug = 0;
my $sock;
my @user;
my @pass;
@ -107,7 +108,7 @@ my %codes = (
);
my %units = (
0 => "unspecified",
0 => "", #"unspecified",
1 => "C",
2 => "F",
3 => "K",
@ -2069,15 +2070,14 @@ sub decodealert {
if ($trap =~ /xCAT_plugin::ipmi/) {
$trap=shift;
}
my $node = shift;
my $pet = shift;
my $rc;
my $text;
($rc,$text) = initsdr();
($rc,$text) = initsdr();
if($rc != 0) {
return($rc,$text);
return($rc,$text);
}
my $type;
@ -2155,7 +2155,6 @@ sub decodealert {
$sev = "UNKNOWN-SEVERITY:$sev";
}
$text = "$sev:";
#print "sev=$sev\n";
($rc,$type,$desc) = getsensorevent($sensor_type,$offset,"ipmisensorevents");
if($rc == 1) {
@ -2164,8 +2163,6 @@ sub decodealert {
$rc = 0;
}
#print "type=$type, desc=$desc\n";
if($event_type <= 0x0c) {
my $gtype;
my $gdesc;
@ -2189,7 +2186,6 @@ sub decodealert {
if($type eq $desc) {
$desc = "";
}
#print "type=$type, desc=$desc\n";
my $extra_info = getaddsensorevent($sensor_type,$offset,$event_data_1,$event_data_2,$event_data_3);
if($extra_info) {
@ -2204,8 +2200,6 @@ sub decodealert {
$text = "$text $type,";
$text = "$text $desc";
#print "type=$type, desc=$desc\n";
my $key;
my $sensor_desc = sprintf("Sensor 0x%02x",$sensor_num);
foreach $key (keys %sdr_hash) {
@ -2219,7 +2213,6 @@ sub decodealert {
}
$text = "$text ($sensor_desc)";
#print "sensor_sedc=$sensor_desc\n";
if($event_dir) {
$text = "$text - Recovered";
@ -2927,7 +2920,7 @@ sub checkleds {
if ($returnd[38-$authoffset] != 0) {
#It's on...
if ($returnd[42-$authoffset] == 4) {
push(@output,sprintf("LED 0x%02x%02x (%s) active to indicate BIOS detected error (or user requested LED activity)",$led_id_ms,$led_id_ls,getsensorname($mfg_id,$prod_id,$sdr->led_id,"ibmleds")));
push(@output,sprintf("BIOS or admininstrator has %s lit",getsensorname($mfg_id,$prod_id,$sdr->led_id,"ibmleds")));
}
elsif ($returnd[42-$authoffset] == 3) {
push(@output,sprintf("A user has manually requested LED 0x%04x (%s) be active",$sdr->led_id,getsensorname($mfg_id,$prod_id,$sdr->led_id,"ibmleds")));
@ -2978,10 +2971,13 @@ sub vitals {
my $value;
my $format = "%-30s%8s %-20s";
my $per = " ";
my $doall;
$doall=0;
$rc=0;
if($subcommand eq "all") {
@sensor_filters=(0x01,0x02,0x03,0x04);
@sensor_filters=(0x01); #,0x02,0x03,0x04);
$doall=1;
}
elsif($subcommand =~ /temp/) {
@sensor_filters=(0x01);
@ -3021,7 +3017,7 @@ sub vitals {
foreach $key (sort {$sdr_hash{$a}->id_string cmp $sdr_hash{$b}->id_string} keys %sdr_hash) {
my $sdr = $sdr_hash{$key};
if($sdr->sensor_type == $filter && $sdr->rec_type == 0x01) {
if(($doall and not $sdr->sensor_type==0xed) or ($sdr->sensor_type == $filter && $sdr->rec_type == 0x01)) {
my $lformat = $format;
($rc,$reading) = readsensor($sdr->sensor_number);
@ -3069,6 +3065,7 @@ sub vitals {
$unitdesc = "F (" . int($c + .5) . " C)";
}
}
#$unitdesc.= sprintf(" %x",$sdr->sensor_type);
$text = sprintf($lformat,$sdr->id_string . ":",$reading,$per.$unitdesc);
push(@output,$text);
}
@ -3434,9 +3431,11 @@ sub getsensorname
if ($file eq "ibmleds") {
if ($xCAT::data::ibmleds::leds{"$mfgid,$prodid"}->{$sensor}) {
return $xCAT::data::ibmleds::leds{"$mfgid,$prodid"}->{$sensor};
return $xCAT::data::ibmleds::leds{"$mfgid,$prodid"}->{$sensor}. " LED";
} elsif ($ndebug) {
return "Unknown $sensor/$mfgid/$prodid";
} else {
return "";
return sprintf ("LED 0x%x",$sensor);
}
} else {
return "";