Ibm

從 Linux (IBM BladeCenter) 發現分配的刀片名稱

  • November 7, 2011

在管理模組螢幕的 IBM 刀片中心中,我將機器的名稱配置為如下

刀片任務 –> 配置 –> 刀片資訊 –> 名稱(我在 Bay 12 中輸入了 –> machine1)

之後我在這台機器(Bay 12)上安裝了 Linux 機器 redhat 5.3

我的問題:是否可以從我已經通過某些命令安裝的 linux 中找到名稱:machine1?或通過其他一些技巧/操縱?

   example from linux ( But I not get the machine1 name ? )

   dmidecode|grep Location
   Location In Chassis: Slot12
   Location: Internal
   Location: Internal
   Location: Internal
   Location: Internal
   Location: Proprietary Add-on Card

啟動 IPMI 服務,然後以下腳本將列印出 IBM Blade Name:

#!/usr/bin/env python
# Copyright 2009-2011 Net Direct Inc.
# Written by: Michael Brown <michael@netdirect.ca>

# Must be run as root

import subprocess

def readIbmBladeName():
   rawcmd = 'ipmitool raw 0x2e 0x0a 0xd0 0x51 0x00 0xf0 0x08 0x10 0x10'
   ipmitool = subprocess.Popen(rawcmd.split(), stdout=subprocess.PIPE)
   rawname = ipmitool.communicate()[0].strip().replace('\n','').split()
   name = ''.join([chr(int(x,16)) for x in rawname[3:]])
   return name

def main():
   print(readIbmBladeName())

if (__name__ == '__main__'):
   main()

引用自:https://serverfault.com/questions/328408