Thursday, April 19, 2018

Tip for documenting rack (rackdiagram)

Perhaps Im late on this story but I found out the other day that rackdiag (part of nwdiag which is part of blockdiag which is a python package) is a great tool to document rackdesigns and wanted to share my finding with the community (assuming more people than me will sooner or later end up having to document stuff).

If you are on an Ubuntu/Debian installation you can do this to install the needed python-package:

sudo apt-get install python3-nwdiag 

and then this if you want to use more familiar fonts:

sudo apt-get install ttf-mscorefonts-installer 

Then you create a file with a filename of your choice (example.diag) which you fill with (for example):

rackdiag { // define height of rack 42U; // define width of rack, 1RU to 19" ratio node_width = 434; // define description of rack description = "RACK 1"; // define rack units 42: PATCHPANEL SMF 48xLC 41: PATCHPANEL MMF 48xLC 40: R1 39: N/A 38: R2 37: N/A 36: N/A 35: N/A 34: N/A 33: N/A 32: N/A 31: N/A 30: N/A 29: N/A 28: N/A 27: N/A 26: N/A 25: N/A 24: N/A 23: N/A 22: N/A 21: N/A 20: KVM //19: N/A 18: SERVER1 [2U] //17: N/A 16: SERVER2 [2U] 15: SW1 15: SW2 14: N/A 13: N/A 12: N/A 11: N/A 10: N/A 9: N/A 8: N/A 7: N/A 6: N/A 5: N/A 4: N/A 3: N/A 2: N/A 1: N/A } 

Then to compile the above example.diag into a pdf-file you can use this in your command line:

rackdiag3 -T pdf -a -f /usr/share/fonts/truetype/msttcorefonts/verdana.ttf example.diag 

You can also output in png or svg by changing "-T pdf" into "-T svg" or such.

The above will look like this:

http://interactive.blockdiag.com/rackdiag/?compression=deflate&src=eJxVkEFrg0AQhe_7KwbPBTPjNjWWHEQshcQQtKaHEkKIJi4FLcbSQul_7wafaTw9dt_M995uuz-8F2Z_oh-lXJeK8mjqkqrSnKqOmiO11lda8sdb-8sUXTW4d8RpTl1DPHPsRWcaVTdFueuH5qQ9PVouyvOhNR92rr4G3N7NyUnDaEHsjNYuc_RZm-5s6wS0Dl-i53W4ipeUJU-k_e9lpDSPjOTfmASUsvJmAa3cUHm-PYryHnCcQu-hGupBBcrQSa8CnPhQ8AQ8AU_AE_AEPAFPLG-xSexjGUS2xCxON3HK9Cb59mIBztPBkt5im5K9MlQUI42RxkhjpDHaIwrdQUdzFB_-ATWx34v6VX9aHoiE

Documentation is available at http://blockdiag.com/en/



No comments:

Post a Comment