 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

27th March 2011, 09:24 PM
|
 |
Registered User
|
|
Join Date: May 2004
Location: Concord, CA
Posts: 68

|
|
Nagios change URL
Hello,
Has anyone changed the base URL for accessing Nagios via its Web interface? I would like:
http://localhost/something
instead of:
http://localhost/nagios
to enhance security.
I changed /etc/httpd/conf.d/nagios.conf and url_html_path in /etc/nagios/cgi.cfg. But the links in the left-side frame are not correct. The top two, Home and Documents, work correctly. The rest still have /nagios.
If I leave it defaulted to its original /nagios base URL everything is fine. It almost seems like /nagios is hard-coded.
Any help would be greatly appreciated. Thanks!
Brad
|

27th March 2011, 10:18 PM
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 4,976

|
|
|
Re: Nagios change URL
http://nagios.manubulon.com/traducti...configcgi.html
indicates that it's in /etc/nagios/cgi.cfg
There's a section (I'm looking at an older version of nagios, so hopefully it hasn't changed)
URL_HTML_PATH.
The default readds
url_html_path=/nagios
As always back up the file before making changes.
|

28th March 2011, 01:06 AM
|
 |
Registered User
|
|
Join Date: May 2004
Location: Concord, CA
Posts: 68

|
|
|
Re: Nagios change URL
Hi smr,
Are you a Nagios user? And have you tried to change the default URL?
Brad
|

28th March 2011, 01:29 AM
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 4,976

|
|
|
Re: Nagios change URL
Yes, I set it up at our workplace to do some basic monitoring, mostly, just to see if servers are up. However, it's an older version, as I mentioned, probably running on CentOS 4.x.
I haven't tried to change the url, it's all on an internal network, so security isn't as much of a concern for us. (Nor do I plan to do so, it's a production system, so, I can't really blithely experiment.) Did you try the method I mentioned above?
Last edited by smr54; 4th October 2012 at 08:45 PM.
|

28th March 2011, 04:55 AM
|
 |
Registered User
|
|
Join Date: May 2004
Location: Concord, CA
Posts: 68

|
|
Re: Nagios change URL
Hi smr,
Yes, I did exactly what you posted. No workie. I also posted this question on the Nagios forums with no reply at all.
Brad
|

28th March 2011, 01:40 PM
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 4,976

|
|
|
Re: Nagios change URL
Interesting. As mentioned, I really can't try it at work.
If you do get an answer on the nagios forum, please post the result. Even with a bit more intensive googling, that was the only solution that I've found.
|

28th March 2011, 08:07 PM
|
 |
Registered User
|
|
Join Date: May 2004
Location: Concord, CA
Posts: 68

|
|
|
Re: Nagios change URL
Hi smr,
Well, thanks for your help.
Here is one you can look at. I noticed that left frame links in Nagios Core are malformed. The first two, Home and Documents, are fine, but the rest are not:
/nagios/cgi-bin//status.cgi?hostgroup=all&style=hostdetail
I intentionally shortened the above. Each link has an extra '/' after "/cgi-bin/".
I also found a macro substitution bug in .cfg files. While Nagios is nice software, I think it definitely has some bugs.
Brad
|

4th October 2012, 07:54 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Location: Malaysia
Posts: 1

|
|
|
Re: Nagios change URL
Here the answer for your problem
You need to edit cgi.cfg file
#line
url_html_path=/example
then, go to /etc/httpd/conf.d/
edit file nagios.conf
#line
Alias /nagios /usr/local/nagios/share
change to
#line
Alias /example /usr/local/nagios/share
 Thanks to Allah for help...
|

3rd April 2013, 11:59 AM
|
|
Registered User
|
|
Join Date: Apr 2013
Location: greece
Posts: 1

|
|
|
Re: Nagios change URL
In addition to the above locations you have to change to config.inc.php file located in the physical_html_path location defined in the cfg.conf. In centos this is /usr/share/nagios/html/
and change the
$cfg['cgi_base_url']='<you base url as defined in the url_html_path @ cgi.cfs + /cgi-bin>';
Damn bored UI devs, they didn't bother to parse the path from cfg.cgi. Anyway.
Yeah !
|

3rd April 2013, 01:07 PM
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 4,976

|
|
|
Re: Nagios change URL
Thanks for that. I suspect this will be useful to someone who has to set up nagios, as the official docs can be unclear about many things. Don't know about the devs, but the ones who write the docs--I dunno, they're not that hard for me to understand now, but when I knew nothing about nagios, they had me saying nasty things about them.
|

3rd April 2013, 01:07 PM
|
|
Guest
|
|
Posts: n/a

|
|
|
Re: Nagios change URL
If you are concerned about security I wouldn't bother much with changing the url but instead changing the configuration such as:
Code:
order deny,allow
deny from all
allow from 127.0.0.1, xxx.xxx.xxx.xxx
AuthType Basic
AuthUserFile /etc/nagios/passwd
AuthName "nagios"
require valid-user
This will ensure only allowed hosts AND those with a valid user name and password have access.
|

3rd April 2013, 11:47 PM
|
 |
Registered User
|
|
Join Date: May 2004
Location: Concord, CA
Posts: 68

|
|
Re: Nagios change URL
Quote:
Originally Posted by basos
In addition to the above locations you have to change to config.inc.php file located in the physical_html_path location defined in the cfg.conf. In centos this is /usr/share/nagios/html/
and change the
$cfg['cgi_base_url']='<you base url as defined in the url_html_path @ cgi.cfs + /cgi-bin>';
Damn bored UI devs, they didn't bother to parse the path from cfg.cgi. Anyway.
Yeah !
|
Thanks for the reply, this was exactly what I was looking for. I, too, suspect this will be helpful to others in the future.
Brad
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 17:29 (Sunday, 19-05-2013)
|
|
 |
 |
 |
 |
|
|