From 6ae34aecaf8c1cd39bf9213acdcb06b4f55ee688 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 21 Feb 2008 21:40:20 +0000 Subject: [PATCH] -Have LED reporting a bit more straightforward/friendlier -rvitals all really returns all except 0xed, which appear to be unintelligible records git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@546 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/data/ibmleds.pm | 6 +++++- xCAT-server-2.0/lib/xcat/plugins/ipmi.pm | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/data/ibmleds.pm b/perl-xCAT-2.0/xCAT/data/ibmleds.pm index 0a7b12c8f..4e2892132 100644 --- a/perl-xCAT-2.0/xCAT/data/ibmleds.pm +++ b/perl-xCAT-2.0/xCAT/data/ibmleds.pm @@ -2,6 +2,9 @@ #ibmleds,tab, mfg,prod_id,led_id,desc package xCAT::data::ibmleds; +my %x3455_leds = ( +0x1 => 'Location' +); my %x3755_leds = ( 0x0065=>'Dimm 6', 0x0011=>'VRM', @@ -53,7 +56,7 @@ my %x3755_leds = ( 0x0056=>'Fan 7', 0x0063=>'Dimm 4', 0x00b0=>'HTX', -0x0001=>'LOCATION', +0x0001=>'Location', 0x000b=>'SEER', 0x0013=>'DASD', 0x00cb=>'Dimm 28', @@ -86,4 +89,5 @@ my %x3755_leds = ( %leds = ( "2,14" => \%x3755_leds, + "2,20566" => \%x3455_leds ); diff --git a/xCAT-server-2.0/lib/xcat/plugins/ipmi.pm b/xCAT-server-2.0/lib/xcat/plugins/ipmi.pm index 521c51992..23dcf648c 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/ipmi.pm @@ -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", @@ -2916,7 +2917,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"))); @@ -2967,10 +2968,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); @@ -3010,7 +3014,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); @@ -3058,6 +3062,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); } @@ -3423,9 +3428,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 "";