Page 2 of 3

Re: fresh nagios install, running, but looks scattered

Posted: Tue Aug 27, 2013 1:12 pm
by jenelsonca
ok,

adding a "default_user" in the nagios.cfg didn't work, but adding to the cgi.cfg and doing a nagios reload does indeed show a "logged in as nagiosadmin" now, but the real issue is, I would like to use authentication, but when I turn that on and comment default_user I still get my original issue:

"It appears as though you do not have permission to view information for any of the services you requested...

leaving the default_user defined, and turning use_authentication=1, works, authent works, but shows "logged in as default" and not the actual user.

So far I guess to see data, a work around is to use a "default_user" and now I can turn "use_authentication=1" on ?

Jer

Re: fresh nagios install, running, but looks scattered

Posted: Tue Aug 27, 2013 2:17 pm
by abrist
You most likely have issues with your htpasswd configuration.

Code: Select all

htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
Also, what are the contents of your .htaccess file for the nagios web/share directory?

Re: fresh nagios install, running, but looks scattered

Posted: Tue Aug 27, 2013 5:51 pm
by jenelsonca
cat .htaccess

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
require valid-user

I reset the password, recreated a new file,

Updated every 90 seconds
NagiosĀ® Coreā„¢ 4.0.0-beta1 - www.nagios.org
Logged in as ?

Also, still get the original message, use_authentication is on, ID is in all the AUTH lines, default_user is Commented out. I know that is unsafe, and that's why I would like to leave it commented out, but this "is a work around" and at least shows data.

Jerry

Re: fresh nagios install, running, but looks scattered

Posted: Wed Aug 28, 2013 9:32 am
by abrist
Ah, your path is different than the command I posted. Try:

Code: Select all

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
This will allow you to reset the password for basic auth. You may need to clear your browser's cache afterwards.
Re-enable authentication and make sure that the "authorized_for" directives in cgi.cfg include the nagiosadmin user. Restart nagios, test, and report back.

Re: fresh nagios install, running, but looks scattered

Posted: Wed Aug 28, 2013 10:30 am
by jenelsonca
yep, I did do that. same errors above.

Re: fresh nagios install, running, but looks scattered

Posted: Wed Aug 28, 2013 10:40 am
by abrist
Lets check your logs for more definite errors to work from:

Code: Select all

tail -25 /var/log/httpd/access_log
tail -25 /var/log/httpd/error_log

Re: fresh nagios install, running, but looks scattered

Posted: Wed Aug 28, 2013 11:08 am
by jenelsonca
ok, as soon as I comment the default, get the same issues above: See my comments in between logs.

here is the access log:
10.131.86.32 - ops [28/Aug/2013:08:50:55 -0700] "GET / HTTP/1.0" 200 874 "-" "check_http/v2053 (nagios-plugins 1.4.13)"
(After reload)
10.131.19.14 - - [28/Aug/2013:08:53:29 -0700] "GET / HTTP/1.1" 401 476 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET / HTTP/1.1" 200 874 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /images/favicon.ico HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /side.php HTTP/1.1" 200 4373 "http://nagiosdev/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /stylesheets/common.css HTTP/1.1" 304 - "http://nagiosdev/side.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /images/sblogo.png HTTP/1.1" 304 - "http://nagiosdev/side.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /main.php HTTP/1.1" 200 5011 "http://nagiosdev/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /js/jquery-1.7.1.min.js HTTP/1.1" 304 - "http://nagiosdev/main.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /images/logofullsize.png HTTP/1.1" 304 - "http://nagiosdev/main.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /images/weblogo1.png HTTP/1.1" 304 - "http://nagiosdev/main.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /images/sflogo.png HTTP/1.1" 304 - "http://nagiosdev/main.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /rss-newsfeed.php HTTP/1.1" 200 579 "http://nagiosdev/main.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:42 -0700] "GET /rss-corefeed.php HTTP/1.1" 200 955 "http://nagiosdev/main.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"

Now, When I click on something like the Tactical Overview - hosts/services are all Zero'd out. logged in as is ?

10.131.19.14 - - [28/Aug/2013:08:53:51 -0700] "GET /nagios/cgi-bin/tac.cgi HTTP/1.1" 200 12430 "http://nagiosdev/side.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:51 -0700] "GET /nagios/stylesheets/common.css HTTP/1.1" 304 - "http://nagiosdev/nagios/cgi-bin/tac.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:51 -0700] "GET /nagios/stylesheets/tac.css HTTP/1.1" 304 - "http://nagiosdev/nagios/cgi-bin/tac.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:51 -0700] "GET /nagios/images/contexthelp2.gif HTTP/1.1" 304 - "http://nagiosdev/nagios/cgi-bin/tac.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:51 -0700] "GET /nagios/images/thermcrit.png HTTP/1.1" 304 - "http://nagiosdev/nagios/cgi-bin/tac.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:51 -0700] "GET /nagios/images/tacenabled.png HTTP/1.1" 304 - "http://nagiosdev/nagios/cgi-bin/tac.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:53:51 -0700] "GET /nagios/images/tacdisabled.png HTTP/1.1" 304 - "http://nagiosdev/nagios/cgi-bin/tac.cgi" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"

Now, I do a Quick search on one of my hosts: I get the same:
"It appears as though you do not have permission to view information for any of the services you requested..." Error

10.131.19.14 - - [28/Aug/2013:08:54:04 -0700] "GET /nagios/cgi-bin/status.cgi?navbarsearch=1&host=irina HTTP/1.1" 200 8630 "http://nagiosdev/side.php" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:54:04 -0700] "GET /nagios/stylesheets/status.css HTTP/1.1" 304 - "http://nagiosdev/nagios/cgi-bin/status. ... host=irina" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:54:04 -0700] "GET /nagios/js/jquery-1.7.1.min.js HTTP/1.1" 304 - "http://nagiosdev/nagios/cgi-bin/status. ... host=irina" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:54:04 -0700] "GET /nagios/images/contexthelp1.gif HTTP/1.1" 200 253 "http://nagiosdev/nagios/cgi-bin/status. ... host=irina" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:54:04 -0700] "GET /nagios/images/up.gif HTTP/1.1" 200 855 "http://nagiosdev/nagios/cgi-bin/status. ... host=irina" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"
10.131.19.14 - nagiosadmin [28/Aug/2013:08:54:04 -0700] "GET /nagios/images/down.gif HTTP/1.1" 200 856 "http://nagiosdev/nagios/cgi-bin/status. ... host=irina" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0"

And here is the error_log:

[Wed Aug 28 08:52:44 2013] [notice] SIGHUP received. Attempting to restart
[Wed Aug 28 08:52:44 2013] [notice] Digest: generating secret for digest authentication ...
[Wed Aug 28 08:52:44 2013] [notice] Digest: done
[Wed Aug 28 08:52:44 2013] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_wsgi/3.2 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Wed Aug 28 08:53:42 2013] [error] [client xxxxxxxxx] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/nagios/share/index.php on line 53
[Wed Aug 28 08:53:42 2013] [error] [client xxxxxxxxxxx] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/nagios/share/main.php on line 123, referer: http://nagiosdev/
[Wed Aug 28 08:55:55 2013] [error] [client xxxxxxxxxxxx] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/nagios/share/index.php on line 53
[Wed Aug 28 08:57:47 2013] [error] [client xxxxxxxxxx] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/nagios/share/main.php on line 123, referer: http://nagiosdev/side.php
[Wed Aug 28 08:57:51 2013] [error] [client xxxxxxxxxxxxx] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/nagios/share/index.php on line 53
[Wed Aug 28 09:00:55 2013] [error] [client xxxxxxxxxxxxxxx] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /usr/local/nagios/share/index.php on line 53

Re: fresh nagios install, running, but looks scattered

Posted: Wed Aug 28, 2013 3:52 pm
by abrist
First of all, you will need to fix your datetime/timezone issues. You can use the following doc (ignore the XI parts) to set up your datetime/timezones correctly:
http://assets.nagios.com/downloads/nagi ... m_Time.pdf
Next - Does the interface ask for your username / password at all? It should ask once and then save it for the session (or longer as it will be cached).

Re: fresh nagios install, running, but looks scattered

Posted: Thu Aug 29, 2013 5:43 pm
by jenelsonca
Yes, that part does work, it prompts just once for ID/pw but then the two issues. "Logged in as ?" and no data.

Like I mentioned, if I disable "use_authentication=0" to see the data, but I don't want to use that work around.

Jer

Re: fresh nagios install, running, but looks scattered

Posted: Fri Aug 30, 2013 9:56 am
by lmiltchev
Let's clarify... You run the following command and reset the nagiosadmin password:

Code: Select all

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
The nagiosadmin user is present in the cgi.cfg file, right?

Code: Select all

grep nagiosadmin /usr/local/nagios/etc/cgi.cfg
When you set:

Code: Select all

use_authentication=1
in the cgi.cfg file, and try to log in as nagiosadmin, you see "Logged in as ?". Is this correct?