Thursday, May 27, 2010

Convert PNG to GD2 for nagios

When working with nagios and working with new icons to show on your status map you might encounter a filetype called GD2. In most cases you will have a file, for example LINUX_SERVER.png and you will also have a file called LINUX_SERVER.gd2 .


The .png files are used to be displayed in your browser wherever they are needed. However the status maps where you can see all your server in on screen on a map is generated. For the generation of this map the nagios code is reading the images needed and for a more direct access to the image source the gd2 files are used. GD2 is coming from the GD Graphics Library.

In some cases you download a icon set which is not containing gd2 files but only png files. In this case you can make use of the pngtogd2 utility. This utility is (for debian) part of the libgd-tools package and can be installed via apt-get.

When using the pngtogd2 utiltiy please make sure you use the uncompressed option and chunck size of 0. Compressed gd2 files will make rendering the status map slower so if you do not really need to use compression than don’t use it.
Post a Comment