I'm trying to find the IP of a switch, in order to set it to factory defaults.
I heard there's a command for HP Switches to find all surrounding HP Switches. What is it?
You will want to run this command:
cdp is the Cisco Discovery Protocol, but this command still works on Procurve switches.
As an alternative you can also run this:
lldp is the Link Layer Discover Protocol. The SysName column will display the host name of the remote switch.
To map out your network, you will start at an edge switch, run these commands, then ssh to those remote switches. Once on the remote switch, repeat this process.
Another approach would be to use the arp command to find its IP address from the Mac address (which should be physically labeled on it somewhere).