Page 1 of 1

Locate host on statusmap.cgi instead of map.html.

Posted: Tue Jun 21, 2016 10:17 am
by krait200
Hi everyone.

I'm using Core 4.1.1 and got a question. When I enter 'Host State Information' and click 'Locate host on map' in menu on the right, I get "new" map in the frame with market host on it. Is there any way to switch new map to old one?
I couldn't find info how I can change configuration to achieve it. Is this possible at all?

Re: Locate host on statusmap.cgi instead of map.html.

Posted: Tue Jun 21, 2016 12:37 pm
by rkennedy
Look at line 900 in extinfo.c in the cgi folder -

Code: Select all

   900                  printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Locate Host On Map' TITLE='Locate Host On Map'></td><td CLASS='command'><a href='%s?host=%s'>Locate host on map</a></td></tr>\n", url_images_path, STATUSMAP_ICON, STATUSMAP_CGI, url_encode(host_name));
Now the link you're looking for I beleive is - http://192.168.4.179/nagios/cgi-bin/sta ... google.com
Which is currently set at - http://192.168.4.179/nagios/map.html?host=google.com

EDIT: I spoke with one of our developers, and you should be able to change this a bit cleaner without hacking it together.
Change it to -

Code: Select all

   900                  printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Locate Host On Map' TITLE='Locate Host On Map'></td><td CLASS='command'><a href='%s?host=%s'>Locate host on map</a></td></tr>\n", url_images_path, STATUSMAP_ICON, LEGACY_STATUSMAP_CGI, url_encode(host_name));


(leaving this old part here for reference)

You should be able to change it to -

Code: Select all

   900                  printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Locate Host On Map' TITLE='Locate Host On Map'></td><td CLASS='command'><a href='/cgi-bin/statusmap.cgi?host=%s'>Locate host on map</a></td></tr>\n", url_images_path, STATUSMAP_ICON, url_encode(host_name));
You'll then need to recompile core for the change to take affect.

Re: Locate host on statusmap.cgi instead of map.html.

Posted: Wed Jun 22, 2016 2:46 am
by krait200
Thank you so much! All works fine!

Re: Locate host on statusmap.cgi instead of map.html.

Posted: Wed Jun 22, 2016 9:49 am
by rkennedy
No problem! Felt good to look at C for a little bit :-)

Going to close this one out, but feel free to make a new thread if you have any questions in the future!