[SOLVED] Resize Icons
[SOLVED] Resize Icons
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?
Last edited by dbray925 on Thu Oct 08, 2015 10:04 am, edited 1 time in total.
Re: Resize Icons
Attached is a rough drawing of what we are trying to do:
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Resize Icons
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?
Is recompiling core with custom settings (that will have to be replaced each time you upgrade) an option in your environment?
Re: Resize Icons
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.jdalrymple wrote:Is recompiling core with custom settings (that will have to be replaced each time you upgrade) an option in your environment?
Thank you for your time.
Re: Resize Icons
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
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
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);./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
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.
Former Nagios Employee.
me.
me.