You don't have permission to access /nagios/ on this server.

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

Re: You don't have permission to access /nagios/ on this ser

Post by rkennedy »

Could you please upload it? I'm not seeing anything attached in the post.
Former Nagios Employee
sachinambardekar
Posts: 23
Joined: Sat Jan 07, 2017 7:21 pm

Re: You don't have permission to access /nagios/ on this ser

Post by sachinambardekar »

Uploaded file in zip format.

Thank you,
Sachin A
Attachments
objects.zip
Object Cache File
(1.95 KiB) Downloaded 150 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: You don't have permission to access /nagios/ on this ser

Post by tgriep »

What OS and version did you install Nagios Core on?
Can you login to the Nagios server as root, run the following commands and port the output?

Code: Select all

chage -l nagios
grep nag /etc/group
grep nag /etc/passwd
ls -lR /usr/local/nagios/etc
It could be a permission issue causing the error that you are having and the above will help to narrow down the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sachinambardekar
Posts: 23
Joined: Sat Jan 07, 2017 7:21 pm

Re: You don't have permission to access /nagios/ on this ser

Post by sachinambardekar »

[root@hdputils ~]# cat /etc/oracle-release
Oracle Linux Server release 6.8

[root@hdputils ~]# chage -l nagios
Last password change : Jan 14, 2017
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7

[root@hdputils ~]# grep nag /etc/group
nagios:x:500:apache

[root@hdputils ~]# grep nag /etc/passwd
nagios:x:500:500::/home/nagios:/bin/bash

[root@hdputils ~]# ls -lR /usr/local/nagios/etc
/usr/local/nagios/etc:
total 88
-rw-rw-r-- 1 nagios nagios 12744 Jan 14 11:25 cgi.cfg
-rw-r--r-- 1 root root 12744 Jan 14 11:59 cgi.cfg.orig
-rw-r--r-- 1 root root 26 Jan 14 11:31 htpasswd.users
-rw-rw-r-- 1 nagios nagios 44831 Jan 14 11:25 nagios.cfg
drwxrwxr-x 2 nagios nagios 4096 Jan 14 16:16 objects
-rw-rw---- 1 nagios nagios 1312 Jan 14 11:25 resource.cfg

/usr/local/nagios/etc/objects:
total 48
-rw-rw-r-- 1 nagios nagios 7688 Jan 14 11:25 commands.cfg
-rw-rw-r-- 1 nagios nagios 2138 Jan 14 11:25 contacts.cfg
-rw-rw-r-- 1 nagios nagios 5379 Jan 14 11:25 localhost.cfg
-rw-rw-r-- 1 nagios nagios 3096 Jan 14 11:25 printer.cfg
-rw-rw-r-- 1 nagios nagios 3265 Jan 14 11:25 switch.cfg
-rw-rw-r-- 1 nagios nagios 10621 Jan 14 11:25 templates.cfg
-rw-rw-r-- 1 nagios nagios 3180 Jan 14 11:25 timeperiods.cfg
-rw-rw-r-- 1 nagios nagios 3991 Jan 14 11:25 windows.cfg


Please advise.

Thank you,
Sachin A
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: You don't have permission to access /nagios/ on this ser

Post by tgriep »

Those settings look good, can you run the following as root on the server and upload the /tmp/ls.txt file to this post?

Code: Select all

ls -lR /usr/local/nagios >/tmp/ls.txt
Can you post this file as well?

Code: Select all

/etc/httpd/conf.d/nagios.conf
Be sure to check out our Knowledgebase for helpful articles and solutions!
sachinambardekar
Posts: 23
Joined: Sat Jan 07, 2017 7:21 pm

Re: You don't have permission to access /nagios/ on this ser

Post by sachinambardekar »

Uploaded requested output files.
Attachments
nagios.conf
nagios conf file
(1.64 KiB) Downloaded 381 times
ls.txt
output from ls command
(31.08 KiB) Downloaded 340 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: You don't have permission to access /nagios/ on this ser

Post by tgriep »

Can you run the following commands as root and post the output?

Code: Select all

ip addr
cat /etc/hosts
hostname -a
ps -ef
Do you see any errors in the /var/log/httpd/error_log file while you try and access the Nagios Menus?
Be sure to check out our Knowledgebase for helpful articles and solutions!
sachinambardekar
Posts: 23
Joined: Sat Jan 07, 2017 7:21 pm

Re: You don't have permission to access /nagios/ on this ser

Post by sachinambardekar »

Uploaded requested output from the command in a txt file as well as error_log file from /var/log/httpd/ in a zip format.

Please advise.

Thank you,
Sachin A
Attachments
nagios_output.txt
(10.26 KiB) Downloaded 353 times
error_log.zip
error_log file
(567 Bytes) Downloaded 172 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: You don't have permission to access /nagios/ on this ser

Post by tgriep »

Thanks for the files.
From what I can see,all of the settings and permissions are correct and you should be able to see the status information.
The only thing left that hasn't been checked it the nagiosadmin account that is setup in the htpasswd file.

Code: Select all

/usr/local/nagios/etc/htpasswd.users
Try recreating the account and see if you can view the data in the GUI.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sachinambardekar
Posts: 23
Joined: Sat Jan 07, 2017 7:21 pm

Re: You don't have permission to access /nagios/ on this ser

Post by sachinambardekar »

Support,

I can login to Nagios UI using nagiosadmin user successfully, however, as per https://support.nagios.com/kb/article.p ... ategory=58 , under Test Plugins section, I don't see "Commands menu" to "Re-schedule the next check" I am again attaching the error screenshot for your review.

[root@hdputils ~]# ls -ltr /usr/local/nagios/etc/htpasswd.users
-rw-r--r-- 1 root root 26 Jan 14 11:31 /usr/local/nagios/etc/htpasswd.users
[root@hdputils ~]#

Please advise.

Thank you,
Sachin A
Locked