From 8ac306d2d31794e2faa8e4d03afaa68488531861 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 19 Nov 2007 20:43:17 +0000 Subject: [PATCH] Implement watts rvitals for blades git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@64 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/usr/lib/xcat/plugins/blade.pm | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/xCAT-server-2.0/usr/lib/xcat/plugins/blade.pm b/xCAT-server-2.0/usr/lib/xcat/plugins/blade.pm index 2749fd175..0d49e556f 100644 --- a/xCAT-server-2.0/usr/lib/xcat/plugins/blade.pm +++ b/xCAT-server-2.0/usr/lib/xcat/plugins/blade.pm @@ -351,12 +351,30 @@ sub vitals { my @vitems; foreach (@_) { if ($_ eq 'all') { - push @vitems,qw(temp,voltage,fan,summary); + push @vitems,qw(temp,wattage,voltage,fan,summary); } else { push @vitems,split( /,/,$_); } } my $tmp; + if (grep /watt/,@vitems) { + if ($slot < 8) { + $tmp = $session->get(["1.3.6.1.4.1.2.3.51.2.2.10.2.1.1.7.".($slot+16)]); + } else { + $tmp = $session->get(["1.3.6.1.4.1.2.3.51.2.2.10.3.1.1.7.".($slot+9)]); + } + unless ($tmp =~ /Not Readable/) { + if ($tmp =~ /(\d+)W/) { + $tmp = "$1 Watts (". int($tmp * 3.413+0.5)." BTUs/hr)"; + } + $tmp =~ s/^/Power Usage:/; + + + push @output,"$tmp"; + } + } + + if (grep /fan/,@vitems or grep /blower/,@vitems) { $tmp=$session->get(['1.3.6.1.4.1.2.3.51.2.2.3.1.0']); push @output,"Blower 1: $tmp";