PDA

View Full Version : Nagios : Could not read object configuration data!


Jissouille
10-08-2008, 02:37 AM
Bonjour,

Je suis sous Debian Lenny et j'ai installé nagios 3.0.3 + ndoutils 1.4b7 (+ support mysql) depuis les dépôts Debian.
J'ai ensuite installé Centreon 2.0RC5 dans /usr/local/... en prenant soin (mais pas assez semble-t-il) d'indiquer les bons répertoires et les bons fichiers partout.

Le symptôme principal c'est que Nagios me dit "Whoops! Error: Could not read object configuration data!".

Ce Nagios fonctionnait auparavant (avec une config à la main) et je suppose que c'est donc le passage à NDO qui ne lui plaît pas. Pourtant le lancement est prometteur :

$ netstat -anp |grep 5668
tcp 0 0 0.0.0.0:5668 0.0.0.0:* LISTEN 2185/ndo2db
tcp 0 0 127.0.0.1:5668 127.0.0.1:52406 ESTABLISHED 23244/ndo2db
tcp 0 0 127.0.0.1:52406 127.0.0.1:5668 ESTABLISHED 23245/nagios3



$ echo "select count(*) from nagios_logentries;" |mysql ndo
100


[1223417083] Nagios 3.0.3 starting... (PID=23243)
[1223417083] Local time is Wed Oct 08 00:04:43 CEST 2008
[1223417083] LOG VERSION: 2.0
[1223417083] ndomod: NDOMOD 1.4b7 (10-31-2007) Copyright (c) 2005-2007 Ethan Galstad (nagios@nagios.org)
[1223417083] ndomod: Successfully connected to data sink. 0 queued items to flush.
[1223417083] Event broker module '/usr/lib/ndoutils/ndomod-mysql-3x.o' initialized successfully.
[1223417083] Finished daemonizing... (New PID=23245)


De même, nagios3 -v /etc/nagios3/nagios.cfg indique :

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check


J'ai quelques soucis dans nagios.log :

[1223417083] INITIAL SERVICE STATE: Centreon-Server;/;UNKNOWN;HARD;3;ERROR: hrStorageDescr Table : Requested table is empty or does not exist.
[1223417083] INITIAL SERVICE STATE: Centreon-Server;load;UNKNOWN;HARD;3;UNKNOWN: Received noSuchName(2) error-status at error-index 3.
[1223417083] INITIAL SERVICE STATE: Centreon-Server;memory;UNKNOWN;HARD;3;ERROR: Description Table hrStorageType : Requested table is empty or does not exist.


...mais je ne suis pas sûr que ce soit lié.

Le plus étrange c'est que Centreon semble fonctionner très bien : j'ai un hôte de test dans la base, j'y ai ajouté un test de ping et un test d'occupation de disque via SNMP et j'obtiens bien un ping ok et un disque critique (96% rempli). Donc ce ne serait que le frontend nagios qui ne trouverait pas les données ?

Là je ne sais plus trop où chercher... Si vous avez une idée, je suis preneur.

DonKiShoot
10-08-2008, 02:12 PM
Vérifies si l'export des fichiers de config se fait bien, si centreon (apache) à le droit d'écrire dans le dossier de conf de nagios.

Jissouille
10-08-2008, 05:02 PM
Vérifie si l'export des fichiers de config se fait bien, si centreon (apache) a le droit d'écrire dans le dossier de conf de nagios.

Merci de ta réponse.
On dirait que oui :


$ ls -ld /etc/nagios3
drwxrwxr-x 5 nagios www-data 4096 oct 8 13:11 /etc/nagios3

$ ls -l /etc/nagios3
total 140
-rwxrwxr-x 1 www-data www-data 1882 jui 21 09:56 apache2.conf
-rwxrwxr-x 1 www-data www-data 1827 oct 8 01:43 cgi.cfg
-rw-r--r-- 1 www-data www-data 7503 oct 8 01:43 checkcommands.cfg
-rwxrwxr-x 1 www-data www-data 2435 jui 21 09:57 commands.cfg
drwxr-xr-x 3 root root 4096 oct 3 15:40 conf.d.no
-rw-r--r-- 1 www-data www-data 1297 oct 8 01:43 contactgroups.cfg
-rw-r--r-- 1 www-data www-data 2093 oct 8 01:43 contacts.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 dependencies.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 escalations.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 hostextinfo.cfg
-rw-r--r-- 1 www-data www-data 1302 oct 8 01:43 hostgroups.cfg
-rw-r--r-- 1 www-data www-data 3070 oct 8 01:43 hosts.cfg
-rwxrwxr-x 1 www-data www-data 26 oct 3 01:10 htpasswd.users
-rw-r--r-- 1 www-data www-data 1559 oct 8 01:43 meta_commands.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_contact.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_contactgroup.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_dependencies.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_escalations.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_host.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_hostgroup.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_services.cfg
-rw-r--r-- 1 www-data www-data 1341 oct 8 01:43 meta_timeperiod.cfg
-rw-r--r-- 1 www-data www-data 3326 oct 8 01:43 misccommands.cfg
-rwxrwxr-x 1 www-data www-data 3811 oct 8 01:43 nagios.cfg
-rwxrwxr-x 1 www-data www-data 1432 oct 8 01:43 ndo2db.cfg
-rwxrwxr-x 1 www-data www-data 1347 oct 8 01:43 ndomod.cfg
-rwxrwxr-x 1 www-data www-data 1137 oct 8 01:43 resource.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 serviceextinfo.cfg
-rw-r--r-- 1 www-data www-data 1326 oct 8 01:43 servicegroups.cfg
-rw-r--r-- 1 www-data www-data 5559 oct 8 01:43 services.cfg
drwxr-xr-x 2 root root 4096 mai 13 2005 stylesheets
drwxr-xr-x 2 root root 4096 oct 3 01:10 stylesheets-ori
-rw-r--r-- 1 www-data www-data 1924 oct 8 01:43 timeperiods.cfg



Une autre idée ?

Jissouille
10-08-2008, 07:35 PM
Merci de ta réponse.
Mais tout a l'air bon :


$ ls -ld /etc/nagios3
drwxrwxr-x 5 nagios www-data 4096 oct 8 13:11 /etc/nagios3

$ ls -l /etc/nagios3
total 140
-rwxrwxr-x 1 www-data www-data 1882 jui 21 09:56 apache2.conf
-rwxrwxr-x 1 www-data www-data 1827 oct 8 01:43 cgi.cfg
-rw-r--r-- 1 www-data www-data 7503 oct 8 01:43 checkcommands.cfg
-rwxrwxr-x 1 www-data www-data 2435 jui 21 09:57 commands.cfg
drwxr-xr-x 3 root root 4096 oct 3 15:40 conf.d.no
-rw-r--r-- 1 www-data www-data 1297 oct 8 01:43 contactgroups.cfg
-rw-r--r-- 1 www-data www-data 2093 oct 8 01:43 contacts.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 dependencies.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 escalations.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 hostextinfo.cfg
-rw-r--r-- 1 www-data www-data 1302 oct 8 01:43 hostgroups.cfg
-rw-r--r-- 1 www-data www-data 3070 oct 8 01:43 hosts.cfg
-rwxrwxr-x 1 www-data www-data 26 oct 3 01:10 htpasswd.users
-rw-r--r-- 1 www-data www-data 1559 oct 8 01:43 meta_commands.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_contact.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_contactgroup.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_dependencies.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_escalations.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_host.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_hostgroup.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 meta_services.cfg
-rw-r--r-- 1 www-data www-data 1341 oct 8 01:43 meta_timeperiod.cfg
-rw-r--r-- 1 www-data www-data 3326 oct 8 01:43 misccommands.cfg
-rwxrwxr-x 1 www-data www-data 3811 oct 8 01:43 nagios.cfg
-rwxrwxr-x 1 www-data www-data 1432 oct 8 01:43 ndo2db.cfg
-rwxrwxr-x 1 www-data www-data 1347 oct 8 01:43 ndomod.cfg
-rwxrwxr-x 1 www-data www-data 1137 oct 8 01:43 resource.cfg
-rw-r--r-- 1 www-data www-data 1089 oct 8 01:43 serviceextinfo.cfg
-rw-r--r-- 1 www-data www-data 1326 oct 8 01:43 servicegroups.cfg
-rw-r--r-- 1 www-data www-data 5559 oct 8 01:43 services.cfg
drwxr-xr-x 2 root root 4096 mai 13 2005 stylesheets
drwxr-xr-x 2 root root 4096 oct 3 01:10 stylesheets-ori
-rw-r--r-- 1 www-data www-data 1924 oct 8 01:43 timeperiods.cfg


Une autre idée ?

Jissouille
10-20-2008, 03:29 PM
Personne ?

jnau
01-06-2009, 01:04 AM
Bonjour,

J'ai eut le même soucis que toi et après avoir cherché un bon moment j'ai vu d'où venais mon problème.
Il manquait tout simplement dans /etc/apache2/conf.d/nagios3.conf :
Options ExecCGI
qui permet de pouvoir exécuter les CGI.
Un petit /etc/init.d/apache2 restart et tout est rentré dans l'ordre.
L'interface web de nagios est fonctionnelle.

Jissouille
01-06-2009, 01:35 AM
Plein d'espoir, je viens d'essayer et... pas mieux. Tu le mets où exactement ton
options ExecCGI
?

J'ai essayé différents emplacements mais aucun changement. Et comment t'es-tu finalement rendu compte d'où venait le problème ?

En tout cas, merci de ton retour.