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

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
krait200
Posts: 2
Joined: Tue Jun 21, 2016 10:04 am

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

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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.
Former Nagios Employee
krait200
Posts: 2
Joined: Tue Jun 21, 2016 10:04 am

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

Post by krait200 »

Thank you so much! All works fine!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

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