Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Nagios: Could not open CGI config file [SOLVED]

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
Ctrl+Alt+Del
Guru
Guru
User avatar
Posts: 326
Joined: Sun Jul 04, 2004 5:26 pm
Location: .de
Contact:
Contact Ctrl+Alt+Del
Website

Nagios: Could not open CGI config file [SOLVED]

  • Quote

Post by Ctrl+Alt+Del » Tue Nov 29, 2005 2:31 pm

Hello fellow Gentoo Users :)
I am currently at a loss, i followed the docs on nagios.org and http://forums.gentoo.org/viewtopic-t-262408.html for the mysql instructions.
The Daemon starts alright (yes, the pre-flight check goes trough without any errors or wanrings), but i cannot get the webinterface to work.
Logging in works fine but clicking on any menulink on the left brings up:

Error: Could not open CGI config file '/etc/nagios/cgi.cfg' for reading!

Here are some things you should check in order to resolve this error:

1. Make sure you've installed a CGI config file in its proper location. See the error message about for details on where the CGI is expecting to find the configuration file. A sample CGI configuration file (named cgi.cfg) can be found in the sample-config/ subdirectory of the Nagios source code distribution.
2. Make sure the user your web server is running as has permission to read the CGI config file.

The File cgi.cfg does exist (in /etc/nagios/) , is based on /usr/share/doc/nagios-core-1.3/sample-configs/, belongs to nagios:nagios and is chmodded 644. So the user apache should be able to read the file properly. I have also added the apache user to the nagios group, but no success. I tried chmodding it to 777 as well (shouldn't be necessary, but who knows.)

I have found a few mailinglist and forum reports from fedora users having a similar problem, in their case it worked with apache authentication disabled. Even though that doesn't make any sense to me, i tried it. Disabling Auth didn't change anything.

Neither the Apache error logs nor the nagios logs show any errors when trying to access any of the Nagios Pages.

Any Ideas where to look for an error?
Last edited by Ctrl+Alt+Del on Thu Mar 30, 2006 7:25 pm, edited 1 time in total.
Top
gondolin
Apprentice
Apprentice
User avatar
Posts: 158
Joined: Wed Apr 09, 2003 10:08 am

  • Quote

Post by gondolin » Thu Jan 12, 2006 9:27 am

I'm having the same problem, did you got it working ?
Top
Ctrl+Alt+Del
Guru
Guru
User avatar
Posts: 326
Joined: Sun Jul 04, 2004 5:26 pm
Location: .de
Contact:
Contact Ctrl+Alt+Del
Website

  • Quote

Post by Ctrl+Alt+Del » Thu Jan 12, 2006 10:47 am

Nope i left it aside. Nagios 2.0rc1 went ~x86 a few days ago, maybe i'm gonna give that a shot :)
Top
gondolin
Apprentice
Apprentice
User avatar
Posts: 158
Joined: Wed Apr 09, 2003 10:08 am

  • Quote

Post by gondolin » Thu Jan 12, 2006 11:38 am

I have no luck with 2.0rc1

just found it on 2.1rc1 , the permissions on /etc/nagios are wrong should be 755
Top
soth
Apprentice
Apprentice
User avatar
Posts: 207
Joined: Fri Sep 12, 2003 12:27 am

  • Quote

Post by soth » Thu Jan 26, 2006 9:47 pm

Same permissionsproblem for me on 2.0_rc2

chmod 755 /etc/nagios...

now I have another problem:

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

If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.

tried with asterisk as to let whoever was authenticated get access to all of nagios, but it doesn't work.
No messages in apachelog or in /var/nagios/nagios.log either.

Permissions on /usr/nagios/sbin seems right (755), and so does the files in there...
- Never argue with an idiot. They just drag you down to your level and beat you with experience.

Join the adopt an unanswered post initiative today
Top
Ctrl+Alt+Del
Guru
Guru
User avatar
Posts: 326
Joined: Sun Jul 04, 2004 5:26 pm
Location: .de
Contact:
Contact Ctrl+Alt+Del
Website

  • Quote

Post by Ctrl+Alt+Del » Fri Jan 27, 2006 12:21 am

It still does not work for me with rc2 and permissions set to 755.
I do not have the faintest idea on what to do with nagios any more
Top
soth
Apprentice
Apprentice
User avatar
Posts: 207
Joined: Fri Sep 12, 2003 12:27 am

  • Quote

Post by soth » Fri Jan 27, 2006 6:33 am

Did you check the apache conf?

you need something like this:

Code: Select all

<IfDefine NAGIOS>
        ScriptAlias /nagios/cgi-bin/ /usr/nagios/sbin/
        <Directory "/usr/nagios/sbin/">
                AllowOverride AuthConfig
                Options ExecCGI
                Order allow,deny
                Allow from all
        </Directory>
        Alias /nagios /usr/nagios/share/
        <Directory "/usr/nagios/share">
                AllowOverride AuthConfig
                Order allow,deny
                Allow from all
         </Directory>
</IfDefine>
it's important that you have the AllowOverride AuthConfig and Options ExecCGI.

Furthermore, you need .htaccess in two places:

Code: Select all

/usr/nagios/share/
and

Code: Select all

 /usr/nagios/sbin/
The contents of them are in the docs...

Have you got all that?
- Never argue with an idiot. They just drag you down to your level and beat you with experience.

Join the adopt an unanswered post initiative today
Top
Ctrl+Alt+Del
Guru
Guru
User avatar
Posts: 326
Joined: Sun Jul 04, 2004 5:26 pm
Location: .de
Contact:
Contact Ctrl+Alt+Del
Website

  • Quote

Post by Ctrl+Alt+Del » Thu Mar 30, 2006 7:24 pm

Ok i finally gave it another shot and figured the problem out.
i chmodded all the files in /etc/nagios 755 but not the directory itself, pages are now loading properly
I feel soooo retarted :)
Top
neildotwilliams
n00b
n00b
User avatar
Posts: 4
Joined: Sun Jan 02, 2005 3:35 pm
Location: UK
Contact:
Contact neildotwilliams
Website

Folder access

  • Quote

Post by neildotwilliams » Wed May 10, 2006 7:20 pm

I had to change the ownership of the folder.

chown apache:apache /etc/nagios

Well it worked for me!
Top
Post Reply

9 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic