1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 惠普服务器查询ilo信息 HP服务器配置ilo地址

惠普服务器查询ilo信息 HP服务器配置ilo地址

时间:2020-11-07 21:13:36

相关推荐

惠普服务器查询ilo信息 HP服务器配置ilo地址

安装工具hponcfg

rpm -ivh /share/perdir/chaichuan/ipmi/hponcfg-4.3.0-0.x86_64.rpm

查看帮助 hponcfg ?

192.168.2.145 [/opt] -12-15 16:16:06

root@pts/0 # hponcfg ?

HP Lights-Out Online Configuration utility

Version 4.2.0 Date 6/10/ (c) Hewlett-Packard Company,

Firmware Revision = 1.30 Device type = iLO 4 Driver name = hpilo

Error: Syntax Error.

USAGE:

hponcfg -?

hponcfg -h

hponcfg -m minFw

hponcfg -r [-m minFw ]

hponcfg [-a] -w filename [-m minFw]

hponcfg -g [-m minFw]

hponcfg -f filename [-l filename] [-s namevaluepair] [-v] [-m minFw]

hponcfg -i [-l filename] [-s namevaluepair] [-v] [-m minFw]

-h, --help Display this message

-? Display this message

-r, --reset Reset the Management Processor to factory defaults

-f, --file Get/Set Management Processor configuration from "filename"

-i, --input Get/Set Management Processor configuration from the XML input

received through the standard input stream.

-w, --writeconfig Write the Management Processor configuration to "filename"

-a, --all Capture complete Management Processor configuration to the file.

This should be used along with '-w' option

-l, --log Log replies to "filename"

-v, --xmlverbose Display all the responses from Management Processor

-s, --substitute Substitute variables present in input config file

with values specified in "namevaluepairs"

-g, --get_hostinfo Get the Host information

-m, --minfwlevel Minimum firmware level

HP DL388 gen9

导出ILO普通配置

hponcfg -w /tmp/hp_ilo.xml

导出ILO所有配置

hponcfg -aw /tmp/hp_ilo.xml

修改后导入配置

hponcfg -f /tmp/hp_ilo.xml

HP DL380 gen8

导出ILO普通配置

hponcfg -w /tmp/hp_ilo.xml

导出ILO所有配置

hponcfg [-a] -w /tmp/hp_ilo.xml

修改后导入配置

hponcfg -f /tmp/hp_ilo.xml

other

hponcfg -w /tmp/outpu.xml 导出ILO 配置文件

导入配置

需要删除用户信息:

USER_NAME = "user"

USER_LOGIN = "user"

PASSWORD = "%user_password%">

配置ilo脚本参考

#!/bin/bash

## the scripts from chaichuan

dell=$(dmidecode | grep -ci dell)

hp=$(dmidecode |grep -ci hp)

if [[ ${hp} -gt 0 ]]

then

hostip=`bash /share/yunwei/shell/commonapi/get_hostip_01.sh|awk -F '168.' '{print $2}'`

echo -e "\033[32m ----check hponcfg---- \033[0m"

echo ""

rpm -qa|grep hponcfg

if [ $? != 0 ]

then

echo -e "\033[31m Warning: hponcfg faild \033[0m"

echo ""

echo -e "\033[32m install hponcfg \033[0m"

rpm -ivh /share/perdir/chaichuan/ipmi/hponcfg-4.3.0-0.x86_64.rpm >/dev/null 2>&1

else

echo -e "\033[32m hponcfg is OK! \033[0m"

fi

echo ""

echo -e "\033[32m ----configure ilo---- \033[0m"

echo ""

if [ -f /root/ilo.xml ]

then

rm /root/ilo.xml

/sbin/hponcfg -w /root/ilo.xml >/dev/null 2>&1

else

/sbin/hponcfg -w /root/ilo.xml >/dev/null 2>&1

fi

grep user /root/ilo.xml >/dev/null 2>&1

if [ $? == 0 ]

then

cat << EOF > /root/ilo.xml

EOF

/sbin/hponcfg -f /root/ilo.xml >/dev/null 2>&1

else

cat << EOF > /root/ilo.xml

USER_NAME = "user"

USER_LOGIN = "user"

PASSWORD = "passwd">

EOF

/sbin/hponcfg -f /root/ilo.xml >/dev/null 2>&1

fi

if [ $? == 0 ]

then

echo ""

echo -e "\033[32m configure is OK! \033[0m"

echo ""

else

echo ""

echo -e "\033[31m configure is error! \033[0m"

echo ""

exit 0

fi

sleep 2

echo ""

echo -e "\033[32m ----check ilo---- \033[0m"

echo ""

rpm -qa|grep -w nc >/dev/null 2>&1

if [ $? != 0 ]

then

yum -y install nc >/dev/null 2>&1

fi

/usr/bin/nc -z -w 3 172.17.$hostip 443

if [ $? != 0 ]

then

echo -e "\033[31m 172.17.$hostip: ilo is error! \033[0m"

echo ""

echo ""

else

echo -e "\033[32m ilo is OK! \033[0m"

echo ""

echo ""

fi

else

exit 0

fi

Ps:/share/yunwei/shell/commonapi/get_hostip_01.sh 脚本内容如下:

echo `/sbin/ip a | grep -E "eth[0-9]$|em[0-9]$|br[0-9]$|bond[0-9]$" |grep "/2" | awk '{print $2}'|awk -F "/" '{print $1}' | grep 192.168 | awk -F '.' '$3 < 30 {print $0}'`

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。