Starter Kit: Server Room Monitoring

Features

Description

The Starter Kit: Server Room Monitoring is an open source kit that can monitor server room installations. The basic kit is equipped with the following Sensors: Ambient Light Bricklet 2.0 (monitors room illumination), Humidity Bricklet (monitors humidity), Temperature Bricklet (monitors temperature in the server rack) and a PTC Bricklet with attachable Pt100 temperature sensor probe (monitors temperature in a server).

The kits enclosure can be mounted directly in a 19" server rack and can be extended by other Tinkerforge building blocks, e.g. more temperature probes, motion detector, in- or outputs (to switch computers on/off or to monitor doors), to flexibly adapt the kit to your needs.

Two different applications are possible:

  1. Non-stand-alone monitoring (standard kit)

    The sensors of the kit are read out via Ethernet or USB by a computer with the offered APIs (C/C++, C#, Delphi/Lazarus, Java, JavaScript, LabVIEW, Mathematica, MATLAB/Octave, Perl, PHP, Python, Ruby, Shell, Visual Basic .NET). Individual solutions can be realized with ease. Examples for Bash, Nagios/Icinga and Xively demonstrate different possibilities.

  2. Stand-alone monitoring (standard kit + RED Brick)

    With an additional RED Brick external control by another computer is not necessary anymore. You can configure your own monitoring solution using just Brick Viewer without any programming.

    The value range for each sensor can be defined with sliders. It is possible to enable email notifications for monitoring values that are out of range. Rules can be defined for sensors that are directly connected, but also for other Tinkerforge sensors available in the network. The defined rules configure an instance of Nagios that runs on the RED Brick. The Nagios web interface shows current monitoring values and currently existing problems. More information can be found in the RED Brick section of the Server Room Monitoring documentation.

    Advanced users can easily modify the Nagios installation that runs on the RED Brick to change configurations that go beyond the Brick Viewer possibilities.

The kit can be powered through Power over Ethernet (PoE) or USB.

The soft- and hardware of the kit can be modified. The casing, except of the powder coated aluminum front panel, consists of tinker-friendly PMMA, you can drill new holes with a wood drill. Mounting holes for different Bricks and Bricklets are provided, by default you can mount:

Analog In Bricklet 2.0, Analog Out Bricklet 2.0, Industrial Digital In 4 Bricklet, Industrial Digital Out 4 Bricklet, Industrial Quad Relay Bricklet, IO-4 Bricklet, Motion Detector Bricklet, and Segment Display 4x7 Bricklet

Technical Specifications

Property Value
Illumination 0lux - 64000lux in 0.01lux steps
Ambient Temperature -40°C - 85°C in 0.01°C steps
Pt100 Sensor Probe -20°C - 450°C
PTC Bricklet 0.03125°C (15bit) resolution
Humidity Bricklet 0% - 100% relative humidity
   
Dimensions (W x D x H) 482 x 92 x 44mm (19.0 x 3.62 x 1.75")
Weight 250g

Resources

First tests, firmware upgrade and configuration

As a very first step you should try out and update your Bricks and Bricklets.

For that you need to install the Brick Daemon and the Brick Viewer. At next you should configure the PTC Bricklet and attach the temperature probe (2-wire). documented here and here.

After this put the Ethernet Extension on top of the Master Brick, connect all Bricklets to it and connect it via USB to your PC. Afterwards use Brick Viewer to check if all firmwares are up to date (Updates / Flashing button). If not, you can update the Bricks and update the Bricklets with the Brick Viewer, too:

Server Room Monitoring Hardware update in Brick Viewer

As next step click through the tabs of the Brick Viewer to see if everything is working correctly. Next you should configure the Ethernet Master Extension. In our further examples we configure the hostname to "ServerMonitoring" and use DHCP. To do that click on the Master Brick tab and configure it to your needs. More information about the configuration of the Ethernet Extension can be found here.

After testing the hardware and configuration you can be sure that the Bricks and Bricklets have versions that work together and that everything will work if it is screwed together in the 19" server enclosure.

Construction

The construction of the basic kit is described here.

RED Brick

If the kit is used together with a RED Brick then Nagios running on the RED Brick can be configured directly using Brick Viewer.

Nagios configuration in Brick Viewer

To enable the Server Monitoring service (requires RED Brick Image >= 1.6 and Brick Viewer >= 2.2.3) go to the services tab and tick the Server Monitoring checkbox.

If the Server Monitoring service is enabled, it is possible to add rules. A rule basically consists of the Bricklet type (Temperature, Ambient Light, Humidity or PTC), its UID and a warning as well as a critical range. Just add as many rules as you need and configure them as required.

You can also configure automatic email notification for each of the warning/critical ranges. Just tick the Enable Email Notification checkbox and add the required information.

Click Save to save the configuration on the RED Brick. You can now visit http://<red-brick-ip>/nagios3/ to view the current Nagios status.

Nagios webpage

The default username:password is nagiosadmin:tf. You can change the password through the console with:

sudo htpasswd -c -b /etc/nagios3/htpasswd.users nagiosadmin NEWPASSWORD

Each of the rules will be shown as a service in Nagios. An overview over all services is available if you click on Services in the Current Status category.

Projects

There are several applications for the Starter Kit: Server Room Monitoring. In the following we are showing some examples which can act as a starting point for your own projects.

Simple Monitoring

In this example we use the Shell Bindings to read out the different sensors in the kit.

Enumerate the Bricks and Bricklets ("is all connected?"):

$ tinkerforge --host ServerMonitoring enumerate
uid=6Dct25
connected-uid=0
position=0
hardware-version=1,0,0
firmware-version=2,1,0
device-identifier=master-brick
enumeration-type=available

uid=fow
connected-uid=6Dct25
position=a
hardware-version=1,0,0
firmware-version=2,0,0
device-identifier=ptc-bricklet
enumeration-type=available

uid=SCT31
connected-uid=6Dct25
position=b
hardware-version=1,1,0
firmware-version=2,0,1
device-identifier=temperature-bricklet
enumeration-type=available

uid=ajC
connected-uid=6Dct25
position=d
hardware-version=2,0,0
firmware-version=2,0,0
device-identifier=ambient-light-v2-bricklet
enumeration-type=available

Read out connected sensors (adapt the UID):

$ tinkerforge --host ServerMonitoring call temperature-bricklet SCT31 get-temperature
temperature=2487

$ tinkerforge --host ServerMonitoring call ambient-light-v2-bricklet ajC get-illuminance
illuminance=410

$ tinkerforge --host ServerMonitoring call ptc-bricklet fow get-temperature
temperature=2603

The shell bindings support the execution of additional shell commands with the --execute option (see Shell Bindings for more information). The following script shows how to convert the returned value into degree Celsius and how to save it in a variable for further use.

#!/bin/sh

HOST=ServerMonitoring
UID=SCT31

temp=$(tinkerforge --host $HOST call temperature-bricklet $UID get-temperature\
       --execute "echo '{temperature} / 100' | bc | xargs printf '%.2f\n'")
echo $temp

Server Room Monitoring with Nagios or Icinga

Icinga and Nagios are computer system monitoring tools. Icinga is a fork of Nagios and is said to be backward compatible to Nagios. In the following examples we are referring to the Nagios API to be also compatible with Icinga.

These monitoring tools use plugins, instantiated as services to monitor processor load, memory utilization, specific software processes or physical values like temperature.

In this example we write our own plugin to use the kits hardware for ambient temperature measuring. With a few modifications you can use the plugin to support other Tinkerforge hardware modules and create the physical monitoring you need.

Icinga Screenshot

Find the full project description here.

The section about further enhancements lists more Nagios/Icinga examples.

Upload Sensor Data to Xively

Xively is a service that provides the possibility to analyze and visualize the "Internet of Things". It can be used to interconnect different devices over the Internet and can store a history of measured values and can display it with pretty graphs.

Xively datastream configuration

The full project description can be found here.

Further Enhancements

If you have modded, extended or improved the kit in any way and you have published your results on our Wiki, on your blog or similar: Please give us a notice. We would love to add a link to your project here!

Motion Detector and Error Code Display

The casing has already the necessary cut-outs for a Motion Detector Bricklet and a Segment Display 4x7 Bricklet. Use a Motion Detector Bricklet to detect motion in your server room. An additional Segment Display 4x7 Bricklet can be used to show error code information on the case.

The full project description can be found here.

Extended version of kit

Remote On/Off Switch

Use Industrial Quad Relay to switch computers on or off remotely. You can use the previous examples to modify them to your needs. The wiring is really simple, you only have to bypass the on/off switch of the computer with one of the relays of the Industrial Quad Relay Bricklet. A tutorial how a switch can be bypassed can be found at the Hardware Hacking for Beginners Tutorial.

Kit with Industrial Quad Relay Bricklet

Monitoring Server Rack Door with Distance IR Bricklet

Martin Seener developed a check for Nagios that uses a Distance IR Bricklet to detect if the door of a server rack was opened. The Distance IR Bricklet is mounted inside the server rack and measures the distance towards the closed door. If the distance changes significantly then the door was opened.

To get a proper threshold the standard deviation of the distance measurements of the Distance IR Bricklets is calculated over a longer time. Martin Seener included a script for this task.

This check is the first one in a collection of Nagios checks for Tinkerforge.