Server out of band management

Keywords: Operation & Maintenance network Mac Linux Windows

In daily operation and maintenance, we may receive the equipment handed over by others, but for many reasons, the previous people did not record the relevant server serial number, unset out of band address and user password of out of band management, etc., and the server cannot be shut down for maintenance. Is there any way to obtain relevant information without restarting? The answer is yes.
For linux system, if the operating system supports yum, you can install it directly from yum install -y ipmitool. If not, you need to. http://ipmitool.sourceforge.net/ Download the tar.gz package and upload it to the server. Here is an example:
ipmitool-1.8.18.tar.gz installation.

  1. Download ipmitool: http://ipmitool.sourceforge.net/
  2. Make sure the gcc tool is installed
  3. Load and enable IPMI driver on Linux system:
    insmod /lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/char/ipmi/ipmi_msghandler.ko
    insmod /lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/char/ipmi/ipmi_devintf.ko
    insmod /lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/char/ipmi/ipmi_si.ko
  4. Check if ipmi0 appears in your / dev Directory:
    ls -l /dev/ipmi*
  5. Unzip ipmitool-1.8.18.tar.gz
    tar zxvf ipmitool-1.8.18.tar.gz
  6. cd ipmitool-1.8.18
  7. To start installing ipmitool:
    ./configure && make && make install
  8. The ipmitool command will be installed to / usr/local/bin/ipmitool
  9. Now you can use it

After the installation, you can set the ip of irac on the linux operating system, modify the user, and test whether the snmp is normal.
Configure IP:
ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr 10.60.237.
ipmitool lan set 1 netmask 255.255.255.0
ipmitool lan set 1 defgw ipaddr 10.60.237.254
ipmitool lan print 1 (print local bmc lan configuration)
Modify user:
dell:
ipmitool user list 1
ipmitool user set password 2 monitor123$
hp:
ipmitool user list 2
ipmitool user set password 1 monitor123$
Test snmp:
ipmitool-I open event 1 sends a message of over temperature to the System Event Log
2) for Windows operating system, there is no tool to set ip in the case of local windows.
III) for how to manage the out of band machines that have been configured for the out of band machine, you can manage the windows machine through IPMIView (interface mode) or ipmiOM-BMC-Dell-Web-WIN (command mode ipmish), and the linux machine can also be managed through the first installation method above. The command is as follows:
When obtaining server monitoring information remotely, you need to add the address of the remote server. Use the following command format:
ipmitool -H 10.60.237. -U root -P changeme -I lan command.
Where - H is followed by the address of the server, - U is followed by the user name, - P is followed by the user password, and command is the same as local access information.
For example, see the following serial number:
ipmitool -H $HOST -U $USER -P $PASSWD -I lan fru

When we know the out of band ip and out of band user password in the first step, we can manage them through a management machine according to the above tools.

The following is the command for ipmitool to get server information:

#!/bin/bash
#The test requirements are as follows:

1. All commands are implemented through the ipmitool command

2. All commands are tested without operating system

HOST=$1
USER=$2
PASSWD=$3

function getinfo()
{

1. Get the network configuration information of the server

echo -e "\n\n=======Networking Configurations:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan print
# 2. Get the temperature information of the server
echo -e "\n\n=======Ambient Temprature:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Ambient Temp"
# 3. Obtain the power information of the server
echo -e "\n\n=======System Level:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "System Level"

# 4. Obtain the serial number information of the server
echo -e "\n\n=======Serial Number(Fru):"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD fru
# 5. Get the MAC of the server
echo -e "\n\n=======Mac Address(only Dell):"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD delloem mac

# 6. Get the asset number information of the server
echo -e "\n\n=======Serial Number(Fru):"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "System Level"

# 7. Time to get the management card of the server
echo -e "\n\n=======Date and Time:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sel time get
# 8. View management card configuration mode
echo -e "\n\n=======Lan set Mode:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD delloem lan get
# 9. View SOL baud rate
echo -e "\n\n=======Volatile Bit Rate (kbps):"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1

}

function operation()
{

1. Start, shut down and restart the server

echo -e "\n\n=======Power:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD power
ipmitool -I lan -H $HOST -U $USER -P $PASSWD power status

# 2. The server adds users, sets passwords, and grants permissions
echo -e "\n\n=======USER:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD user list 1
ipmitool -I lan -H $HOST -U $USER -P $PASSWD user set name 10 test1
ipmitool -I lan -H $HOST -U $USER -P $PASSWD user set password 10 test1pwd
ipmitool -I lan -H $HOST -U $USER -P $PASSWD user enable 10
ipmitool -I lan -H $HOST -U $USER -P $PASSWD user list 1
# 1-CALLBACK ,2-USER ,3-OPERATOR ,4-ADMNISTRATOR
echo -e "\n\n=======User privilage:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD user priv 10 4 1
ipmitool -I lan -H $HOST -U $USER -P $PASSWD user list 1

# 3. Management card IP configuration mode conversion (DHCP / static IP)
echo -e "\n\n=======OOB IP Mode:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 ipsrc 
ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 ipsrc static
ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan print

# 4. Modify IP address of management card
echo -e "\n\n=======Set IP:"
read -p "modify oob ip, please use the current network : " oobip
read -p "modify oob netmask : " netmask
read -p "modify oob gateway : " oobgw
ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 ipaddr $oobip
ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 netmask $netmask
ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 defgw ipaddr $oobgw
ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan print

# 5. Management card configuration mode conversion (independent / shared) dell only
echo -e "\n\n=======Lan Mode:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD delloem lan
#ipmitool -I lan -H HOST?U

USER -P $PASSWD delloem lan set dedicated

# 6. Set SOL baud rate
echo -e "\n\n=======Sol volatile-bit-rate:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol set non-volatile-bit-rate 115.2 1
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol set non-volatile-bit-rate 57.6 1
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1

# 7.SOL mode on and off
echo -e "\n\n=======Sol enable and disable:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol set enabled true 1
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol set enabled false 1
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1

}

function extrainfo()
{
echo -e "\n\n\n=======Extra infomation:"

cpu Information

echo -e "\n\n=======cpu Model:"
echo -e "\n\n=======cpu Physical number:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr elist | grep 'Status' #Provided by Huawei, seemingly inaccurate
echo -e "\n\n=======cpu Current frequency:"

#Memory information
echo -e "\n\n=======Memory type:"
echo -e "\n\n=======Memory quantity:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr elist | grep 'DIMM'

#Hard disk information
echo -e "\n\n=======Hard disk brand:"
echo -e "\n\n=======Hard disk SN:"
echo -e "\n\n=======Hard disk model:"

#power
echo -e "\n\n=======Current overall power consumption of server:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Pwr"
echo -e "\n\n=======Server AC actual supply voltage:"     #Not supported or not found
echo -e "\n\n=======Server DC 3.3V,5V And 12 V Actual supply voltage:"

#Fan
echo -e "\n\n=======Number and speed of fans:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Fan"

#temperature
echo -e "\n\n=======Server air inlet temperature:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Inlet"
echo -e "\n\n=======Server air outlet temperature:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Exhaust Temp"
echo -e "\n\n=======CPU Current temperature:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Temp"

#Status: record and display of abnormal status based on collected information
echo -e "\n\n=======Record and display of abnormal state based on collected information:"

#Network: Mac address
echo -e "\n\n=======Remote management card and all network ports on the main board MAC address:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan print |grep "MAC Address"

#Time: collect the current clock information of the management card, and display it in the format of "MM DD YY, HHM s".
echo -e "\n\n=======Collect the current clock information of the management card, and display it in the format of "MM DD YY HHM s".:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sel time get

#Events: exception events, operation events, login event records
echo -e "\n\n=======Abnormal event, operation event and login event record:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sel list

}

function extraop()
{
#Through the network, command line mode completes the following functions:

#1. Specify specific port PXE boot
echo -e "\n\n=======Specify a specific port PXE start-up:"
ipmitool -I lan -H $HOST -U $USER -P $PASSWD chassis bootdev pxe   #The specific port cannot be specified. The port can be specified with the help of racadm and other tools. The pxe function of the network card needs to be enabled in the bios.

#2. KVM can be started through the management card (no need to log in to the web interface), and there are relevant permission distinctions (see, operate and other permissions)
echo -e "\n\n=======Can be started by management card KVM(No login required web Interface) and have relevant permission distinction (can see, can operate and other permissions):" #Need config SSO, virtual console or VNC login free mode

#You can set the clock of the management card and use the format of MM DD YY, HHM s.
echo -e "\n\n=======You can set the clock of the management card and use the format of mm / DD / yyyy, HHM / s." #dell feedback management card has no time setting, only BIOS time and NTP
ipmitool -I lan -H $HOST -U $USER -P $PASSWD sel time set

}

echo >$HOST-report.txt
getinfo 2>&1 |tee -a $HOST-report.txt
operation 2>&1 |tee -a $HOST-report.txt
extrainfo 2>&1 |tee -a $HOST-report.txt
extraop 2>&1 | tee -a $HOST-report.txt

Posted by sunnyvatsal on Tue, 22 Oct 2019 00:27:24 -0700