我管理大量的服务器,我正在尝试编写一个 bash 脚本来使用 ipmitool 检查他们的 BMC。这是我正在做的事情的本质:
...
admin=$(ipmitool -U user -P pasw -I lanplus -H $ipmi user list | grep " user " | awk '{print $1}')
chn=$(ipmitool -U user -P pasw -I lanplus -H 10.100.10.3 channel info | grep -e '^Channel.*info:' | awk '{print $2}')
ipmitool -U user -P pasw -I lanplus -H $ipmi user priv $admin 4 $chn
ipmitool -U user -P pasw -I lanplus -H $ipmi channel setaccess $chn $admin callin=on ipmi=on link=on privilege=4
ipmitool -U user -P pasw -I lanplus -H $ipmi sol payload enable $chn $admin
ipmitool -U user -P pasw -I lanplus -H $ipmi sol set volatile-bit-rate 115.2 $chn
ipmitool -U user -P pasw -I lanplus -H $ipmi sol set non-volatile-bit-rate 115.2 $chn
ipmitool -U user -P pasw -I lanplus -H $ipmi sol looptest 1
...
在我到达sol set ...
失败的命令之前它工作正常:
Error setting SOL parameter 'set-in-progress': Attempt to set set-in-progress when not in set-complete state
Error: set of parameter "volatile-bit-rate" failed
sol set ...
从 ipmi shell看:
ipmitool -U user -P pasw -I lanplus -H $ipmi shell
我懂了:
ipmitool> sol set
SOL set usage:
sol set <parameter> <value> [channel] [noguard]
SOL set parameters and values:
set-in-progress set-complete | set-in-progress | commit-write
enabled true | false
force-encryption true | false
force-authentication true | false
privilege-level user | operator | admin | oem
character-accumulate-level <in 5 ms increments>
character-send-threshold N
retry-count N
retry-interval <in 10 ms increments>
non-volatile-bit-rate serial | 9.6 | 19.2 | 38.4 | 57.6 | 115.2
volatile-bit-rate serial | 9.6 | 19.2 | 38.4 | 57.6 | 115.2
所以看起来好像可以手动将其设置为完成 - 但就这么简单吗?这些命令的作用是否有参考手册?