Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 27th March 2011, 09:24 PM
BradW's Avatar
BradW Offline
Registered User
 
Join Date: May 2004
Location: Concord, CA
Posts: 68
windows_vistafirefox
Question 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
Reply With Quote
  #2  
Old 27th March 2011, 10:18 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,976
linuxchrome
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.
Reply With Quote
  #3  
Old 28th March 2011, 01:06 AM
BradW's Avatar
BradW Offline
Registered User
 
Join Date: May 2004
Location: Concord, CA
Posts: 68
windows_vistafirefox
Re: Nagios change URL

Hi smr,

Are you a Nagios user? And have you tried to change the default URL?

Brad
Reply With Quote
  #4  
Old 28th March 2011, 01:29 AM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,976
linuxchrome
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.
Reply With Quote
  #5  
Old 28th March 2011, 04:55 AM
BradW's Avatar
BradW Offline
Registered User
 
Join Date: May 2004
Location: Concord, CA
Posts: 68
windows_vistafirefox
Unhappy 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
Reply With Quote
  #6  
Old 28th March 2011, 01:40 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,976
linuxchrome
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.
Reply With Quote
  #7  
Old 28th March 2011, 08:07 PM
BradW's Avatar
BradW Offline
Registered User
 
Join Date: May 2004
Location: Concord, CA
Posts: 68
windows_vistafirefox
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
Reply With Quote
  #8  
Old 4th October 2012, 07:54 PM
shafiq1988 Offline
Registered User
 
Join Date: Oct 2012
Location: Malaysia
Posts: 1
linuxchrome
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...
Reply With Quote
  #9  
Old 3rd April 2013, 11:59 AM
basos Offline
Registered User
 
Join Date: Apr 2013
Location: greece
Posts: 1
linuxfirefox
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 !
Reply With Quote
  #10  
Old 3rd April 2013, 01:07 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 4,976
linuxfirefox
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.
Reply With Quote
  #11  
Old 3rd April 2013, 01:07 PM
pjfg
Guest
 
Posts: n/a
linuxopera
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.
Reply With Quote
  #12  
Old 3rd April 2013, 11:47 PM
BradW's Avatar
BradW Offline
Registered User
 
Join Date: May 2004
Location: Concord, CA
Posts: 68
windows_vistafirefox
Smile Re: Nagios change URL

Quote:
Originally Posted by basos View Post
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
Reply With Quote
Reply

Tags
change, nagios, url

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios F11 You don't have permission to access /nagios/ on this server. BWDRKR2 Using Fedora 2 4th March 2010 11:06 PM
Nagios v3 RPM - when? mjurgens Fedora Focus 1 26th June 2008 07:39 AM


Current GMT-time: 17:29 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat