Friday, August 22, 2014

Raspberry Pi controlled LEDs that tell me if a server is offline

A friend of mine who is also a sysadmin recently said to me that if a device he managed went offline, red alarm lights went off in his office.

He meant it as a figure of speech but I thought that would actually be an awesome addition for my server shelf so I would know if there is a problem with the server or one of its virtual machines.
I bought a roll of RGB LED strips from Amazon and connected them to a few relays that were controlled by  a simple ping script on my raspberry pi.

Here is how it looks:

Cut LED strip that is mounted above Server 2

Strip in front of Server 1
Cable management is yet to come


This is how it looks if Server 1 has an error but Server 2 is fine. Only after I installed it I realized that the red LEDs are much weaker than the green ones. But it's okay and you can see if fine even if the sun shines in.

One offline, the other one online


Both are online

Here are my schematics:

And the breadboard schematics: