cgi error

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.
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: cgi error

Post by veenm »

when i run the below command it shows disabled .

cat /etc/sysconfig/selinux
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: cgi error

Post by abrist »

That is just the config file, we need to know if the command "gentenforce" reports "Disabled". If not, you need to restart you server so that the /etc/sysconfig/selinux setting will apply.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: cgi error

Post by veenm »

In my system it says "gentenforce: command not found"

[root@xxx~]# gentenforce
-bash: gentenforce: command not found

and also find below output.

[root@xxx~]# cat /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: cgi error

Post by veenm »

gentenforce is showing disabled in my system.

[root@xxxetc]# getenforce
Disabled
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: cgi error

Post by abrist »

What linux distro are you running?
Could you post the contents of your apache vhost file and the paths to your cgi-bins?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: cgi error

Post by veenm »

i am using RHEL 6-x86_64, and path to cgi bin is "/usr/local/nagios/sbin". I have attached the content of the sbin directory. and i have attached the httpd.conf file

-rw-r--r--. 1 root root 34418 Aug 2 19:59 /etc/httpd/conf/httpd.conf
Attachments
httpd.conf.txt
(33.61 KiB) Downloaded 232 times
sbin.txt
(2.82 KiB) Downloaded 214 times
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: cgi error

Post by abrist »

The httpd.conf file does not include any configuration for nagios. Do you have a nagios vhost file?

Code: Select all

ls -la /etc/httpd/conf.d/
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: cgi error

Post by veenm »

below is the output
[root@xxx conf.d]# ls -la /etc/httpd/conf.d/
total 60
drwxr-xr-x. 2 root root 4096 Sep 27 10:29 .
drwxr-xr-x. 4 root root 4096 Sep 19 10:33 ..
-rw-r--r--. 1 root root 295 Aug 2 19:59 manual.conf
-rw-r--r--. 1 root root 118 May 20 2009 mod_dnssd.conf
-rw-r--r--. 1 root root 1010 Sep 20 14:01 nagios.conf
-rw-r--r--. 1 root root 1796 Apr 22 2005 perl.conf
-rw-r--r--. 1 root root 674 Jul 12 16:39 php.conf
-rw-r--r--. 1 root root 922 Sep 23 09:26 pnp4nagios.conf
-rw-r--r--. 1 root root 392 Aug 2 20:02 README
-rw-r--r--. 1 root root 9473 Aug 2 19:59 ssl.conf
-rw-r--r--. 1 root root 352 Sep 9 2004 webalizer.conf
-rw-r--r--. 1 root root 299 Aug 2 19:59 welcome.conf
-rw-r--r--. 1 root root 43 Aug 23 2012 wsgi.conf
Attachments
nagios.cfg.txt
(43.99 KiB) Downloaded 211 times
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: cgi error

Post by abrist »

What are the contents of:

Code: Select all

cat /etc/httpd/conf.d/nagios.conf
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: cgi error

Post by veenm »

Below are the content .
[root@CNPUDAS011 ~]# cat /etc/httpd/conf.d/nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Locked