Forum Discussion

vimal1771_20809's avatar
vimal1771_20809
Icon for Nimbostratus rankNimbostratus
Jul 27, 2015

F5: Curl command to get Node name from an IP address

Hi,

 

  1. What curl command should I use to get Node name mapped to Node IP on F5? I have Node IP with me and wants to know Node name.

     

  2. Is there a curl command to describe node based on IP address instead of node name?

     

Thanks

 

3 Replies

  • No idea on your second question (it doesn't look like it supports using the IP), but here's a very quick and very dirty answer to the first one:

    curl -k -X GET https://admin:PASSWORD@f5adminaddress/mgmt/tm/ltm/node |tr '\,}' '\n' |grep -B5 "your.ip.add.ress"|grep name|awk -F ':' '{print $2}'
    
    • vimal1771_20809's avatar
      vimal1771_20809
      Icon for Nimbostratus rankNimbostratus
      Thanks!!! I think using jq is much simpler in that case. curl -k -X GET https://admin:PASSWORD@f5adminaddress/mgmt/tm/ltm/node | jq '.items[] | select(.address==your.ip.add.ress) | .name'
  • Is there a curl command to describe node based on IP address instead of node name?

     

    Assuming you're talking about getting to the name or description of the node, then no.