# Nagios WEB Access



## CrestUser (May 12, 2010)

Hi All,
I am new to Linux and just inherited a position that I need some changes to the alerts in Nagios. I would like to use the WEB access since it is easier to use. I am unable to login as the admin or root account on the web but I am able to do so on the machine itself. I can logon as guest only on the web, but that account is not letting me change any settings…. Any help will be appreciated.

Regards,


----------



## wmorri (May 29, 2008)

Hi,

Welcome to TSF!!

First, I must stress that we can't help you with getting passwords, as it is stated in the rules. I would recommend that you find out who was in charge of running the Nagios server previously, and ask them for the passwords that you need. I am not to familiar with Nagios myself so I will have to do a little research. 

For now I would recommend that you use the Nagios machine itself to make changes. 

Cheers!


----------



## CrestUser (May 12, 2010)

Hi,
I do have the passwords for the admin and the root. As I mentioned, I can logon directly on the machine but since I am not familiar with any commands I like to use the webaccess which I can access via localhost/nagios. The user name and password when promted don't work unless I log on as the guest account which it lets me in but I am unable to change any settings - especially the email alerts settings. Any idea why I am able to logon to the machine with the same user name and password but unable to do the smae using the web?
Autorization Required when entering the user name and password.


Thank you!


----------



## wmorri (May 29, 2008)

Hi,

I think the reason that you can log into the computer but not the web ui is that you are logging into a user on the computer as supposed to logging into a web ui. I would also imagine that they have different usernames and passwords.

Cheers!


----------



## CrestUser (May 12, 2010)

Thanks for your help and follow up!

Regards,


----------



## wmorri (May 29, 2008)

Have you figured it out or are you still lost?


----------



## shawkins (Oct 28, 2009)

It sounds like you're getting the little browser-based popup asking for login credentials when you try to access http://yoururl.com/nagios/cgi-bin, correct?

If so, the password prompt is probably coming from Apache. Look in either the file /etc/httpd/conf/httpd.conf or, possibly, the directory /etc/httpd/conf.d for the section of the configuration related to Nagios. (Just grep for "agios" in the file or directory).

You're looking for the AuthUserFile directive, a VERY basic access control mechanism provided by apache. It will be something like:

AuthUserFile /path/to/somefile

The file "somefile" (or whatever it is on your system) typically contains a user name and password separated by a colon. If you've got root access, you can make a new version of this file using the htpasswd binary provided with the apache distribution. Something like:

htpasswd -c /path/to/somefile nagios-admin

should work. The last argument to the command line above is the Nagios user. You'll probably want to make sure that whatever user(s) you create have the same username that the existing nagios installation is expecting. (You can get this from the existing AuthUserFile, which is usually human readable.) IIRC, if your Apache-level username doesn't match with your Nagios-level username (typically defined in /etc/nagios/localhost.cfg) you can see the Nagios screens but you can't actually do anything with them because Nagios keeps denying access.

Hope that helps.

ETA: Oh, and you have to restart Apache before any configuration changes take effect. Typically either "apachectl restart" or "service httpd restart" will do the trick.

MODS: Hopefully I'm not violating any site policies by telling the guy how to change the AuthUserFile password? It says above that he already has root password, he just can't get into Nagios. If this is against site policy or whatever, apologies in advance.


----------



## CrestUser (May 12, 2010)

Greetings Shawkins,

You are sooo good. I wasn’t able to login through the browser because of the different Nagios-level username. Once I checked the file, it did contain the same username(s) I had on record. I went ahead and created another Nagios-Admin account just in case.

I really appreciate your thorough explanation that I was able to follow through considering I’ve never touched a Linux machine.


Thank you very much!


----------



## shawkins (Oct 28, 2009)

De nada. Glad it helped. Nagios is great, but it can be sort of confusing until you get a feel for what configures what.


----------



## vineetmadan89 (Jun 29, 2012)

hey i read your conversation...but i'm still not able to figure it out...i've found the htpasswd.users file in where is the username and password separated by colons but even those credentials are not working...do i need to make some changes in httpd.conf file??
pls anyone suggest
thanks in advance !!


----------

