Friday, December 12, 2014

IPMI command (ipmitool tool)


What is IPMI
IPMI is an abbreviation for Intelligent Platform Management Interface.

The Intelligent Platform Management Interface (IPMI) is a set of computer interface specifications for an autonomous computer subsystem that provides management and monitoring capabilities independently of the host system's CPU, firmware (BIOS or UEFI) and operating system. IPMI defines a set of interfaces used by system administrators for out-of-band management of computer systems and monitoring of their operation. For example, IPMI provides a way to manage a computer that may be powered off or otherwise unresponsive by using a network connection to the hardware rather than to an operating system or login shell.
[reference: http://en.wikipedia.org/wiki/Intelligent_Platform_Management_Interface]


Basely IPMI this tool is to control your bmc ip address, which can read your sensor(such as the component's temperature, battery, and so on), an power consumption types of setting.
A server mean it will stay on for many days or year without shut down. We need this ipmi tool is to see if this server hang, we will be able to debug what happen.

ipmitool can let you server to power or or off. But manly ipmitool is used to fit our bmc addres.

What are come of the useful command to used:

See our power status: 
 ipmitool -I lanplus -H "BMC IP ADDRESS"  -U USERID -P PASSWORD chassis power status

Power on you server
 ipmitool -I lanplus -H "BMC IP ADDRESS"  -U USERID -P PASSWORD chassis power [on/off]

SOL(serial over lan)
SOL is like console redirection, you don't need a debug card or a console port, you can used your lan to see you internal status.

If you don't have a vga card you aren't able to see you host status right?
No, there are three way you can see if you don't have vga card:
by console redirection
by console debug card
by SOL

 ipmitool -I lanplus -H  "BMC IP ADDRESS" -U USERID -P PASSWORD sol activate

DEBUG USED with BMC COMAMND
Some debug ipmitool to used:
If your SUT/DUT(client pc) hang, please execute this command to see what happen, or see previous stop over where .
Need to open two terminal: one connect sol, another execute command raw 0x3c 0x5c

for example:
 ipmitool -I lanplus -H  "BMC IP ADDRESS" -U USERID -P PASSWORD sol activate
and
 ipmitool -I lanplus -H  "BMC IP ADDRESS" -U USERID -P PASSWORD  raw 0x3c 0x5c

See bmc dhcp ip had been release or gone
prerequisite: OS ip must be ping-able, else this is unable to verify
remote to OS by telnet or ssh, and execute this command: ipmitool lan print
reset bmc, see reset bmc command as below.

Reset bmc  by this command
ipmitool raw 0x3c 0x5a

TO BE UPDATED......

Set up dhcp linux


Set up dhcp under linux:


What is a dhcp server 
I will used my paraphrase in my own word. There are many information that you can get from internet.

Basely a dhcp server is a dynamic ip(internet protocol)  address that will assign to the host. Everyone today used internet, we need to connect lan cable to a hub, switch or etc. These hub switch might have a dhcp server in the backbone or in front of them, else it will not be able to assign ip to the host.

A ip address will have a unique ip address, in other word no one is going to have a same ip address.
So the fundamental concept of a dhcp is like this:
1. we set up a dhcp server( linux or window]
2. we prepare a switch , or a hub, and connected to dhcp server.
3 Right now if any host is being connected to the hub or switch, will have a dynamic ip.

I will teach you how to mange an effective ip address for user to used. There are two difference ways of mange dhcp. One is to set a static ip address by an interface mac address, and two is by rang an ip address.


Set up particular pc ip address into static ip. 
If you have many host or more than 10 HOST PC or Server, it is hard to control or manage a dhcp. So we will needed to add a particular interface mac and set a static ip, this will be more easier to know which pc is which.

host ASER_HOSTA {
  hardware ethernet AB:AA:BB:CC:DD:EE;
  fixed-address 192.168.2.100;
}

host ASUS_HOSTB {
  hardware ethernet CD:AA:BB:CC:DD:EE;
  fixed-address 192.168.2.101;
}


Set up a dhcp range
If you need to set up a dhcp server, you can add or not add a rang. I will prefer you add a rang between 101~200, this mean ip will be between 101 and 200. Again this will be easier to manage you dhcp server.

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.101 192.168.1.200;
 option subnet-mask 255.255.255.0;
}


Set up a dhcpv6 range

default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet6 2001:db8:0:1::/64
{
#Range for clients
range6 2001:db8:0:1::129 2001:db8:0:1::254;
}