View previous topic :: View next topic |
Author |
Message |
b1u3p001 n00b
Joined: 01 Mar 2004 Posts: 8
|
Posted: Sun Jun 18, 2006 7:31 pm Post subject: Nagios Error: Could not read object configuration [SOLVED] |
|
|
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
b1u3p001
Last edited by b1u3p001 on Mon Jun 19, 2006 2:59 pm; edited 1 time in total |
|
Back to top |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Mon Jun 19, 2006 12:39 pm Post subject: |
|
|
Check the access rights to /etc/nagios.
I seem to remember them being incorrect for apache to have read access to this folder. |
|
Back to top |
|
|
firesox Tux's lil' helper
Joined: 24 Nov 2005 Posts: 132
|
Posted: Mon Jun 19, 2006 12:40 pm Post subject: |
|
|
Code: | 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". |
|
Back to top |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Mon Jun 19, 2006 1:51 pm Post subject: |
|
|
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
Code: | # usermod -G nagios apache |
That way the apache daemon can read files in /etc/nagios
I did post a bug report for this, but can't get access to bugs.gentoo.org to find out what its status is. |
|
Back to top |
|
|
b1u3p001 n00b
Joined: 01 Mar 2004 Posts: 8
|
Posted: Mon Jun 19, 2006 2:03 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Mon Jun 19, 2006 2:19 pm Post subject: |
|
|
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:
Code: | [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 |
|
|
Back to top |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Mon Jun 19, 2006 2:32 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
b1u3p001 n00b
Joined: 01 Mar 2004 Posts: 8
|
Posted: Mon Jun 19, 2006 2:42 pm Post subject: |
|
|
-D NAGIOS is added to /etc/conf.d/apache2
apache was restartet 10000 times i think
"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 |
|
Back to top |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Mon Jun 19, 2006 2:47 pm Post subject: |
|
|
Does your nagios process actually start when you run '/etc/init.d/nagios start'.... does it appear in your process list.
Code: | # 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. |
|
Back to top |
|
|
b1u3p001 n00b
Joined: 01 Mar 2004 Posts: 8
|
Posted: Mon Jun 19, 2006 2:56 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Mon Jun 19, 2006 2:57 pm Post subject: |
|
|
excellent |
|
Back to top |
|
|
|