AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 843414
Accepted
Joe W
Joe W
Asked: 2017-04-09 06:21:18 +0800 CST2017-04-09 06:21:18 +0800 CST 2017-04-09 06:21:18 +0800 CST

发现网络上服务器的 iLO 地址

  • 772

有没有办法为我的网络上的服务器发现 iLO 的 IP 地址?我有一个服务器正在运行,我只能通过 iLO 访问(没有其他访问可用),但我不知道 iLO 正在运行的 IP。

有没有办法通过查看流量从网络中发现服务器的 iLO IP?

该服务器是运行 HP iLO 的 HP proliant

linux-networking
  • 2 2 个回答
  • 8966 Views

2 个回答

  • Voted
  1. Best Answer
    ewwhite
    2017-04-09T06:34:55+08:002017-04-09T06:34:55+08:00

    寻找 ILO 独有的端口,例如 17988:nmap -sT -p 17988 iprange... 例如:

    nmap -sT -p 17988 --open 192.168.20.0/24
    
    • 9
  2. Criggie
    2017-04-09T13:32:37+08:002017-04-09T13:32:37+08:00

    我在以前的工作中使用了这个脚本,它运行得很好,找到了我不知道存在的 ilos。

    http://blog.nachotech.com/?p=63

    脚本依赖于 tr sed expr curl 和 nmap

    #!/bin/bash
    #
    # findilos - Search a local network segment for iLOs
    #            The iLO is the Integrated Lights-Out management processor
    #            used on HP ProLiant and BladeSystem servers
    #
    scriptversion="1.0"
    #
    # Author: [email protected]
    #
    # Website: http://blog.nachotech.com
    #
    # Requires: tr sed expr curl nmap
    #
    # Tested with: Nmap 4.20, curl 7.17.1, RHEL4
    #
    # Note: Discovery of an iLO is dependent upon the Virtual Media port
    #       being set to the default of 17988.  If this has been changed
    #       by the iLO administrator, then this script will NOT find it.
    #
    #       Also, if the iLO XML Reply Data Return has been Disabled by
    #       the iLO administrator, this script will not be able to
    #       gather any information about the server.  It will still be
    #       discovered, but all you will see is its IP address.
    #
    
    # GLOBAL VARIABLES
    
    scriptname="findilos"
    iloips="/tmp/tmpilos.$$"
    iloxml="/tmp/tmpiloxml.$$"
    ilohwvers="/tmp/tmpilohwvers.$$"
    
    declare -i ilosfound=0
    
    # FUNCTIONS
    
    function parseiloxml {
      fgrep "$1" $iloxml > /dev/null 2>&1
      if [ $? -ne 0 ]
      then
        # tag not found in xml output, return empty string
        parsedstring="N/A"
      else
        # tag was found - now we parse it from the output
        tempstring=$( cat $iloxml | tr -d -c [:print:] | sed "s/^.*<$1>//" | sed "s/<.$1.*//")
        # trim off leading and trailing whitespace
        parsedstring=`expr match "$tempstring" '[ \t]*\(.*[^ \t]\)[ \t]*$'`
      fi
    }
    
    function is_installed {
      which $1 > /dev/null 2>&1
      if [ $? -ne 0 ]
      then
        printf "\nERROR: %s not installed.\n\n" $1
        exit 255
      fi
    }
    
    # MAIN
    # check for tools that we depend upon
    
    is_installed tr
    is_installed sed
    is_installed expr
    is_installed curl
    is_installed nmap
    
    # check syntax - should have 1 and only 1 parameter on cmdline
    
    if [ $# -ne 1 ]; then
      printf "%s %s ( http://blog.nachotech.com/ )\n" $scriptname $scriptversion
      printf "Usage: %s {target network specification}\n" $scriptname
      printf "TARGET NETWORK SPECIFICATION:\n"
      printf "  Can pass hostnames, IP addresses, networks, etc.\n"
      printf "  Ex: server1.company.com, company.com/24, 192.168.0.1/16, 10.0.0-255.1-254\n"
      printf "EXAMPLE:\n"
      printf "  %s 16.32.64.0/22\n" $scriptname
      exit 255
    fi
    
    iprange=$1
    
    # prepare lookup file for iLO hardware versions
    
    cat > $ilohwvers << EOF
    iLO-1 shows hw version ASIC:  2
    iLO-2 shows hw version ASIC:  7
    i-iLO shows hw version T0
    EOF
    
    #
    # scan a range of IP addresses looking for an
    # open tcp port 17988 (the iLO virtual media port)
    #
    
    printf "Scanning..."
    
    nmap -n -P0 -sS -p 17988 -oG - $iprange | fgrep /open/ | awk '{print $2}' > $iloips
    
    printf "\n\n"
    
    #
    # open and read the list of IP addresses one at a time
    #
    
    exec 3< $iloips
    
    echo "--------------- ------ -------- ------------ -------------------------"
    echo "iLO IP Address  iLO HW iLO FW   Server S/N   Server Model"
    echo "--------------- ------ -------- ------------ -------------------------"
    
    while read iloip <&3 ; do
      ilosfound=$ilosfound+1
      #
      # attempt to read the xmldata from iLO, no password required
      #
      curl --proxy "" --fail --silent --max-time 3 http://$iloip/xmldata item=All > $iloxml
    
      #
      # parse out the Server model (server product name)
      # from the XML output
      #
    
      parseiloxml SPN;  servermodel=$parsedstring
      parseiloxml SBSN; sernum=$parsedstring
      parseiloxml PN;   ilotype=$parsedstring
      parseiloxml FWRI; ilofirmware=$parsedstring
      parseiloxml HWRI; ilohardware=$parsedstring
    
      ilohwver=$(grep "$ilohardware" $ilohwvers|awk '{print $1}')
      if [ "$ilohwver" == "" ]; then
        ilohwver="N/A"
      fi
    
      if [ "$sernum" == "" ]; then
        sernum="N/A"
      fi
    
      printf "%-15s %-6s %-8s %-12s %s\n" $iloip "$ilohwver" "$ilofirmware" "$sernum" "$servermodel"
    
    done
    
    printf "\n%d iLOs found on network target %s.\n\n" $ilosfound $iprange
    
    rm -f $iloips $iloxml $ilohwvers
    
    exit 0
    

    示例运行

    criggie@thionite:~/bin$ sudo ./findilos 10.28.0.0/16
    Scanning...
    
    --------------- ------ -------- ------------ -------------------------
    iLO IP Address  iLO HW iLO FW   Server S/N   Server Model
    --------------- ------ -------- ------------ -------------------------
    10.28.1.16      N/A    N/A      N/A          DL380G6
    10.28.1.17      N/A    N/A      N/A          DL380G6
    10.28.100.203   N/A    N/A      N/A          DL380G8
    
    3 iLOs found on network target 10.28.0.0/16.
    

    对我来说,这个脚本扫描 /16 需要 29 秒,扫描 /24 需要 11 秒

    • 2

相关问题

  • 将整个 IPv6 /64 块添加到 debian 上的网络接口

  • 您处理复杂 iptables 规则集的方法

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve