mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 09:13:08 +00:00
Following changes based on review comments
* Modified to display altitude instead of length * Print an output message if there is no values returned from the BMC
This commit is contained in:
parent
5413376a58
commit
b8894ed38b
@ -67,7 +67,7 @@ OpenPOWER (OpenBMC) specific:
|
||||
=============================
|
||||
|
||||
|
||||
\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | length | all**\ ]
|
||||
\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | altitude | all**\ ]
|
||||
|
||||
|
||||
|
||||
@ -140,9 +140,9 @@ Processor for a single or range of nodes and groups.
|
||||
|
||||
|
||||
|
||||
\ **length**\
|
||||
\ **altitude**\
|
||||
|
||||
Retrieves length related attributes.
|
||||
Retrieves altitude related attributes.
|
||||
|
||||
|
||||
|
||||
|
@ -375,7 +375,6 @@ sub rackenv {
|
||||
push @result, [ $name, $td, $Rc ];
|
||||
if (!exists($request->{verbose})) {
|
||||
|
||||
#if( $td =~ /^Rack altitude in meters/ ) {
|
||||
if ($td =~ /^BPA-B total output in watts/) {
|
||||
last;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ my %usage = (
|
||||
OpenPOWER (IPMI) specific:
|
||||
rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|all]
|
||||
OpenPOWER (OpenBMC) specific:
|
||||
rvitals noderange [temp|voltage|wattage|fanspeed|power|length|all]
|
||||
rvitals noderange [temp|voltage|wattage|fanspeed|power|altitude|all]
|
||||
MIC specific:
|
||||
rvitals noderange {thermal|all}",
|
||||
"reventlog" =>
|
||||
|
@ -32,7 +32,7 @@ B<rvitals> I<noderange> [B<temp>|B<voltage>|B<wattage>|B<fanspeed>|B<power>|B<le
|
||||
|
||||
=head2 OpenPOWER (OpenBMC) specific:
|
||||
|
||||
B<rvitals> I<noderange> [B<temp>|B<voltage>|B<wattage>|B<fanspeed>|B<power>|B<length>|B<all>]
|
||||
B<rvitals> I<noderange> [B<temp>|B<voltage>|B<wattage>|B<fanspeed>|B<power>|B<altitude>|B<all>]
|
||||
|
||||
=head1 B<Description>
|
||||
|
||||
@ -79,9 +79,9 @@ Retrieves rack environmentals.
|
||||
|
||||
Retrieves LEDs status.
|
||||
|
||||
=item B<length>
|
||||
=item B<altitude>
|
||||
|
||||
Retrieves length related attributes.
|
||||
Retrieves altitude related attributes.
|
||||
|
||||
=item B<power>
|
||||
|
||||
|
@ -37,6 +37,8 @@ $::POWER_STATE_POWERING_ON="powering-on";
|
||||
$::POWER_STATE_QUIESCED="quiesced";
|
||||
$::POWER_STATE_RESET="reset";
|
||||
|
||||
$::NO_ATTRIBUTES_RETURNED="No attributes returned from the BMC.";
|
||||
|
||||
sub unsupported {
|
||||
my $callback = shift;
|
||||
if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) {
|
||||
@ -458,7 +460,7 @@ sub parse_args {
|
||||
} elsif ($command eq "rvitals") {
|
||||
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
|
||||
$subcommand = "all" if (!defined($ARGV[0]));
|
||||
unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^length$|^all$/) {
|
||||
unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^altitude$|^all$/) {
|
||||
return ([ 1, "Unsupported command: $command $subcommand" ]);
|
||||
}
|
||||
} else {
|
||||
@ -1235,7 +1237,7 @@ sub rvitals_response {
|
||||
if ($grep_string =~ "power") {
|
||||
unless ( $content{Unit} =~ "Amperes" || $content{Unit} =~ "Joules" || $content{Unit} =~ "Watts" ) { next; }
|
||||
}
|
||||
if ($grep_string =~ "length") {
|
||||
if ($grep_string =~ "altitude") {
|
||||
unless ( $content{Unit} =~ "Meters" ) { next; }
|
||||
}
|
||||
|
||||
@ -1262,6 +1264,8 @@ sub rvitals_response {
|
||||
my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort
|
||||
grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output;
|
||||
xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output);
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node);
|
||||
}
|
||||
|
||||
if ($next_status{ $node_info{$node}{cur_status} }) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user