Nagios Core 4.02 on FreeBSD 10

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.
Locked
nagiosBSD
Posts: 4
Joined: Sun Feb 23, 2014 4:48 am

Nagios Core 4.02 on FreeBSD 10

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Core 4.02 on FreeBSD 10

Post 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
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.
nagiosBSD
Posts: 4
Joined: Sun Feb 23, 2014 4:48 am

Re: Nagios Core 4.02 on FreeBSD 10

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios Core 4.02 on FreeBSD 10

Post 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
nagiosBSD
Posts: 4
Joined: Sun Feb 23, 2014 4:48 am

Re: Nagios Core 4.02 on FreeBSD 10

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios Core 4.02 on FreeBSD 10

Post 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.
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.
nagiosBSD
Posts: 4
Joined: Sun Feb 23, 2014 4:48 am

Re: Nagios Core 4.02 on FreeBSD 10

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core 4.02 on FreeBSD 10

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked