Cgi-bin wasnt created?

Yuck, I guess i’m too much of a noob. Everything seems to have mostly gone correctly for my installs and configuring. However, none of the processes creates /usr/local/nagios/cgi-bin which is where all of the cgis should be. I found cgis in /usr/local/nagios/sbin. My experience so far tells me its not as easy as just copying the cgis from the /sbin folder to the /cgi-bin folder.

I have verified my install with nagios -v /usr/local/nagios/etc/nagios.cfg

There were a few errors involving the actual service checks, but I commented them for the time being. So my install verified correctly. I am able to view my nagios website, and i am able to successfully login to it with nagiosadmin user. Its just all of the functions in the navigation bar are looking for the cgi-bin folder, and duh, its not there. :frowning:

Suggestions?

Thank you for your assistance.

“I think I has the solution!”

I think that’s a Strong Bad quote. Gotta love HomestarRunner.com.

Anywhos, you need to read the documentation slowly and make sure you follow all of the instructions. You’ll notice that, under the documentation for setting up the web interface, cgi-bin/ isn’t a directory you create under /usr/local/nagios/; it’s an alias you create in your web server configuration file to hit your sbin directory. Go back and read the docs carefully.

Thanks for your reply SonofThunder.

I double checked myself, and found one mistake that was a typo on my part…somewhere down the line i had use cig-bin instead of cgi-bin, so all the thinks on the Nagios webpage were looking for /nagios/cig-bin/ instead of /nagios/cgi-bin/ hahaha my mistake. However, I actually went and removed the whole install, and started afresh. I actually used several resources this time that all basically give the same isntructions, but with a few minor variations and explanations. One suggested changing use_authentication=1 to use_authentication=0 temporarily just to verify the cgis were working, so the authentication process is not an extra fail point in the process. So I did that.

Once again my nagios website comes up fine, but none of the cgi functions in the navigation bar operate. They are all looking in /nagios/cgi-bin and I have added the appropriate aliasing codes into my apache conf.

I get the following error on all of them:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.34 Server at mydomain.com Port 80
(NOTE: I change the domain name in the error above for privacy reasons)

Might this be an ownership or permissions issues? All folders and files in /usr/local/nagios are owned by nagios.nagios

sample entry for the cgis:
-rwxrwxr-x 1 nagios nagios 157116 Mar 22 12:03 status.cgi*

My apache error logs shows the following sample error:

[Wed Mar 22 12:52:57 2006] [error] [client 192.168.1.1] Premature end of script headers: /usr/local/nagios/sbin/status.cgi

I appreciate your help, and I think its likely something small I need to change, but cant figure it :frowning:

Hi, just a follow up: I found SonOfThunder’s forum post here:
nagios-forum.co.uk/forum/viewtopic.php?t=36

This is the issue i seem to be experiencing. However, the solution says to use the following command if SElinux firewall needs to stay enabled:

chcon -R --reference=/var/www/cgi-bin /usr/local/nagios/sbin

Unfortunately, i do not have a /var/www/cgi-bin directory. What else should I try?

I also tried temporarily disabling selinux in /etc/selinux/config but I’m still encountering the same errors.

More suggestions?

What Linux distro are you running?

CentOS 4.3 i686

Hm…I wonder what the equivalent of /var/www/cgi-bin would be on CentOS. You’d be looking for a directory that contains CGI’s that Apache will run in spite of the SELinux policy.

[root@localhost etc]# rpm -qf /var/www/cgi-bin
httpd-2.0.52-22.ent.centos4

So, if that rpm is installed, you should have the directory in centos. I do and that rpm created it.