Checklist
Charly's Column – Zint
Doing a hardware inventory in a data center is anything but a piece of cake. In order to quickly assign devices to the appropriate database entry, Charly provides each newly acquired system with a QR code sticker with the help of Zint.
When you need to manage large numbers of devices, there is no avoiding centralized data management. In the simplest case, this can be a wiki, with one entry per system. This will include, for example, the date of purchase, the length of the warranty period or maintenance contract, any repairs that have already been made, and the rack number where the device is installed (finding the hardware in a larger data center can be time-consuming). I then encode the URL of the wiki entry as a barcode or QR code, print it on self-adhesive film, and stick it on the device.
I generate the codes for this with Zint [1]. Many distributions have Zint on board; if not, it is quickly compiled from the GitHub repository. You must have libpng in place; otherwise, Zint will not generate images. Those who now want to generate codes are spoiled for choice: Zint knows dozens of variants (Figure 1). With zint -t
, I can display their names.
I know a few of these codes, like EAN and QR, from everyday life. PDF417 (Figure 2) and its relatives can be found on the boarding passes of many airlines. And there just happens to be a cold medicine bottle on the table in front of me that has a PZN barcode. I can see from a web page [2] for generating barcodes that this is used on pharmaceuticals in Germany. On the same website – funnily enough, it uses Zint itself – there are examples of the other types of code.
For inventory purposes, I use a classic QR code. I can encode all ASCII characters in it, but I have to avoid nonstandard characters like accents and umlauts. Using the call from Listing 1, I create a QR code as a PNG that reveals the URL for Linux Magazine's website (Figure 3).
Listing 1
QR Code with Zint
$ zint -o ~/qr/linmagurl-qr.png -b 58 -d https://linux-magazine.com
In Listing 1, I use -b 58
to select QR as the code type. The parameter -d
for data
always has to be at the end: Zint blithely ignores all the options that follow. As long as I stick to this, the barcode generation routine works like clockwork, which gives me one less excuse to put off the pesky inventory process.
Infos
- Zint: https://github.com/zint/zint
- Barcode generator: http://www.barcode-generator.org
Buy this article as PDF
(incl. VAT)