Nagiosgraph Access Forbidden

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.
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Nagiosgraph Access Forbidden

Post by tariqondego »

Just installed nagiosgraph but i am getting this error:

Code: Select all

Forbidden

You don't have permission to access /nagiosgraph/cgi-bin/show.cgi on this server.

Apache/2.4.7 (Ubuntu) Server at 192.168.253.59 Port 80
Please advise
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagiosgraph Access Forbidden

Post by tmcdonald »

Can you show us the permissions on the show.cgi file on your Nagios server?

Code: Select all

ls -l /path/to/nagiosgraph/cgi-bin/show.cgi
Former Nagios employee
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagiosgraph Access Forbidden

Post by lmiltchev »

Did you configure nagiosgraph with apache?
First configure the web server to run the nagiosgraph CGI scripts. For
example, with Apache do something like this in the Apache configuration:

ScriptAlias /nagiosgraph/cgi-bin /usr/local/nagiosgraph/cgi-bin
<Directory "/usr/local/nagiosgraph/cgi-bin">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /nagiosgraph "/usr/local/nagiosgraph/share"
<Directory "/usr/local/nagiosgraph/share">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Restart the web server:

/etc/init.d/apache2 restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: Nagiosgraph Access Forbidden

Post by tariqondego »

Yes i did configure nagiosgraph for apache2:

Code: Select all

# enable nagiosgraph CGI scripts
ScriptAlias /nagiosgraph/cgi-bin "/usr/local/nagiosgraph/cgi"
<Directory "/usr/local/nagiosgraph/cgi">
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>
# enable nagiosgraph CSS and JavaScript
Alias /nagiosgraph "/usr/local/nagiosgraph/share"
<Directory "/usr/local/nagiosgraph/share">
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>
The nagiosgraph.conf resides in /etc/apache2/conf-enabled/

The permissions for show.cgi are:

Code: Select all

-rwxr-xr-x 1 root root  5358 Ado 21 10:16 show.cgi
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagiosgraph Access Forbidden

Post by lmiltchev »

Try changing the following two lines from this:

Code: Select all

ScriptAlias /nagiosgraph/cgi-bin "/usr/local/nagiosgraph/cgi"
<Directory "/usr/local/nagiosgraph/cgi">
to this:

Code: Select all

ScriptAlias /nagiosgraph/cgi-bin "/usr/local/nagiosgraph/cgi-bin"
<Directory "/usr/local/nagiosgraph/cgi-bin">
then restart apache2. Did this fix your issue?
Be sure to check out our Knowledgebase for helpful articles and solutions!
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: Nagiosgraph Access Forbidden

Post by tariqondego »

No,beacuse the 'show.cgi' file is in /usr/local/nagiosgraph/cgi.
There is no 'cgi-bin' folder.
'bin' folder is seperate.

Still getting the same error.


please advise.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagiosgraph Access Forbidden

Post by sreinhardt »

What are the permissions of the folders above this?

Code: Select all

ls -ld /usr/local/nagiosgraph/cgi
ls -ld /usr/local/nagiosgraph
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: Nagiosgraph Access Forbidden

Post by tariqondego »

The persmissions are:

Code: Select all

drwxr-xr-x 2 root root 4096 Ado 21 10:16 /usr/local/nagiosgraph/cgi
drwxr-xr-x 10 root root 4096 Ado 21 10:16 /usr/local/nagiosgraph
Please advise.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagiosgraph Access Forbidden

Post by sreinhardt »

Well the folder permissions do have other+RX, so technically apache should be able to access at least those folders. Let's have you su into apache, and try to list and execute it.

Code: Select all

su -s /bin/bash apache (if this is ubuntu\debian the user would be apache2)
ls -lart  /usr/local/nagiosgraph
ls -lart /usr/local/nagiosgraph/cgi
/usr/local/nagiosgraph/cgi/show.cgi
exit
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tariqondego
Posts: 85
Joined: Fri Mar 28, 2014 6:18 am

Re: Nagiosgraph Access Forbidden

Post by tariqondego »

Ok,done that and it executes ok.
But from browser its still bringing the 'Forbidden' error.

Please advise.
Locked