By default your service map will show your defined services with a question mark logo, this is due to  the default logos used are unknown.gif and unknown.gd2. You can define your own custom logos thus giving a more personalised look. There have been logo packs made for use with Nagios, well theses of course will work just fine in Icinga, in this case I have made my own custom images of my router and my server.

The image types can be .jpg, .gif .png you will also need to convert the images you use to a .gd2 format as well. to do this you are going to need the pngtogd2 utility. (see notes below) I have resized these images to 40×40 pixels before conversion to .gd2 format.

pngtogd2 source_image output_imige.gd2 cs 1
  • pngtogd2 command loses transparency unless the original png file is properly formatted
  • pngtogd2 is distributed as part of the libgd-tools package in Debian and Ubuntu.
  • The image needs to be stored with an indexed rather than RGB color model. In GIMP, select Image -> Mode -> Indexed.
  • The color values for transparent pixels need to be retained.
Source : http://wiki.nagios.org/index.php/Status_Map_Images

Then create hostextinfo.cfg file in /usr/local/icinga/etc/objects and include the following…  (please note this is my configuration!)

define hostextinfo{
     host_name       IBM-eSERVER
#     notes_url       http://webserver/hostinfo.pl?host=you_can_edit_this
     icon_image      IBM-eSERVER_220.png
     icon_image_alt  IBM-eSERVER_220
     vrml_image      IBM-eSERVER_220.png
     statusmap_image IBM-eSERVER_220.gd2
#     2d_coords       100,250
#     3d_coords       100.0,50.0,75.0
     }

Your custom images need to be placed into ‘/usr/local/icinga/share/images/logos’ substitute the .png and .gd2 files to the names of the images that you will be using. Change the file ownership and permissions of your custom images and hostextinfo.cfg by using the following ‘chown dancer:icinga your_file_name’ also ‘chmod 664 your_file_name’ this matches the permissions and ownership of the files already in these directories. If you have multiple hosts then repeat the ‘define hostextinfo{…}’ that you wish to add custom logos to, if you wish to use the same logo for multiple hosts then they just need to be comma separated eg. ‘host_name     localhost1,localhost2,localhost3’

To enable your new hostextinfo.cfg you need to add the following to /usr/local/icinga/etc/icinga.cfg

# Definitions for custom logos
cfg_file=/usr/local/icinga/etc/objects/hostextinfo.cfg

Make sure that your configuration is good by running the following (as root) ‘sudo /usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg’ if you have no errors, then simply restart Icinga. If you do have errors then check to make sure you have defined a valid ‘host_name’ and that you have placed your custom images into /usr/local/icinga/share/images/logos

You will be rewarded with the following…

Before…

BeforeAfter…

After

These custom logos will also show up when viewing host and service details…

Services

Note: I’m using Ubuntu some commands may vary depending on distribution