# Nagios Error: Could not read object configuration [SOLVED]

## b1u3p001

Hi!

Today i merged nagios for the first time.

when i browse to http://localhost/nagios and klick one item beneath "Monitoring" i got the following:

Whoops!

Error: Could not read object configuration data!

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

1. Verify configuration options using the -v command-line option to check for errors.

2. Check the Nagios log file for messages relating to startup or status data errors.

3. Make sure you've compiled the main program and the CGIs to use the same object data storage options (i.e. default text file or template-based file).

i checkt the first thing. there where some problems but i solved them.

the log-file should be placed in /var/nagios/nagios.log but there is none. and i couldn't find it anywhere else.

i played with the permissions. i studied the documentation if gentoo forgot something and of corse i searched with google and in other forums.

but i couldn"t find anything usefull.

can anybody help

b1u3p001Last edited by b1u3p001 on Mon Jun 19, 2006 2:59 pm; edited 1 time in total

----------

## richard.scott

Check the access rights to /etc/nagios.

I seem to remember them being incorrect for apache to have read access to this folder.

----------

## firesox

```
drwxrwxr-x  4 nagios nagios   376 Jun 19 14:38 .

drwxr-xr-x 16 root   root     392 Jun 12 12:45 ..

-rw-r--r--  1 root   root       0 Jun 12 12:45 .keep

drwxrwxr-x  2 nagios nagios   352 Jun 19 00:00 archives

-rw-rw-r--  1 nagios nagios   240 Jun 12 13:41 comments.dat

-rw-rw-r--  1 nagios nagios   241 Jun 12 13:41 downtime.dat

-rw-r--r--  1 nagios nagios     6 Jun 12 13:41 nagios.lock

-rw-rw-r--  1 nagios nagios 10275 Jun 19 14:04 nagios.log

-rw-r--r--  1 nagios nagios 65363 Jun 12 13:41 objects.cache

-rw-------  1 nagios nagios 98252 Jun 19 13:41 retention.dat

drwsrwsr-x  2 nagios apache   104 Jun 12 13:41 rw

-rw-rw-r--  1 nagios nagios 92974 Jun 19 14:38 status.dat

-rw-r--r--  1 nagios nagios     0 Jun 12 13:41 status.sav

./archives:

total 80

drwxrwxr-x 2 nagios nagios   352 Jun 19 00:00 .

drwxrwxr-x 4 nagios nagios   376 Jun 19 14:38 ..

-rw-r--r-- 1 root   root       0 Jun 12 12:45 .keep

-rw-r--r-- 1 nagios nagios  4845 Jun 12 23:41 nagios-06-13-2006-00.log

-rw-rw-r-- 1 nagios nagios 11581 Jun 13 23:41 nagios-06-14-2006-00.log

-rw-rw-r-- 1 nagios nagios 11502 Jun 14 23:41 nagios-06-15-2006-00.log

-rw-rw-r-- 1 nagios nagios 10668 Jun 15 23:41 nagios-06-16-2006-00.log

-rw-rw-r-- 1 nagios nagios 10671 Jun 16 23:41 nagios-06-17-2006-00.log

-rw-rw-r-- 1 nagios nagios  9941 Jun 17 23:41 nagios-06-18-2006-00.log

-rw-rw-r-- 1 nagios nagios  9942 Jun 18 23:41 nagios-06-19-2006-00.log

./rw:

total 0

drwsrwsr-x 2 nagios apache 104 Jun 12 13:41 .

drwxrwxr-x 4 nagios nagios 376 Jun 19 14:38 ..

-rw-r--r-- 1 nagios apache   0 Jun 12 12:45 .keep

prw-rw---- 1 nagios apache   0 Jun 12 13:41 nagios.cmd

```

Your /var/nagios should look the one above. Important is the pipe "nagios.cmd".

----------

## richard.scott

 *richard.scott wrote:*   

> Check the access rights to /etc/nagios.
> 
> I seem to remember them being incorrect for apache to have read access to this folder.

 

I've just been looking over my server config and remembered that I fixed this by adding Apache to the nagios group

```
# usermod -G nagios apache
```

That way the apache daemon can read files in /etc/nagios  :Smile: 

I did post a bug report for this, but can't get access to bugs.gentoo.org to find out what its status is.

----------

## b1u3p001

i've checked de permissions of /etc/nagios.

apache can access it. (drwxr-x--- nagios apache /etc/nagios)

i also added the apache-user to the group nagios.

i created the pipe "prw-rw---- nagios apache /var/nagios/rw/nagios.cmd"

sorry. nothing happend.

no logfiles, same error in the browser.

any other ideas?

ps: it is nagios 2.4

----------

## richard.scott

Have you added -D NAGIOS to /etc/conf.d/apache2?

I'm just doing a fresh install with the following to see if I can re-create your troubles:

```
[ebuild  N    ] net-analyzer/nagios-core-2.4  USE="apache2 -debug -noweb perl" 1,703 kB

[ebuild  N    ] net-analyzer/nagios-imagepack-1.0  1,610 kB

[ebuild  N    ] net-analyzer/nagios-plugins-1.4.2  USE="-ipv6 ldap mysql nagios-dns nagios-game nagios-ntp nagios-ping nagios-ssh -postgres -radius samba snmp ssl -ups" 948 kB

[ebuild  N    ] net-analyzer/nagios-nsca-2.5  96 kB

[ebuild  N    ] net-analyzer/nagios-nrpe-2.3  USE="-command-args ssl" 95 kB

[ebuild  N    ] net-analyzer/nagios-2.4  0 kB
```

----------

## richard.scott

 *b1u3p001 wrote:*   

> i also added the apache-user to the group nagios.

 

Just a thought, but did you restart apache? you'll *need* to do that for the new group permissions to take effect.

----------

## b1u3p001

-D NAGIOS is added to /etc/conf.d/apache2

apache was restartet 10000 times i think  :Smile: 

"emerge -pv nagios-core nagios-imagepack nagios-plugins nagios-nsca nagios-nrpe nagios" gives me the following:

[ebuild   R   ] net-analyzer/nagios-core-2.4  USE="apache2 perl -debug -noweb" 0 kB

[ebuild   R   ] net-analyzer/nagios-imagepack-1.0-r1  0 kB

[ebuild   R   ] net-analyzer/nagios-plugins-1.4.3  USE="ipv6 ldap mysql nagios-dns nagios-ntp nagios-ping nagios-ssh postgres radius samba snmp ssl ups -nag

ios-game" 0 kB

[ebuild   R   ] net-analyzer/nagios-nsca-2.6  0 kB

[ebuild   R   ] net-analyzer/nagios-nrpe-2.5.1  USE="ssl -command-args" 0 kB

[ebuild     UD] net-analyzer/nagios-imagepack-1.0 [1.0-r1] 0 kB

[ebuild   R   ] net-analyzer/nagios-2.4  0 kB

i think i will try to remove some use-flags in /etc/portage/package.use

----------

## richard.scott

Does your nagios process actually start when you run '/etc/init.d/nagios start'.... does it appear in your process list.

```
# ps -edf | grep nagios

nagios    1291     1  0 14:55 ?        00:00:04 /usr/nagios/bin/nagios -d /etc/nagios/nagios.cfg
```

also, does it stop when you run /etc/init.d/nagios stop. I've had times when I've had to "killall -9 nagios" to get it to quit so that I can re-start it correctly.

----------

## b1u3p001

it works!

it was a very strange problem.

i wondered why i didn't have the file /etc/init.d/nagios but it was the first time it tried nagios. so i didn't know it better.

after you wrote me that it should be there i remerged the nagios packages and there it is.

now i only had to to do a "/etc/init.d/nagios start" and that's it.

thank you very much

----------

## richard.scott

excellent   :Smile: 

----------

