Page 1 of 1
[SOLVED] Resize Icons
Posted: Wed Oct 07, 2015 7:35 am
by dbray925
Seems there is a 20x20 and 40x40 limit of the icons under the Host and Service Detail view. Management would like to see product/service logos much bigger, instead of the text/name. Can this limit be adjusted?
Re: Resize Icons
Posted: Wed Oct 07, 2015 9:26 am
by dbray925
Attached is a rough drawing of what we are trying to do:
Re: Resize Icons
Posted: Wed Oct 07, 2015 5:07 pm
by jdalrymple
It will require recompiling core, there is no setting to modify that. I could see it quickly getting ugly for hosts that only have 1 service.
Is recompiling core with custom settings (that will have to be replaced each time you upgrade) an option in your environment?
Re: Resize Icons
Posted: Wed Oct 07, 2015 5:16 pm
by dbray925
jdalrymple wrote:Is recompiling core with custom settings (that will have to be replaced each time you upgrade) an option in your environment?
Yes, that is an option. If you can point me in the right direction, I'd appreciate it. Otherwise, I can Google around and find it. I honestly feel this should be a simple cfg setting though, and possibly something that could eventually be implemented/updated with the display_name option.
Thank you for your time.
Re: Resize Icons
Posted: Thu Oct 08, 2015 10:03 am
by dbray925
OK, I got it to work the way management wanted. Actually, once I figured it out, wasn't very difficult. I simply removed the hardcoded WIDTH and HEIGHT from the .c file, and just made sure my images were the proper size that fit our theme.
Here are the overall steps:
1.) Downloaded and extracted nagios-3.5.1.tar.gz
2.) Changed into the nagios directory and edited the following file:
vi cgi/status.c
Code: Select all
/* printf("' border=0 WIDTH=%d HEIGHT=%d ALT='%s' TITLE='%s'>", STATUS_ICON_WIDTH, STATUS_ICON_HEIGHT, (temp_host->icon_image_alt == NULL) ? "" : temp_host->icon_image_alt, (temp_host->icon_image_alt == NULL) ? "" : temp_host->icon_image_alt); */
printf("' border=0 ALT='%s' TITLE='%s'>", (temp_host->icon_image_alt == NULL) ? "" : temp_host->icon_image_alt, (temp_host->icon_image_alt == NULL) ? "" : temp_host->icon_image_alt);
3.) Compiled the updates:
./configure --prefix=/ --sysconfdir=/etc/nagios && make cgis
4.) Backed up the existing, and copied the new into place:
cp /usr/lib64/nagios/cgi-bin/status.cgi /usr/lib64/nagios/cgi-bin/status.cgi.backup
cp cgi/status.cgi /usr/lib64/nagios/cgi-bin/status.cgi
5.) Refreshed the page, and the icons resized to the actual size. Everything worked out as expected!
This was all done on a CentOS 6 server, and management is now happy

Re: [SOLVED] Resize Icons
Posted: Thu Oct 08, 2015 11:01 am
by hsmith
Thanks for letting us know how you took care of this one. I'll leave this thread open for now in case anyone has anything to add to this. Otherwise, thank you for providing this information, I'm sure it will help someone down the line.