Page 1 of 1

Nagios Core 4.02 on FreeBSD 10

Posted: Sun Feb 23, 2014 5:18 am
by nagiosBSD
Hello Forum

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

http://www.xfiles.dk/guide-on-how-to-in ... n-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: Select all

Error: Could not read object configuration data!
Yet, when I run:

Code: Select all

nagios -v /usr/local/etc/nagios/nagios.cfg
it says:

Code: Select all

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 any a couple places mentioned permissions on the directories maybe?

Re: Nagios Core 4.02 on FreeBSD 10

Posted: Mon Feb 24, 2014 11:13 am
by abrist
Is nagios running?

Code: Select all

service nagios status
What config file did it load with?

Code: Select all

ps -aef | grep nagios.cfg

Re: Nagios Core 4.02 on FreeBSD 10

Posted: Thu Feb 27, 2014 2:58 am
by nagiosBSD
abrist wrote:Is nagios running?

Code: Select all

service nagios status
What config file did it load with?

Code: Select all

ps -aef | grep nagios.cfg
It seems to be working now! I had to add the www user to the nagios group.

I do have one more question though 8-)

I need to monitor a few milter services (ClamAV, Spamassasin, and OpenDKIM). These all use UNIX sockets. I have tried to use check_tcp for this but keep getting a permission denied error in Nagios.

Any ideas? I tried adding the nagios user to the Postfix group but this didn't help.

Re: Nagios Core 4.02 on FreeBSD 10

Posted: Thu Feb 27, 2014 11:53 am
by slansing
Awesome, yes the apache/http user needs to be in the group :). Can you run the following and show the output?:

Code: Select all

ls -la /path/to/your/plugins/check_tcp

Re: Nagios Core 4.02 on FreeBSD 10

Posted: Thu Feb 27, 2014 1:07 pm
by nagiosBSD
slansing wrote:Awesome, yes the apache/http user needs to be in the group :). Can you run the following and show the output?:

Code: Select all

ls -la /path/to/your/plugins/check_tcp
Here we go:

Code: Select all

(~)$ ls -la /usr/local/libexec/nagios/check_tcp
-r-xr-xr-x  1 root  wheel    61K Feb 23 08:13 /usr/local/libexec/nagios/check_tcp*

Running this manually:

Code: Select all

(~)$ sudo /usr/local/libexec/nagios/check_tcp -H /var/run/dkim-filter/dkim-filter.sock
Gives me the following output:

Code: Select all

TCP OK - 0.000 second response time on socket /var/run/dkim-filter/dkim-filter.sock|time=0.000020s;;;0.000000;10.000000

Re: Nagios Core 4.02 on FreeBSD 10

Posted: Thu Feb 27, 2014 5:34 pm
by abrist
It is most likely the permissions on /var/run/dkim-filter/dkim-filter.sock.
You may be able to fix this by editing the init script for dkim-filter or changing the umask settings.

Alternatively, you could use sudo in your command and create a sudoer rule to elevate the permissions of the check.

Re: Nagios Core 4.02 on FreeBSD 10

Posted: Sun Mar 02, 2014 5:00 am
by nagiosBSD
abrist wrote:It is most likely the permissions on /var/run/dkim-filter/dkim-filter.sock.
You may be able to fix this by editing the init script for dkim-filter or changing the umask settings.

Alternatively, you could use sudo in your command and create a sudoer rule to elevate the permissions of the check.
I seem to be battling with this!

In my /etc/rc.conf I have set:

Code: Select all

miltergreylist_enable="YES"
miltergreylist_runas="postfix:postfix"
I have added my nagios user account to the postfix group (and restarted the nagios and apache services) but this hasn't helped.

What am I missing?

Re: Nagios Core 4.02 on FreeBSD 10

Posted: Mon Mar 03, 2014 12:41 pm
by lmiltchev
Does if help if you change the permissions on the plugin?

Code: Select all

chown root:root /usr/local/libexec/nagios/check_tcp
chmod 755 /usr/local/libexec/nagios/check_tcp