Host Icons


#1

I cannot get host icons showing in Nagios. In the nagios.cfg file the hostextinfo.cfg line is commented out with the warning: Extended host/service info definitions are now stored along with other object definitions
I have no idea what this means. Does it imply that I should be putting my entries for host icons in the hosts.cfg or what.
I have tried uncommented that line and also adding into cgi.cfg the line
Xedtemplate_config_file=/etc/nagios/hostextinfo.cfg. But I then get error when I try to reload nagios of an error in line 1 of hostextinfo file.
It is very simple and just reads
define hostextinfo
{
host_name akadc01
icon_image win40.gif
}

Any ideas on what is wrong or am I barking up wrong tree altogether.


#2

Hi Ron,

This is how I’ve got my setup…
I created a new file
/usr/local/nagios/etc/objects/image-templates.cfg

then of course add the needed line in the nagios.cfg file as
cfg_file=/usr/local/nagios/etc/objects/image-templates.cfg

for your “win40” example I have the following in my image-templates.cfg file
define host{
name image-windows-server
icon_image win40.png
vrml_image win40.png
statusmap_image win40.gd2
register 0
}

then I do the following in my host definition: (note the “use” line)
define host{
use windows-server,image-windows-server
host_name winserver
alias Widows Server
address ip_address
}
I’ve basically predefined a whole bunch of images in my image-templates.cfg file and then just add them to the “use” line in my host definition.
You can of course just put the ?_image directive directly into the host definition section but I prefer using my template system as I’ve already changed a few icons and only had to change the name in my template file and restart Nagios. :slight_smile:

HTH