Supermicro IPMI/BMC nginx proxy
需要安装一个openresty或者nginx, 版本大于1.15.10
编译安装参考http://www.kvm.la/1043.html , openresty二进制包版本较低没有更新, 建议编译安装一份.
首先把IPMI的IP丢进一个ip.list的文件里面, 一行一个IP.
#/bin/bash i=1000 #vnc start port b=2000 # hextoip() { hex=$1; printf "%d." 0x${hex:0:2}; printf "%d." 0x${hex:2:2}; printf "%d." 0x${hex:4:2}; printf "%d" 0x${hex:6:2}; } #gethostip -x 10.0.12.1 stream_route_map=/etc/nginx/stream.route.map.conf http_route_map=/etc/nginx/http.route.map.conf echo " default 0;" > $stream_route_map echo " default 0;" > $http_route_map for IP in `cat /root/ipmi/ip.list | uniq -c |awk '{ print $2 }'`; do i=`expr $i + 1` ; b=`expr $b + 1` ; HEXIP=`gethostip -x $IP | tr 'A-Z' 'a-z'` ; echo " ~*($IP|$i|$b|$HEXIP)$ IP<$IP>|VNC<$i>|BMC<$b>|HEX<$HEXIP>;" >>$http_route_map; echo " ~*($b|$i)$ $IP;" >> $stream_route_map done nginx -s reload