188

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?

19
  • 46
    Not silly at all, nor trivial. If you don't know what room a device is in, there's a small chance it would be almost impossible to find. Oct 7 '16 at 4:00
  • 57
    Obligatory bash.org reference: bash.org/?5273. I remember reading a story of an old mail server running inside a closet that no longer had a door (became a wall in a remodel) too. This isn't too common, but it happens every once in a while!
    – Techwolf
    Oct 7 '16 at 5:21
  • 20
    Another story, more recent than that, and not actually drywalled, but still: reddit.com/r/talesfromtechsupport/comments/54ko52/…
    – Law29
    Oct 7 '16 at 6:20
  • 22
    Are you positive its physical? Its very hard to find a VM when you're looking for physical boxes!
    – Criggie
    Oct 9 '16 at 0:11
  • 13
    Can you please give us an update when you do find it? Enquiring minds would like to know what worked for you.
    – Criggie
    Oct 10 '16 at 19:29

12 Answers 12

147

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.

3
  • 24
    I'm surprised I haven't seen this answer here already. ipmitool is the most sensible solution in most situations, as it activates blinking a blue locator LED that lights with the power of a thousand suns.
    – Spooler
    Oct 7 '16 at 3:39
  • 18
    ... if you have one physically installed. Oct 9 '16 at 10:40
  • 2
    ipmitool won't do much for you with a headless server though. And if you have a rack of twenty servers, flashing a light on one of them, or spinning up fans is a pain to do. You need something a lot more obvious and simple, which is why it is standard practice in my company to use a USB stick to find a metal server. Also.. not all IPMI units have identifier lights.. BUT.. if you do have an identifier light then this is most definitely on the list for simple ways to find a server. I mention the USB stick trick below because it works universally.
    – T. B.
    Oct 12 '16 at 17:19
101

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 with ipmitool 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.

6
  • 13
    By disk drive I assume you mean removeable optical media drive (CD-ROM, DVD-ROM, or any of the writeable/rewriteable variants). +1 from me, since this is what I often do!
    – MadHatter
    Oct 7 '16 at 5:46
  • 1
    @MadHatter If there is a server that uses optical disks, probably someone will know where it is to change the disks. Why does a server use optical disks anyway?
    – v7d8dpo4
    Oct 7 '16 at 9:16
  • 17
    I have no opinions on whether servers should have optical media drives. I noted merely that ejecting the hard disk drives from a machine just to find out where it was, was a fairly serious - some might say insane - undertaking, if indeed it is even possible.
    – MadHatter
    Oct 7 '16 at 10:02
  • 20
    Many servers have an optical drive even though it is not routinely used. Until fairly recently optical drives were the dominent method of installing the operating system on a new box. Oct 7 '16 at 14:07
  • 8
    @MadHatter I'd say you picked your handle well. Thanks for the mental image of a 1U forcibly ejecting its hard disk drive ;)
    – Konerak
    Oct 7 '16 at 14:10
54

An electrical method:

When the power consumption in your building is not going to change a lot (like at night):

  1. Run the computer at full cpu (like prime 95)
  2. Measure the current going through each circuit breaker in the circuit breaker panel, record these numbers. (this can be done with a AC clamp meter)
  3. Run the computer at low cpu
  4. Remeasure the currents. If any have dropped from before, the panel box normally states which room that breaker controls. Go to that location and find the computer.

Notes:

  • Take precautions to not electrocute yourself while measuring currents
  • If multiple breakers have a drop in current, rerun high CPU test and repeat until 1 breaker could be isolated.
4
  • 54
    We found the electrical engineer!
    – cat
    Oct 7 '16 at 23:45
  • 17
    How long had he been walled in?
    – qris
    Oct 9 '16 at 10:13
  • 15
    This technique can probably be enhanced by programming the missing system to modulate its power draw to produce a signal you may be able to detect in the wiring. Oct 9 '16 at 16:41
  • 3
    @R.. See if you can make it radiate an FM signal that your radio can pick up. Oct 14 '16 at 9:38
40

If you have a managed switch:

ping ghostserver

arp -a

Note the MAC address, and after check your switch ARP table per port.

Depending on the switch model you will have output like this:

enter image description here

** Notice that multiple MAC per port usually means an uplink to another switch.

6
  • 23
    You left out the most tedious part: now you get to trace the cabling, starting from the port found by this method. Hopefully the cabling can be fully traced. Oct 7 '16 at 3:58
  • 1
    I would check the neighborhood port, a good indicator. (like if they are secretary pc or gear from a network cabinet, etc..)
    – yagmoth555
    Oct 7 '16 at 4:14
  • If CDP is available, that tend to be much easier... (in Wireshark or cdpr). Then indicator lights and similar if available... Oct 7 '16 at 9:54
  • @GertvandenBerg CDP? Oct 10 '16 at 16:57
  • @MartijnHeemels Cisco discovery protocol - mainly relevant if on Cisco switches LLDP is the cross-vendor version - cdpr might not work with that though (Wireshark should) Oct 11 '16 at 13:55
24

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 the pcspkr 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.

1
  • +1: Simple yet effective and does not require IPMI access. On older systems it is also quite loud (real speaker instead of the small ones used today).
    – user121391
    Oct 12 '16 at 9:12
17

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.

1
10

Reboot and listen for the POST beep

5
  • 2
    And then play this game - amazon.com/ThinkGeek-Annoy-a-tron-2-0/dp/B002YE3YDU/… ? :P
    – enderland
    Oct 7 '16 at 23:30
  • @enderland out of stock D:
    – cat
    Oct 7 '16 at 23:44
  • 9
    why not just use beep command?
    – rav_kr
    Oct 9 '16 at 17:52
  • 5
    A reboot may also be easily trackable because for many makes and models, it causes fans to run at full power for a while Oct 10 '16 at 22:04
  • If you can reboot, you can also power off. Less likely if this is a production server. :)
    – Cypher
    Oct 13 '16 at 22:40
6

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.

1
  • 5
    Or, equally, look at what nearby APs (by MAC) are visible, so that you can figure out roughly where it is. If you're on a big campus, going through every room could take days. Oct 9 '16 at 11:44
4

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.

3

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.

2

If you're going to move it, how about turning it off and looking for a switched off machine?

3
1

Various research has been done into how to exfiltrate data via EMF; for example, http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-577.pdf

If you can get the missing computer to produce a radio signal, you can in principle hunt for it by signal strength.

Not the answer you're looking for? Browse other questions tagged or ask your own question.