View Full Version : DB Error: no such database
djibishe
05-03-2007, 01:36 PM
bonjour! j'viens d'installer oreon! l'installation s'est bien deroulé ss probleme apparente! et quant j'veux acceder à la page d'aceuil ça m'affiche : DB Error: no such database!
j'ai essayé de chercher ds le forum mais ne n'ai pas trouvé des solution! merci bcp
djibishe
05-03-2007, 03:08 PM
plz help :-( :-( :-( :-(
salut,
1- on va verifier que tu as bien tes base oreon et ODS.
connecte toi à mysql :
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| OreonDB |
| OreonDataStorage |
| test |
+--------------------+
enfin ça doit correspondre aux noms des bases que tu as mis pendant l'install (Oreon et ods)
verifie que tu as bien une structure dedans :
mysql> use OreonDB;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+----------------------------------------+
| Tables_in_OreonDB |
+----------------------------------------+
| cfg_cgi |
| cfg_nagios |
| cfg_perfparse |
| cfg_resource |
| command |
| contact |
| contact_hostcommands_relation |
| contact_servicecommands_relation |
| contactgroup |
| contactgroup_contact_relation |
| contactgroup_host_relation |
| contactgroup_hostgroup_relation |
| contactgroup_service_relation |
| contactgroup_servicegroup_relation |
| cron_operation |
| css_color_menu |
| dependency |
| dependency_hostChild_relation |
| dependency_hostParent_relation |
| dependency_hostgroupChild_relation |
| dependency_hostgroupParent_relation |
| dependency_metaserviceChild_relation |
| dependency_metaserviceParent_relation |
| dependency_serviceChild_relation |
| dependency_serviceParent_relation |
| dependency_servicegroupChild_relation |
| dependency_servicegroupParent_relation |
| downtime |
| escalation |
| escalation_contactgroup_relation |
| escalation_host_relation |
| escalation_hostgroup_relation |
| escalation_meta_service_relation |
| escalation_service_relation |
| extended_host_information |
| extended_service_information |
| general_opt |
| giv_components |
| giv_components_template |
| giv_graphT_componentT_relation |
| giv_graphs |
| giv_graphs_template |
| host |
| host_hostparent_relation |
| host_service_relation |
| hostgroup |
| hostgroup_relation |
| inventory_index |
| inventory_log |
| inventory_mac_address |
| inventory_manufacturer |
| lca_define |
| lca_define_contactgroup_relation |
| lca_define_host_relation |
| lca_define_hostgroup_relation |
| lca_define_servicegroup_relation |
| lca_define_topology_relation |
| log_archive_file_name |
| log_archive_host |
| log_archive_service |
| meta_contactgroup_relation |
| meta_service |
| meta_service_relation |
| modules_informations |
| nagios_macro |
| nagios_server |
| ods_view_details |
| oreon_informations |
| purge_policy |
| reporting_diff_email |
| reporting_diff_list |
| reporting_email_list_relation |
| service |
| servicegroup |
| servicegroup_relation |
| session |
| timeperiod |
| topology |
| topology_JS |
| traps |
| traps_service_relation |
| view_city |
| view_country |
| view_map |
+----------------------------------------+
84 rows in set (0.00 sec)
2- verifier les droits de l'utilisateur se connectant a ces tables
mysql> show grants for 'OreonDB'@'localhost';
+----------------------------------------------------------------------------------------------------------------+
| Grants for OreonDB@localhost |
+----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'OreonDB'@'localhost' IDENTIFIED BY PASSWORD '424242424242424242'|
| GRANT ALL PRIVILEGES ON `OreonDataStorage`.* TO 'OreonDB'@'localhost' WITH GRANT OPTION |
| GRANT ALL PRIVILEGES ON `OreonDB`.* TO 'OreonDB'@'localhost' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)
note: ca depend du nom d'utilisateur que tu as mis à l'install pour oreon (ici OreonDB).
3- verifier que les infos sont les bonnes dans le fichier de conf
cat /usr/local/oreon/www/oreon.conf.php | grep \$conf
$conf_oreon['host'] = "localhost";
$conf_oreon['user'] = "OreonDB";
$conf_oreon['password'] = "42_H2G2";
$conf_oreon['db'] = "OreonDB";
$conf_oreon['ods'] = "OreonDataStorage";
verifier une dernière fois que cette utilisateur peut se connecter à ce server
# mysql -h localhost -uOreonDB -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 159301 to server version: 5.0.27-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| OreonDB |
| OreonDataStorage |
| test |
+--------------------+
4 rows in set (0.00 sec)
Si tout est bon jusque là tu as surement une erreur sur la structure de données.
netzuko
05-24-2007, 09:18 AM
merci pour les explications ;)
djibishe
05-24-2007, 09:33 AM
merci je vais tester et je vous tiens au courants...
netzuko
05-24-2007, 09:47 AM
j'ai toujours le meme probleme qui persiste alors dis moi ce qu'il se passe de ton coté stp ;)
Je viens de rencontrer un probleme similaire, c'etait selinux qui faisait le bazard.
Essaie de le desactiver pour debugguer.
netzuko
05-25-2007, 09:09 AM
il est déjà résactivé je crois.
Dans /etc/sysconfig/selinux j'ai :
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
ça suffira ça?
mais, en fait, honnetement, je ne vois pas d'où peut venir le problème du tout.
ca va faire 2 semaines que je suis bloqué.
j attend votre réponse.
merci d'avance.
netzuko
05-25-2007, 10:22 AM
j'ai modifié quelques paramètres de la configuration, et lorsque que je lance le dedug, voilà ce que ca me donne :
Nagios 2.7
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 01-19-2007
License: GPL
Reading configuration data...
Warning: Duplicate definition found for service 'generic-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 38)
Warning: Duplicate definition found for service 'generic-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 56)
Warning: Duplicate definition found for service 'generic-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 74)
Warning: Duplicate definition found for service 'generic-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 92)
Warning: Duplicate definition found for service 'generic-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 110)
Warning: Duplicate definition found for service 'generic-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 128)
Warning: Duplicate definition found for service 'generic-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 146)
Warning: Duplicate definition found for service 'generic-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 164)
Warning: Duplicate definition found for service 'generic-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 182)
Warning: Duplicate definition found for service 'local-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 215)
Warning: Duplicate definition found for service 'local-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 230)
Warning: Duplicate definition found for service 'local-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 245)
Warning: Duplicate definition found for service 'local-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 260)
Warning: Duplicate definition found for service 'local-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 275)
Warning: Duplicate definition found for service 'local-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 290)
Warning: Duplicate definition found for service 'local-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 305)
Warning: Duplicate definition found for service 'local-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 320)
Warning: Duplicate definition found for service 'local-service' (config file '/usr/local/oreon/filesGeneration/nagiosCFG/services.cfg', starting on line 335)
Running pre-flight check on configuration data...
Checking services...
Checked 275 services.
Checking hosts...
Warning: Host 'Meta_Module' has no services associated with it!
Warning: Host 'ROUTSTRAT' has no services associated with it!
Checked 82 hosts.
Checking host groups...
Checked 6 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 2 contacts.
Checking contact groups...
Checked 2 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 68 commands.
Checking time periods...
Checked 5 time periods.
Checking extended host info definitions...
Checked 82 extended host info definitions.
Checking extended service info definitions...
Checked 275 extended service info definitions.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 2
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
cgi.cfg - déplacement KO
checkcommands.cfg - déplacement KO
contactgroups.cfg - déplacement KO
contacts.cfg - déplacement KO
dependencies.cfg - déplacement KO
escalations.cfg - déplacement KO
hostextinfo.cfg - déplacement KO
hostgroups.cfg - déplacement KO
hosts.cfg - déplacement KO
misccommands.cfg - déplacement KO
nagios.cfg - déplacement KO
resource.cfg - déplacement KO
serviceextinfo.cfg - déplacement KO
servicegroups.cfg - déplacement KO
services.cfg - déplacement KO
timeperiods.cfg - déplacement KO
d'où peu ou peuvent venir le ou les problèmes ?
Est ce que les fichiers sont bien générés dans '/usr/local/oreon/filesGeneration/nagiosCFG/'?
Si oui qu'est ce que ca fait quand tu lance une verification dessus à la main ?
netzuko
05-25-2007, 03:04 PM
nagios -v /usr/local/oreon/filesGeneration/nagiosCFG/nagios.cfg
Nagios 2.7
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 01-19-2007
License: GPL
Reading configuration data...
Error: Cannot open resource file '/usr/local/nagios/etc/resource.cfg' for readin
g!
Error: Cannot open config file '/usr/local/nagios/etc/hosts.cfg' for reading: No
such file or directory
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
comment faire étant donné que les fichiers ne sont pas présents?
si tu efface tous les fichiers dand ce repertoire. Et que tu les regenere est ce qu'il les regenere tous sauf ces 2 là ?
parceque si c'est le cas c'est surement un bug. Mais s'il n'en regenere aucun c'est soit un probleme de conf, soit de droits.
netzuko
05-25-2007, 03:47 PM
je viens de trouver mon erreur qui était dans les droits pour /usr/local/nagios/ j'ai appliqué un "chmod 777 etc".
Nagios 2.7
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 01-19-2007
License: GPL
Reading configuration data...
Running pre-flight check on configuration data...
Checking services...
Checked 275 services.
Checking hosts...
Checked 80 hosts.
Checking host groups...
Checked 5 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 68 commands.
Checking time periods...
Checked 5 time periods.
Checking extended host info definitions...
Checked 80 extended host info definitions.
Checking extended service info definitions...
Checked 275 extended service info definitions.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
cgi.cfg - déplacement OK
checkcommands.cfg - déplacement OK
contactgroups.cfg - déplacement OK
contacts.cfg - déplacement OK
dependencies.cfg - déplacement OK
escalations.cfg - déplacement OK
hostextinfo.cfg - déplacement OK
hostgroups.cfg - déplacement OK
hosts.cfg - déplacement OK
misccommands.cfg - déplacement OK
nagios.cfg - déplacement OK
resource.cfg - déplacement OK
serviceextinfo.cfg - déplacement OK
servicegroups.cfg - déplacement OK
services.cfg - déplacement OK
timeperiods.cfg - déplacement OK
ca a l'air de marcher, mais, j'ai l'impression que les services ne sont pas en route. 0 up, 0 down, 0 inaccessible, 0 en attente. tous les états sont a 0. une petite idée?
Tu veux dire dans la barre de resumé en haut ou alors quand tu va dans l'interface de monitoring ?
netzuko
05-28-2007, 10:05 AM
dans la barre de resumé en haut et aussi dans l'interface de monitoring, je n'ai aucun hote.
où pourrait être le problème?
je pense que c'est un probleme avec ODS.
desactive l'option Lecture rapide des status pour voir :
Options > Options générales > OreondataStarage > lecture rapide des status
netzuko
05-28-2007, 11:16 AM
l'option est déjà désactivée en fait.
netzuko
05-28-2007, 11:23 AM
lorsque je réalise l'export, mes fichiers de configuration s'enregistrent dans /usr/local/nagios/etc. comment faire pour qu'au lieu de s'enregistrer à cet endroit, ils soient sauvegardés dans /etc/nagios ?
merci d'avance
netzuko
05-30-2007, 12:15 PM
aucune idée svp?
clementthersiquel
05-30-2007, 02:53 PM
Dans Oreon tu vas dans Configuration=>Nagios CFG et la t'as un champs au debut qui s'appelle Object Configuration Directory que tu modifies en /etc/nagios/ et ca devrait marcher
netzuko
05-30-2007, 02:56 PM
il était déjà initialisé sur /etc/nagios et pourtant, il ne modifie rien dans /etc/nagios. j'ai énormément de mal a comprendre
clementthersiquel
05-30-2007, 03:02 PM
T'as bien mis un slash a la fin du chemin?
Est ce que tu as exporte correctement tes configurations depuis que t'as change le nagios.cfg?
netzuko
05-30-2007, 04:01 PM
je suis en train de m'occuper d'une autre chose là. je serais là demain matin , donc, je te redemanderai surement d'autres choses demain, si t'es là, et surtout si ca ne te dérange pas.
merci beaucoup. a demain
netzuko
05-31-2007, 01:25 PM
l'import à marché nickel, sauf une chose.
lorsque l'import s'est réalisé, il a modifié les fichiers de conf nagios.
depuis ce temps là, le reportind marche ( j'ai bien accès aux hotes avec leur état ) , mais, je n'ai plus du tout accès à l'interface nagios, ce message d'erreur s'écrit:
Whoops!
Error: Could not read host and service status information!
The most common cause of this error message (especially for new users), is the fact that Nagios is not actually running. If Nagios is indeed not running, this is a normal error message. It simply indicates that the CGIs could not obtain the current status of hosts and services that are being monitored. If you've just installed things, make sure you read the documentation on starting Nagios.
Some other things you should check in order to resolve this error include:
Check the Nagios log file for messages relating to startup or status data errors.
Always verify configuration options using the -v command-line option before starting or restarting Nagios!
Make sure you've compiled the main program and the CGIs to use the same status data storage options (i.e. text file or database). If the main program is storing status data in a text file and the CGIs are trying to read status data from a database, you'll have problems.
Make sure you read the documentation on installing, configuring and running Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org.
j'ai du mal a comprendre et j'ai très peu de temps pour corriger cette erreur.
quelqu'un aurait-il une idée svp?
klure
06-04-2007, 12:41 PM
J'ai eu le meme message d'erreur et apparement dans ce qu'il dit il faut lancer nagios. Pour cela tu tappes dans un terminal : /etc/init.d/nagios start
Ayant eu le meme message d'erreur que toi pour moi ca a marché cette commande.
Apparement cela ne fonctionne que si tu n'as aucune erreurs danstes fichiers de conf.
Total Errors : 0
Cela peut aussi venir du fait que ton nagios ne peut pas ecrire son fichier de lock.
Tu peux le définir dans les options nagios dans oreon (nagios cfg). Il faut que ton utilisateur nagios puisse creer ce fichier de lock.
klure
06-05-2007, 09:57 AM
Par contre moi j'ai un autre soucis :(
Nagios tourne bien 0 warning 0 error, j'importe le tout dans oreon, je génère les fichier tout est ok. Je lance nagios -v /etc/nagios/nagios.cfg (pour nagios) et nagios -v /usr/local/oreon/fileGeneration/nagiosCFG/nagiod.cfg (pour oréon) et pour ces deux la j'ai 0 warning 0 error.
Mais maintenant avec nagios je vois les hotes down, et dans oreon toujours rien dans monitoring, vue oreon,et acceuil :( Par contre je vois bien les hosts dans reporting et configuration.
Quelqu'un aurai une chtite idée ? :confused:
Ah une autre ptite question avant l'importation dans le fichier escalation de nagios j'ai quelque chose et lorsque je l'importe dans oréon il ne me crée pas d'escalades. Est ce normal ??
Info qui pourrait peut être être utile :roll: : ma version d'oreon est la 1.4 et je suis sous kubuntu