From a763b29f9c8267684731290812a1d0858730a139 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 19 Nov 2007 20:24:58 +0000 Subject: [PATCH] Add watt/wattage/watts argument to IPMI rvitals git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@63 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/usr/lib/xcat/plugins/ipmi.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xCAT-server-2.0/usr/lib/xcat/plugins/ipmi.pm b/xCAT-server-2.0/usr/lib/xcat/plugins/ipmi.pm index a6dc8f81b..1fcbad962 100644 --- a/xCAT-server-2.0/usr/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server-2.0/usr/lib/xcat/plugins/ipmi.pm @@ -28,7 +28,7 @@ sub handled_commands { my %usage = ( "rpower" => "Usage: rpower [on|off|reset|stat|boot]", "rbeacon" => "Usage: rbeacon [on|off|stat]", - "rvitals" => "Usage: rvitals [all|temp|voltage|fanspeed|power|leds]", + "rvitals" => "Usage: rvitals [all|temp|wattage|voltage|fanspeed|power|leds]", "reventlog" => "Usage: reventlog [all|clear|]", "rinv" => "Usage: rinv [all|model|serial|vpd|mprom|deviceid|uuid]", "rsetboot" => "Usage: rsetboot [net|hd|cd|def|stat]" @@ -2918,8 +2918,11 @@ sub vitals { @sensor_filters=(0x01); } elsif($subcommand eq "voltage") { - @sensor_filters=(0x02,0x03); + @sensor_filters=(0x02); } + elsif($subcommand =~ /watt/) { + @sensor_filters=(0x03); + } elsif($subcommand eq "fanspeed") { @sensor_filters=(0x04); } @@ -2984,6 +2987,10 @@ sub vitals { $per = "% "; } + if($unitdesc eq "Watts") { + my $f = ($reading * 3.413); + $unitdesc = "Watts (".int($f+.5)." BTUs/hr)"; + } if($unitdesc eq "C") { my $f = ($reading * 9/5) + 32; $unitdesc = "C (" . int($f + .5) . " F)";