Nagios 4.02

I have installed Nagios Core 4.02 on my FreeBSD 10 server following this guide:

http://www.xfiles.dk/guide-on-how-to-install-nagios-on-freebsd/

Everything seemed to be going ok until I logged into the Nagios website. No matter what I do in the web interface I get the following error:

Code:
Error: Could not read object configuration data!

Yet, when I run:

Code:
nagios -v /usr/local/etc/nagios/nagios.cfg

it says:

Code:
Running pre-flight check on configuration data...

Checking objects...
        Checked 8 services.
        Checked 1 hosts.
        Checked 1 host groups.
        Checked 0 service groups.
        Checked 1 contacts.
        Checked 1 contact groups.
        Checked 25 commands.
        Checked 5 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 1 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

What can I do to fix this error? I did do some research online and a couple places mentioned permissions on the directories maybe?
 
This looks as an Apache configuration error to me.

Does Apache have the right permissions to access the content in /usr/local/www/nagios. Also does /usr/local/www/nagios/cgi-bin have permission to execute CGI?

Best regards,

Allan.
 
allanc said:
This looks as an Apache configuration error to me.

Does Apache have the right permissions to access the content in /usr/local/www/nagios. Also does /usr/local/www/nagios/cgi-bin have permission to execute CGI?

Best regards,

Allan.

Turns out Apache was fine :)

It was a permission issue. I ended up adding the www account to the nagios group and hey presto it all started to work!
 
I seem to have another Nagios permission issue that I am battling to solve. I am trying to monitor two milter services: milter-greylist and spamass-milter. When nagios tries to check these two services via UNIX sockets I get a permission denied error.

In my localhost.cfg I set:

Code:
# 'check_tcp' command definition
define command{
        command_name    check_tcp_dkim
        command_line     $USER1$/check_tcp -H /var/run/dkim-filter/dkim-filter.sock

# 'check_tcp' command definition
define command{
        command_name    check_tcp_miltergreylist
        command_line     $USER1$/check_tcp -H /var/milter-greylist/milter-greylist.sock

The permissions on both socket files are as follows:

dkim-filter.sock:
Code:
srwxr-xr-x  1 postfix  postfix     0B Mar  2 08:57 /var/run/dkim-filter/dkim-filter.sock=

milter-greylist.sock:
Code:
srwxr-xr-x  1 postfix  postfix     0B Feb 23 07:40 /var/milter-greylist/milter-greylist.sock=

I have tried adding the nagios user to the postfix group and restarted the Apache and Nagios services but this hasn't helped.

How can I get Nagios to check both of these milters? What permissions need changing?
 
Hello,

I have a similar problem as @xy16644 but his/her recipe does not work in my case. I installed Nagios 4.4. following several guides available on the net (all with pretty much the same instructions). Installation and configuration was OK. Once I start Nagios in my browser it asks for credentials and then displays the Nagios menu (in the left part of the screen) but nothing else. At the same time, the file tac.cgi is displayed as downloaded (I attached a print screen). Whatever option on the menu I select it just downloads the file with the same name and a cgi extension (outages.cgi, status.cgi, etc.). I tried different browsers and described results appear with Chrome and Firefox. In IExplore instead of downloading the file it displays the full screen of text with no apparent meaning.

Adding the www user to the nagios group did not help.

I'm still a newbie in FreeBSD but my guess would be that Apache has problems with interpreting CGI. Unfortunately I don't know how to fix that. I would appreciate any ideas

P.S. I double checked the configuration in the httpd.conf file and it includes the
Code:
Options ExecCGI
directive for the Nagios cgi-bin directory.

Thanks in advance.
 

Attachments

  • nagiosprintscreen.PNG
    nagiosprintscreen.PNG
    38 KB · Views: 1,133
Last edited by a moderator:
Probably a CGI issue.

Please uncomment the following line in httpd.conf

Code:
LoadModule cgi_module libexec/apache24/mod_cgi.so
(For Apache24 ==> depends which version you installed.)
 
Back
Top