This is a response to a github issue for Weathermap. This way, everyone might benefit! (for those that don’t know, I write an open source tool to generate diagrams with live data from your monitoring system)
This is a demo I did years ago for the datacentre I was working in then. We were working on an asset register system, and I was hoping to be able to generate these maps from that data. You should be able to do the same kind of thing with racktables or OpenDCIM.
The key parts are:
- A column of ‘notch’ nodes. All but the first one are positioned relative to the one above. These are a simple gif image.
- The actual servers and equipment. Those are positioned relative to the notch nodes. We used a combination of rack-diagram images from Visio, and actual photos taken square-on to the front of racks. Pick a size for 1U, and that will dictate what 19 inches across is. For us, it was 400 pixels. Use that as a scale on all your icons. The vertical will fall into place, but set the Y scale on your icons to something large, so that it will never be the ‘important’ scaling dimension.
- Status indicators. Those are positioned relative to the servers.
The original version also had some nice fonts defined, but distributing fonts is much more complicated so I changed the downloadable example to use the built-in fonts.
So first, we define a template node for how to draw a ‘notch’. This contains the icon, and the label, so they don’t need to be repeated.
LABELFONTCOLOR 255 255 255
Then we define all the notches.
POSITION 150 100
POSITION U1 0 39
POSITION U2 0 39
You can generate this code in Excel or a scripting language very easily. Or just stick with my dimensions and use the template in the zip file.
Next comes the server. For a 1U server, things are simple. We just use relative positioning from the appropriate U notch. For larger servers we need to do a little maths: the node is positioned from its centre, so we need to know that a 2U server is 19 pixels down from the first U position it occupies.
LABEL Web Server 3
ICON 400 300 dell2u.png
POSITION U6 225 19
LABEL Web Server 3
ICON 400 300 dell1u.png
POSITION U9 225 0
Finally, if you need to show the current state from somewhere, you can easily add indicators:
ICON 20 20 red-ball-64.png
POSITION server3 -270 0
(obviously you would add some TARGET information to get the current state)
Note that everything is positioned relatively. This means you can move the whole rack by moving one thing (the U1 notch). The status indicator will follow the server if you move it, too.
I’ve zipped up an example map, some server images, and a blank 42U rack config file that can be used as a template for your own racks: