07
2024
11
21:03:02

当网页打不开的时候,可以通过ssh操作HP iLO

通过HP服务器的iLO可以远程开关机,安装操作系统,诊断故障等。但是老的HP服务器上支持的浏览器是老版本的IE,现在使用就不方便了。

除了安装操作系统,其他任务也可以通过命令模式来完成。命令模式也分两种:通过ssh登入iLO,或者使用ipmitool。篇幅有限,这里就简单说说ssh。

openssh在不断升级,弃用不安全的加密算法,所以折腾了几次,最后KexAlgorithms、HostKeyAlgorithms和cipher都必须强制指定用废弃的

















$ ssh administrator@192.168.10.100Unable to negotiate with 192.168.10.100 port 22: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
$ ssh -o KexAlgorithms=diffie-hellman-group14-sha1 administrator@192.168.10.100Unable to negotiate with 192.168.10.100 port 22: no matching host key type found. Their offer: ssh-dss
$ ssh -o HostKeyAlgorithms=+ssh-dss -o KexAlgorithms=diffie-hellman-group14-sha1 administrator@192.168.10.100Unable to negotiate with 192.168.10.100 port 22: no matching cipher found. Their offer: aes256-cbc,aes192-cbc,aes128-cbc,3des-cbc
$ ssh -c aes256-cbc -o HostKeyAlgorithms=+ssh-dss -o KexAlgorithms=diffie-hellman-group14-sha1 administrator@192.168.10.100
User:administrator logged-in to ILOCNG114S6K7.(192.168.10.100)iLO 3 Advanced 1.16 at  Dec 17 2010Server Name: host is unnamedServer Power: Off</>hpiLO->

然后可以用help求助













































</>hpiLO-> help
status=0status_tag=COMMAND COMPLETED
DMTF SMASH CLP Commands:
help    : Used to get context sensitive help.show    : Used to display values of a property or contents of a collection target.create  : Used to create new instances in the name space of the MAP. Example: create /map1/accounts1 username=<lname1> password=<pwd12345> name= <dname1> group=<admin,config,oemhp_vm,oehmp_rc,oemhp_power>
delete  : Used to destroy instances in the name space of the MAP. Example: delete /map1/accounts1/<lname1>
load    : Used to move a binary image from an URL to the MAP. Example : load -source http://192.168.1.1/images/fw/iLO3_130.bin
reset   : Causes a target to cycle from enabled to disabled and back to enabled.
set     : Used to set a property or set of properties to a specific value.start   : Used to cause a target to change state to a higher run level.stop    : Used to cause a target to change state to a lower run level.cd      : Used to set the current default target.   Example: cd targetname
exit    : Used to terminate the CLP session.version : Used to query the version of the CLP implementation or other CLP elements.
oemhp_ping    : Used to determine if an IP address is reachable from this iLO 3.Example : oemhp_ping 192.168.1.1 , where 192.168.1.1 is the IP address that you wish to ping
oemhp_loadSSHKey    : Used to authorize a SSH Key File from an URLExample : oemhp_loadSSHKey -source http://UserName:password@192.168.1.1/images/SSHkey1.pub
HP CLI Commands:
POWER    : Control server power.UID      : Control Unit-ID light.NMI      : Generate an NMI.VM       : Virtual media commands.VSP      : Invoke virtual serial port.TEXTCONS : Invoke Remote Text Console.

命令也可以help

















</>hpiLO-> HELP SHOW
status=0status_tag=COMMAND COMPLETED
show    : Used to display values of a property or contents of a collection target. Example:  </>accounts/hpiLO-> show admin
  /accounts/admin     Targets     Properties       username=admin       password=********       name=admin       group=admin, config, oemhp_power     Verbs       cd version exit show delete set

这台机器开机自检就重启,面板上温度告警,看看日志似乎符合
















</>hpiLO-> show /system1/log1/record*
status=0status_tag=COMMAND COMPLETED
/system1/log1/record*  Targets  Properties    number=-1    severity=Repaired    date=08/13/2020    time=07:59    description=System Overheating (Zone 1, Location Ambient, Temperature 43C)  Verbs    cd version exit show set

实际情况是这台服务器传感器出了问题,导致自动重启。这是HP Prolaint DL360服务器的问题,从G6到G10,都有温度误报导致重启的情况,当然这种情况并不多。

常用命令

添加新用户


















</>hpiLO-> create /map1/accounts1 username=HPadmin password=Passw0rd
status=0status_tag=COMMAND COMPLETEDUser added successfully.</>hpiLO-> show /map1/accounts1                                          
status=0status_tag=COMMAND COMPLETED
/map1/accounts1  Targets    Administrator    HPadmin  Properties  Verbs    cd version exit show create delete set
开关机


























</>hpiLO-> help power
status=0status_tag=COMMAND COMPLETED
POWER  : The power command is used to change the power state of the server and is limited to users with the Power and Reset privilegeUsage:  power -- Displays the current server power state  power on -- Turns the server on  power off -- Turns the server off  power off hard -- Force the server off using press and hold
</>hpiLO-> power on
status=0status_tag=COMMAND COMPLETED
Server powering on .......
</>hpiLO-> power off                
status=0status_tag=COMMAND COMPLETED
Server powering off .......

远程开关指示灯,就是那个蓝色UID



</>hpiLO-> uid on  </>hpiLO-> uid off
更多
日志总数有限,只能猜测位置去看






































</>hpiLO-> show /map1/log1
</>hpiLO-> show /system1/log1
</>hpiLO->  show /system1/log1/record420
status=0status_tag=COMMAND COMPLETED

/system1/log1/record420  Targets  Properties    number=420    severity=Caution    date=01/24/2024    time=10:57    description=POST Error: 1784-Drive Array Drive Failure  Verbs    cd version exit show set

</>hpiLO->  show /system1/log1/record428
status=0status_tag=COMMAND COMPLETED

/system1/log1/record428  Targets  Properties    number=428    severity=Caution    date=11/06/2024    time=14:43    description=POST Error: 207-Memory initialization error on Processor 1 DIMM 6. The operating system may not have access to all of the memory installed in the system.  Verbs    cd version exit show set

也有粗暴的方法,完全显示


</>hpiLO->  show -a

参数 -a 可以看到所有,比如固件,CPU,内存,电源,网络,日志等等






























































/map1  Targets    firmware1    accounts1    log1    enetport1    dhcpendpt1    dnsendpt1    gateway1    dnsserver1    dnsserver2    dnsserver3    dhcpserver1    settings1    config1    snmp1    oemhp_dircfg1    oemhp_vm1    vlan1    oemhp_ssocfg1  Properties    name=iLO 3 Advanced    license=xxxxxxxLTZSRYKJR  Verbs    cd version exit show reset set oemhp_ping
/map1/firmware1  Targets  Properties    version=1.16    date=Dec 17 2010  Verbs    cd version exit show load set
/map1/accounts1  Targets    Administrator  Properties  Verbs    cd version exit show create delete set/system1/cpu1  Targets    logical_processor1    logical_processor2    logical_processor3    logical_processor4  Properties    speed=2133MHz    cachememory1=128KBz    cachememory2=1024KBz    cachememory3=4096KBz  Verbs    cd version exit show set/system1/memory3  Targets  Properties    size=2048 MB    speed=1333 MHz    location=PROC 1 DIMM 3A  Verbs    cd version exit show set




推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

本文链接:https://hqyman.cn/post/8376.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:
打赏





休息一下~~


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

请先 登录 再评论,若不是会员请先 注册

您的IP地址是: