[Nagiosplug-help] Logos don't display on status map or in host status views

Andreas Ericsson ae at op5.se
Wed Dec 13 15:39:31 CET 2006


Ralph.Grothe at itdz-berlin.de wrote:
> Hello,
> 

Hello, and thank you for an exemplary problem description/question. I've 
cut away some of your own trouble-shooting to just keep the parts 
relevant to the answers.

> 
> In my *hosts.cfg files I added hostextinfo definitions for some
> hosts
> which look like 
> 
> The graphic binaries are world-readable, so also for the
> webserver children
> 
> $ ll /opt/sw/nagios/share/images/logos/{hp,redhat}.gd2
> -rw-r--r--   1 nagios   nagios      2730 Nov 17 2004
> /opt/sw/nagios/share/images/logos/hp.gd2
> -rw-r--r--   1 nagios   nagios      2649 Nov 17 2004
> /opt/sw/nagios/share/images/logos/redhat.gd2
> 
>>From the webserver's nagios virtual host access log I see that
> the GET was serviced with a 200 OK state
> 
> 123.123.123.123 - nagiosadmin [13/Dec/2006:14:03:07 +0100] "GET
> /images/logos/hp.gd2 HTTP/1.1" 200 2730
> 
> 
> Does it mean that my browser needs some plug-in to be able to
> display those *gd2 files?
> I use a Firefox 1.5.0.8 that only has the usual Acrobat reader
> and JRE plugins (about:plugins)
> 
> So what's so special about the gd2 icons?
> 

gd2 isn't really an image-format in the sense that browsers and 
image-viewing programs can read and display them properly (well, gimp 
can but that's just odd). Instead, they're sort of pre-rendered 
meta-images that the gd-library can read to insert into other images.

 >
 > define hostextinfo {
 >     host_name                           somehost
 >     icon_image                          hp.gd2
 >     icon_image_alt                      9000/800/rp7420 DEH******
 >     statusmap_image                     hp.gd2
 > }
 >

This section above is basically wrong, because it will leave 
interpreting of the hp.gd2 to the browser, which doesn't understand it 
so it'll show up as a question-mark (or possibly a broken image).

 >
 > Well I made a swift substitution %s/gd2/png/ and restarted
 > nagios.
 > Now the *png icons get displayed.
 >

That's because the gd-library reads the .png images, re-renders them to 
.gd2 images internally and then creates the statusmap (which is 
basically just one big image) from those re-rendered gd2 images.

If you had instead done

	%s/\(.*icon_image.*)\(.*gd2\)/\1\2.png/

(that is, replace only .gd2 for the icon_image variable) it would still 
have worked, but the statusmap.cgi binary wouldn't have to re-render the 
images internally.

I haven't looked at that part of the code in a long time, but I vaguely 
remember Nagios having an internal speedup thing that makes it use .gd2 
images for the statusmap if they're present, so it's safe to use .png 
everywhere. However, for large networks with lots of different icons in 
use, you can get quite a speedup with using .gd2 for the statusmap_image 
and the .png for the icon_image, especially if the images reside on slow 
disks.

 > However, when I invoke the site map I cannot see any images but
 > the uninspiring question marks.
 > When I visit a host's status view I only get the browser's broken
 > image representation next to the hostname.
 >

This, however, is a bit puzzling. The sitemap *should* display the 
proper icons, while the host's status view should display the broken 
image thing. You can try running pngtogd2 on the png-files in your icon 
directory, which will make sure that what the library reads is exactly 
what it renders internally when you use the png images.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231




More information about the Help mailing list