Situation
Imagine a nicely built CMDB with a lot of interconnected items. You can follow the links manually in your browser but sometimes you get a better hold on information and structures by visualizing them.
The OTRS CMS is such a case: many classes, items and connections between them. I hacked a small bash script which reads the database and generates a file suitable as input for the graphviz project’s [graphviz] dot program.
Example output
How to use
Please follow these simple (ymmv) steps
- grab a *ix of choice
- install graphviz
- download the zip archive containing
– prepare_dot.sh (the mentioned bash-script)
– test.dot (some example data)
– test.pdf (example result as PDF)
– test.png (example result as PNG) - modify the script at the beginning
Please insert the correct credentials to have read permissions on the OTRS database - run the script and save the output to e.g. test.dot
sh prepare_dot.sh > test.dot
- run dot to generate the diagram
dot -Tpdf test.dot -o test.pdf
Be warned
The script relies on some shell functionality and built-in functions and was tested with a current Bash on Debian stable. It may or may not run with other shells. Please adopt the script to your needs.
The script uses mysql to gather the nessesary data from the DB. It may be possible to use a PostgreSQL or other command line client – please adjust to your needs too.
The output may be strange and not satisfying for your data model – graphviz was developed for interconnected data. If your CMDB is just plain storage, then a visualization doesn’t make sense.
Further Reading
[graphviz] – http://www.graphviz.org/
Download
Have ((fun))
The post Proof of concept – visualizing the CMDB appeared first on The OTRS Blog.