[SOLVED] Resize Icons

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dbray925
Posts: 6
Joined: Wed Oct 07, 2015 7:33 am

[SOLVED] Resize Icons

Post 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?
Last edited by dbray925 on Thu Oct 08, 2015 10:04 am, edited 1 time in total.
dbray925
Posts: 6
Joined: Wed Oct 07, 2015 7:33 am

Re: Resize Icons

Post by dbray925 »

Attached is a rough drawing of what we are trying to do:
Nagios_Monitoring.png
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Resize Icons

Post 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?
dbray925
Posts: 6
Joined: Wed Oct 07, 2015 7:33 am

Re: Resize Icons

Post 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.
dbray925
Posts: 6
Joined: Wed Oct 07, 2015 7:33 am

Re: Resize Icons

Post 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 :)
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: [SOLVED] Resize Icons

Post 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.
Former Nagios Employee.
me.
Locked