์ ๋ฌด์ ์ผ๋ก ํ๋์จ์ด๋ฅผ ์ ๊ฒํ๊ธฐ ์ํด BMC๋ฅผ ํ์ฉํ๋ ์ผ์ด ๋ง์ต๋๋ค.
BMC(Baseboard Management Controller)๋ ์๋ฒ์ ๋ฌผ๋ฆฌ์ ์ํ๋ฅผ ์๊ฒฉ์ผ๋ก ๋ชจ๋ํฐ๋งํ๊ณ
๊ด๋ฆฌํ ์ ์๋๋ก ์ง์ํ๋ ํ๋์จ์ด ๊ด๋ฆฌ ์นฉ์ ๋๋ค.
Dell์์๋ BMC ์๋ฃจ์ ์ธ iDRAC(Integrated Dell Remote Access Controller)์ ์ ๊ณตํ๊ณ ์์ต๋๋ค.

๊ธฐ๋ณธ iDRAC ๊ด๋ฆฌ๋ ์น ๊ธฐ๋ฐ ์ธํฐํ์ด์ค๋ฅผ ํตํด ์ด๋ฃจ์ด์ง๋๋ค.
์ง๊ด์ ์ธ UI๋ฅผ ํตํด ์๋ฒ ์ํ๋ฅผ ์์ฝ๊ฒ ํ์ธํ ์ ์๊ณ ,
๋ง์ฐ์ค ํด๋ฆญ ๋ช ๋ฒ์ผ๋ก ์ ์ ๊ด๋ฆฌ, ๋ก๊ทธ ํ์ธ ๋ฑ์ ์ค์ ํ ์ ์์ต๋๋ค.

ํ์ง๋ง ๋ค์์ ์๋ฒ๋ฅผ ๊ด๋ฆฌํ ๊ฒฝ์ฐ, ๊ฐ๋ณ์ ์ผ๋ก ์น์ ์ ์ํด์ผ ํ๋ ๋จ์ ์ด ์กด์ฌํฉ๋๋ค.
์๋ฅผ ๋ค์ด ์๋ฒ๊ฐ 100๋๋ผ๋ฉด ๋ธ๋ผ์ฐ์ ์ IP ์ฃผ์๋ฅผ ์ ๋ ฅํ๊ณ ๋ก๊ทธ์ธ ํ๋ ๊ณผ์ ์ 100๋ฒ ์ํํด์ผ ํฉ๋๋ค.
๋ก๊ทธ์ธ ๊ณผ์ ์ดํ ๋ค๋ฅธ ์์ ๋ค์ ํด์ผํ๋ค๋ฉด, ๋ ์ค๋ ์๊ฐ์ด ๊ฑธ๋ฆฌ๊ฒ ์ง์.

RACADM์ ์ด์ฉํ๋ฉด ๋๋ถ๋ถ์ ์์ ์ ์๋ํํ๊ฑฐ๋ ์คํฌ๋ฆฝํธ๋ฅผ ํตํด ๋๊ท๋ชจ๋ก ์คํํ ์ ์์ต๋๋ค.
RACADM(Remote Access Controller Admin)์ iDRAC ๊ธฐ๋ฅ์ ๋ช ๋ น์ค์์ ์ฌ์ฉํ ์ ์๋๋ก ์ ๊ณตํ๋ ๋๊ตฌ์ ๋๋ค.
RACADM Syntax Usage
racadm -r <IPAddr> -u <username> -p <password> <subcommand>
# Example
# racadm -r 192.168.0.2 -u root -p xxxx getsysinfo
# racadm -r 192.168.0.2 -u root -p xxxx serveraction powerup

์๋ฒ๊ฐ ์ฌ๋ฌ ๋์ผ ๋๋ ์๋์ ๊ฐ์ด ์คํฌ๋ฆฝํธ๋ฅผ ์์ฑํ์ฌ ์์ ์ ๊ฐ์ํํ ์ ์์ต๋๋ค.
#!/bin/bash
# IP ์ฃผ์ ๋ฆฌ์คํธ
IP_LIST=("192.168.0.22" "192.168.0.58" "192.168.0.122")
# ์ฌ์ฉ์๋ช
๊ณผ ๋น๋ฐ๋ฒํธ
USERNAME="root"
PASSWORD="calvin"
# ๊ฐ IP์ ๋ํด ๋ช
๋ น์ด ์คํ
for IP in "${IP_LIST[@]}"
do
echo "Checking power status for $IP..."
racadm -r "$IP" -u "$USERNAME" -p "$PASSWORD" serveraction powerstatus
echo "------------------------"
done

RACADM์ ์ ์์ํ ํ์ธ ๋ฟ์๋๋ผ GUI๋ก ์ํํ ์ ์๋ iDRAC ๊ธฐ๋ฅ๋ค์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์๋ ์ฝ๋๋ "lclog view" ๋ช ๋ น์ด๋ฅผ ํ์ฉํด Lifecycle Log ๋ฅผ ํํฐ๋งํ๊ณ ์ ์ฅํ๋ ์คํฌ๋ฆฝํธ์ ๋๋ค.
# racadm_get_lclog.sh
์ง์ ๋ ์๊ฐ ๋ฒ์์ ๋ก๊ทธ๋ฅผ ์์งํ๊ณ ํ์์ ํ์ผ๋ก ์ ์ฅํฉ๋๋ค.
#!/bin/bash
RACUSER="root"
RACPSWD="calvin"
log_output="false" # ๋ก๊ทธ ์ ์ฅ ์ฌ๋ถ
log_base_dir="./LifeCycleLog" # ๊ธฐ๋ณธ ๋ก๊ทธ ์ ์ฅ ๋๋ ํ ๋ฆฌ
start_time=""
end_time=""
# Usage ์ถ๋ ฅ ํจ์
usage() {
echo "Usage: $0 [-h <iDRAC_IP> | -f <file_with_iDRAC_IPs>] [-r <start_time>] [-e <end_time>]"
echo "Options:"
echo " -h <iDRAC_IP> Specify a single iDRAC IP address"
echo " -f <file> Specify a file containing iDRAC IP addresses (one per line)"
echo " -r <start_time> Start time for logs in format 'yyyy-mm-dd HH:MM:SS'"
echo " -e <end_time> End time for logs in format 'yyyy-mm-dd HH:MM:SS'"
exit 1
}
# ๋ก๊ทธ ์ ์ฅ ์ฌ๋ถ ๋ฌป๊ธฐ
ask_log_saving() {
read -p "Do you want to save logs? (y/n): " answer
case $answer in
[Yy]*) log_output="true" ;;
[Nn]*) log_output="false" ;;
*) echo "Invalid input. Defaulting to no log saving."; log_output="false" ;;
esac
}
# ์ต์
์ฒ๋ฆฌ
while getopts "h:f:r:e:" opt; do
case $opt in
h) # ๋จ์ผ iDRAC IP
remote_idrac=$OPTARG
;;
f) # ํ์ผ ์
๋ ฅ
ip_file=$OPTARG
;;
r) # ์์ ์๊ฐ
start_time=$OPTARG
;;
e) # ์ข
๋ฃ ์๊ฐ
end_time=$OPTARG
;;
*) # ์๋ชป๋ ์ต์
usage
;;
esac
done
# ์ต์
์ ํจ์ฑ ๊ฒ์ฆ
if [[ -z $remote_idrac && -z $ip_file ]]; then
echo "Error: You must provide either -h or -f option."
usage
fi
if [[ -n $remote_idrac && -n $ip_file ]]; then
echo "Error: Options -h and -f cannot be used together."
usage
fi
# ๋ก๊ทธ ์ ์ฅ ์ฌ๋ถ ํ์ธ
ask_log_saving
# ๋ ์ง๋ณ ๋ก๊ทธ ๋๋ ํ ๋ฆฌ ์์ฑ
if [[ $log_output == "true" ]]; then
log_date_dir="${log_base_dir}/$(date +"%Y%m%d")"
mkdir -p "$log_date_dir"
echo "Logs will be saved in directory: $log_date_dir"
fi
# iDRAC ๋ก๊ทธ ์ฒ๋ฆฌ ํจ์
process_idrac_logs() {
local ip=$1
echo "Processing iDRAC: $ip"
# ๋ช
๋ น์ด ๊ตฌ์ฑ
if [[ -z $start_time && -z $end_time ]]; then
cmd="racadm -r \"$ip\" -u \"$RACUSER\" -p \"$RACPSWD\" lclog view -s Critical,Warning"
else
cmd="racadm -r \"$ip\" -u \"$RACUSER\" -p \"$RACPSWD\" lclog view -s Critical,Warning -r \"$start_time\" -e \"$end_time\""
fi
# ๋ก๊ทธ ์ ์ฅ ๊ฒฝ๋ก ์์ฑ
if [[ $log_output == "true" ]]; then
timestamp=$(date +"%H%M%S")
log_file="${log_date_dir}/${ip}_${timestamp}.log"
eval "$cmd" 2>&1 | tee "$log_file"
else
eval "$cmd"
fi
# ์ข
๋ฃ ์ฝ๋ ํ์ธ
if [[ $? -ne 0 ]]; then
echo "Warning: Unable to connect to $ip. Skipping..."
return 1
fi
}
# ๋จ์ผ IP ์ฒ๋ฆฌ
if [[ -n $remote_idrac ]]; then
# IP ํ์ ํ์ธ
if [[ ! $remote_idrac =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Invalid IP address format."
exit 1
fi
process_idrac_logs "$remote_idrac"
fi
# ํ์ผ ๋ด IP ์ฒ๋ฆฌ
if [[ -n $ip_file ]]; then
if [[ ! -f $ip_file ]]; then
echo "Error: File '$ip_file' not found."
exit 1
fi
while IFS= read -r ip || [[ -n $ip ]]; do
# IP ํ์ ํ์ธ
if [[ ! $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Warning: Skipping invalid IP address '$ip'"
continue
fi
process_idrac_logs "$ip"
done < "$ip_file"
fi


์ฐธ๊ณ ์๋ฃ
'Hardware > BMC' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[BMC/iDRAC] RACADM์ ์ด์ฉํ Lifecycle Log ์์ง ๋ฐ ์ฒ๋ฆฌํ๊ธฐ (2) | 2024.12.27 |
---|