-Add switchblade command to manipulate media tray/KVM ownership in IBM Bladecenter

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@932 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-03-28 17:35:08 +00:00
parent 65e5b92b68
commit aa91350577
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1 @@
xcatclient

View File

@ -31,6 +31,7 @@ sub handled_commands {
rspconfig => 'nodehm:mgt',
rbootseq => 'nodehm:bootseq,mgt',
reventlog => 'nodehm:eventlog,mgt',
switchblade => 'nodehm:mgt',
};
}
my %usage = (
@ -465,6 +466,46 @@ sub mpaconfig {
}
sub switchblade {
#OIDS of interest:
#1.3.6.1.4.1.2.3.51.2.22.1.1 media tray ownership
#1.3.6.1.4.1.2.3.51.2.22.1.2 kvm ownership
my @args=@_;
my $data;
my @rettext;
my $domt=0;
my $dokvm=0;
my $targnum=$slot;
if ($args[1] =~ /^\d+$/) {
$targnum = $args[1];
}
if ($args[0] eq "list" or $args[0] eq "stat") {
$data = $session->get(["1.3.6.1.4.1.2.3.51.2.22.1.1.0"]);
push @rettext,"Media Tray slot: $data";
$data = $session->get(["1.3.6.1.4.1.2.3.51.2.22.1.1.0"]);
push @rettext,"KVM slot: $data";
} elsif ($args[0] eq "both") {
$domt=1;
$dokvm=1;
} elsif ($args[0] eq "mt" or $args[0] eq "media") {
$domt=1;
} elsif ($args[0] eq "kvm" or $args[0] eq "video") {
$dokvm=1;
}
if ($domt) {
setoid("1.3.6.1.4.1.2.3.51.2.22.1.1",0,$targnum);
$data = $session->get(["1.3.6.1.4.1.2.3.51.2.22.1.1.0"]);
push @rettext,"Media Tray slot: $data";
}
if ($dokvm) {
setoid("1.3.6.1.4.1.2.3.51.2.22.1.2",0,$targnum);
$data = $session->get(["1.3.6.1.4.1.2.3.51.2.22.1.1.0"]);
push @rettext,"KVM slot: $data";
}
return 0,@rettext;
}
sub bootseq {
my @args=@_;
my $data;
@ -993,6 +1034,8 @@ sub bladecmd {
return mpaconfig(@args);
} elsif ($command eq "rbootseq") {
return bootseq(@args);
} elsif ($command eq "switchblade") {
return switchblade(@args);
} elsif ($command eq "getmacs") {
return getmacs(@args);
} elsif ($command eq "rinv") {