From aa913505778b7c2a6d708934d07fc971e4faff69 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 28 Mar 2008 17:35:08 +0000 Subject: [PATCH] -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 --- xCAT-client-2.0/bin/switchblade | 1 + xCAT-server-2.0/lib/xcat/plugins/blade.pm | 43 +++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 120000 xCAT-client-2.0/bin/switchblade diff --git a/xCAT-client-2.0/bin/switchblade b/xCAT-client-2.0/bin/switchblade new file mode 120000 index 000000000..b1c9eea11 --- /dev/null +++ b/xCAT-client-2.0/bin/switchblade @@ -0,0 +1 @@ +xcatclient \ No newline at end of file diff --git a/xCAT-server-2.0/lib/xcat/plugins/blade.pm b/xCAT-server-2.0/lib/xcat/plugins/blade.pm index b25b89131..e370b926e 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/blade.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/blade.pm @@ -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") {