I've got a CentOS server somewhere in the building; I can login into it remotely and VNC, etc. Now I've got to physically move it, and for that I need to physically locate the machine among the lookalikes around the office.
What can I do remotely to make the machine visibly or audibly identify itself?
Use IPMI to trigger LEDs, increase fan RPMs or sound the beep/alarm. Take a look at the man page for
ipmitool
https://linux.die.net/man/1/ipmitool depending on the server you may be able to set the LEDs, LCD display, fan RPM offset(listen when nobody is in the office). Some other IPMI or BMC interfaces may allow you to sound the beep but this functionality is more platform specific.a powerful workstation or server will sound like someone vacuuming with the fans turned up all the way.
EDIT: To use the Identifier lights as mentioned in comments, this will however require setting making sure that an appropriate IPMI interface is setup, there are several guides and tutorials available, and depending on the OEM there may be proprietary interfaces and management systems like Intel's Data Center Manager(http://www.intel.com/content/www/us/en/software/intel-dcm-product-detail.html). I have used this tutorial before but there are others https://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool
ipmitool -I <appropriate interface for system> -U<username> chassis identify force
should force the ID to an on state, depending on the interface and configuration you may need to specify authentication type and other command line options.If your server has a CD/DVD or similar drive, a simple solution is to run
eject
and look for the open tray. (Remember, just because the tray is open doesn't mean that you opened it; confirm a second time after you think you've found the server.) Failing that, Matt's answer to turn on an identifying LED or display a message on an LCD withipmitool
is the way to go.You could also use traceroute to determine what router the server is connected to, and even play with the switch management interfaces to try to find the exact cable (or at least one end of it) on which the server is connected.
An electrical method:
When the power consumption in your building is not going to change a lot (like at night):
Notes:
If you have a managed switch:
Note the MAC address, and after check your switch ARP table per port.
Depending on the switch model you will have output like this:
** Notice that multiple MAC per port usually means an uplink to another switch.
Use
beep
.Assuming you have an internal speaker installed (often a small piezoelectric device), this will emit a beep on said speaker. If you are unsure whether there is a speaker inside the box in question, perhaps you can try with a different machine of the same type with known location.
You can keep it running in a loop while you wander through the house. Or you can encode your house-internal phone number into the melody somehow and wait for some colleague to call, asking you to please end that annoying noise next to their office.
Make sure you are executing beep as root, so that it uses the ioctl mechanism. Unless the binary is installed suid root on your system and your user is allowed to access it. Just emitting
\a
to your tty (which is the fallback in case of insufficient privileges) likely won't be enough since it will just reflect to your remote terminal emulator. Depending on your configuration, you also might have to load thepcspkr
kernel module to make this work.According to https://pkgs.org/download/beep, beep should be available as a package for CentOS, so just try
yum install beep
. Hope it's not modified in some way to make it not use the ioctl approach. This was a problem on Gentoo for some time.Matt's answer mentioned beep (unclear whether the command or the concept) in passing, as did some comments, but I think this should be an answer in its own respect. Chances are you'll hear beeps through closed doors while checking led patterns may require opening the room and waiting in front of each machine to distinguish deliberate patterns from random noise.
With managed network devices, you have a number of options: you can look for CDP/LLDP packets from the switch towards the hosts (which will tell the switch name and port number), or you can install LLDP agents on the server (so a 'show lldp neighbor' or similar run on the switch will show the port its on). Next best is to match up interface MAC addresses with the switch's bridging table. In both cases, you can trace the cable from the known switch end to the unknown server end.
If you don't have managed switches and have to rely on the host itself, then:
If the machine is from Dell or HP or similar, you can use 'dmidecode' to get the serial number/service tag, and match that up with the label on the device. At least on a Dell, you can also use OpenManage to change the text on the LCD display. You may also have some options to force the fans to run at full speed, which may be sufficiently audible to locate the machine.
ethtool as an --identify option, which will make the LED on a specific network interface blink. (Generally this is for telling which NIC is which on a system that has several, so this isn't ideal for this use case)
If it has an optical drive, you can eject the tray.
Reboot and listen for the POST beep
If the machine has a wireless card but is using a cable (unlikely, but maybe the motherboard has it built in?) You can configure it as an access point then use a phone app like wi-eye to play "hot or cold" with it.
Hard drive LEDs can be made to show a lot of activity, turning them into viable identifier lights, by reading with dd if=/dev/sdX of=/dev/null. No IPMI support needed.
Also see https://unix.stackexchange.com/questions/1974/how-do-i-make-my-pc-speaker-beep.
Also, if ethtool is available, messing with the interface speed settings can make the machine identifiable via the speed LEDs on the switch and/or NIC. Caveat: There is a risk of taking your machine effectively off line that way if the switch reacts badly to you turning autonegotiation off.
There are two easy ways to do this.. one has already been mentioned ( eject the cdrom tray )
The other is to login with a wireless connection and watch the USB messages. Then go around and plug in a USB stick with known data on it.
Either you will see a USB message when you do it on the right machine, or you can use any of the numerous USB interrogation tools (lsusb, etc) to see if it is now there.
Once you see a USB stick, mount it and look at it to see if its the right one.
Done.
Flashing lights and making things spin up and down isn't very reliable and requires a lot of attention. These two ways are dead simple, and don't require any sensory gymnastics.