View Full Version : Centreon pas d'interaction Nagios
dfarcy
20th March 2008, 13:50
Bonjour,
Avant tout je vous félicite pour Centreon qui semble être enfin l'interface que j'espérais pour Nagios.
Malheureusement je ne peux encore vraiment en profiter car je rencontre un problème, j'espère que quelqu'un voudra bien m'aider.
Je m'explique :
Nagios à la configuration de base avec le localhost en ordre, Le site cetreon est accessible et tout semble en ordre, j'ai configuré les contacts, Hosts, dépendances, etc (je remarque par contre que quand j'ajoute un service il n'est pas visible dans le centreon, mais si j'essaie d'ajouter le même nom de service j'ai un message qui m'indique qu'il existe déjà)
Et si j'essaie l'export tout me semble en ordre, mais je ne vois rien qui change dans Nagios et je ne vois aucun host dans Centreon...
Donc l'installation est effectuée sur la Distribution SUsE Enterprise Server 10
J'ai suivi en partie le guide suivant ->
http://blog.nicolargo.com/2007/07/installation-de-centreon-oreon.html
La version de Linux étant différente j'ai dus trouver quelques petites astuces moi même, quoi qu'il en soit toutes les dépendances durant le Wizard de Centreon ont été remplies avec succès (tout vert) je ne sais pas comment relancer ce test mais bon...
Donc voila le résultat de la commande "./nagios -v "nagios.cfg"
Nagios 2.10
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 10-21-2007
License: GPL
Reading configuration data...
Running pre-flight check on configuration data...
Checking services...
Checked 5 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 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 22 commands.
Checking time periods...
Checked 4 time periods.
Checking extended host info definitions...
Checked 0 extended host info definitions.
Checking extended service info definitions...
Checked 0 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
La version de Centreon est 1.4.2.4
Les droits sur les le répertoire nagios et centreon sont pour le moment 777 wwwrun.nagios (situés tout deux dans /usr/local/)
Voila si il faut d'autres informations n'hésitez pas.
Merci
Dominique
Guigui2607
20th March 2008, 14:20
Le principe est le suivant:
Tu effectues toutes tes créations / modifications / suppresions d'objets "nagios" avec l'interface Centreon.
Ces modifications sont stockées dans la base MySQL 'centreon'.
Ensuite, il faut exporter cette configuration stockées dans la base MySQL vers Nagios.
Pour cela, il faut aller dans le menu >> Configuration > Nagios > Exporter
puis configurer les option comme suit:
Générer les fichiers Oui Non
Inclure les commentaires Oui Non
Générer aussi au format XML Oui Non
Résultat
Lancer le debug de Nagios (-v) Oui Non
Lancer le test d'optimisation (-s) Oui Non
Déplacer les fichiers Oui Non
Recharger Nagios Oui Non
Reload Restart Commande externe
Ce qui revient à faire la commande nagios -v ngios.cfg
Ensuite s'il n'y a aucune erreur, il faut modifier les options comme ceci:
Générer les fichiers Oui Non
Inclure les commentaires Oui Non
Générer aussi au format XML Oui Non
Résultat
Lancer le debug de Nagios (-v) Oui Non
Lancer le test d'optimisation (-s) Oui Non
Déplacer les fichiers Oui Non
Recharger Nagios Oui Non
Reload Restart Commande externe
Centreon va générer les fichiers cfg puis va remplacer les cfg existants de Nagios par la nouvelle configuration. Ensuite, il forcer Nagios à recharger sa configuration (option reload)
dfarcy
20th March 2008, 15:20
Merci GuiGui,
C'est donc l'option "move export files" qui envoi la config, j'aurais dus essayer dju!
Par contre j'ai cette partie en plus après "Export"
cgi.cfg - movement OK
checkcommands.cfg - movement OK
contactgroups.cfg - movement OK
contacts.cfg - movement OK
dependencies.cfg - movement OK
escalations.cfg - movement OK
hostextinfo.cfg - movement OK
hostgroups.cfg - movement OK
hosts.cfg - movement OK
meta_commands.cfg - movement OK
meta_contact.cfg - movement OK
meta_contactgroup.cfg - movement OK
meta_dependencies.cfg - movement OK
meta_escalations.cfg - movement OK
meta_host.cfg - movement OK
meta_hostgroup.cfg - movement OK
meta_services.cfg - movement OK
meta_timeperiod.cfg - movement OK
misccommands.cfg - movement OK
nagios.cfg - movement OK
perfparse.cfg - movement OK
resource.cfg - movement OK
serviceextinfo.cfg - movement OK
servicegroups.cfg - movement OK
services.cfg - movement OK
timeperiods.cfg - movement OK
Generating SNMPTT configuration files...
4 traps for 1 manufacturers are defined.
SNMPTT configuration files generated.
Running configuration check...done
Stopping nagios: done.
Starting nagios: done.
Mais ci je retourne dans Nagios j'ai sur toutes les options de Monitoring l'erreur suivante :
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:
1. Check the Nagios log file for messages relating to startup or status data errors.
2. Always verify configuration options using the -v command-line option before starting or restarting Nagios!
3. 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.
Alors donc je fait un "./nagios status" qui me donne ca :
Nagios 2.10
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 10-21-2007
License: GPL
Error: Cannot open main configuration file '/usr/local/nagios/bin/status' for reading!
Nagios 2.10 starting... (PID=9226)
Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=9226)
Et après un "./nagios -v" j'ai ça :
Nagios 2.10
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 10-21-2007
License: GPL
Reading configuration data...
Running pre-flight check on configuration data...
Checking services...
Checked 2 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 1 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 44 commands.
Checking time periods...
Checked 5 time periods.
Checking extended host info definitions...
Checked 1 extended host info definitions.
Checking extended service info definitions...
Checked 0 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
Encore un petit coup de pouce ? Je sent que je dois pas être très loin :(
Merci
Dominique
Guigui2607
20th March 2008, 15:34
Tu as fait un reload ou un restart de Nagios a travers l'interface de Centreon ?
(A priori un restart)
./nagios status <- Je ne connais pas cette commande...
peut être un service nagios status ?
Ca te diras si ton nagios tourne...
dfarcy
20th March 2008, 18:24
J'ai fait un reload,
service nagios status donne :
"nagios is not running"
le ./nagios status je le lance dans le répertoire suivant /usr/local/nagios/bin/
et me donne le même problème, Nagios ne veut plus se lancer en fait.
Donc non Nagios ne se lance plus après avoir exporté.
Et voici ce que j'ai dans le "nagios.cfg" generé par centreon/oreon
################################################## #################
# #
# GENERATED BY OREON #
# #
# Developped by : #
# - Julien Mathis #
# - Romain Le Merlus #
# #
# www.oreon-project.org #
# For information : contact@oreon-project.org #
################################################## #################
################################################## #################
# #
# Last modification March 17, 2008, 5:56 am #
# By admin #
# #
################################################## #################
cfg_file=/usr/local/nagios/etc/hosts.cfg
cfg_file=/usr/local/nagios/etc/services.cfg
cfg_file=/usr/local/nagios/etc/misccommands.cfg
cfg_file=/usr/local/nagios/etc/checkcommands.cfg
cfg_file=/usr/local/nagios/etc/contactgroups.cfg
cfg_file=/usr/local/nagios/etc/contacts.cfg
cfg_file=/usr/local/nagios/etc/hostgroups.cfg
cfg_file=/usr/local/nagios/etc/servicegroups.cfg
cfg_file=/usr/local/nagios/etc/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/escalations.cfg
cfg_file=/usr/local/nagios/etc/dependencies.cfg
cfg_file=/usr/local/nagios/etc/hostextinfo.cfg
cfg_file=/usr/local/nagios/etc/serviceextinfo.cfg
cfg_file=/usr/local/nagios/etc/meta_commands.cfg
cfg_file=/usr/local/nagios/etc/meta_contact.cfg
cfg_file=/usr/local/nagios/etc/meta_contactgroup.cfg
cfg_file=/usr/local/nagios/etc/meta_dependencies.cfg
cfg_file=/usr/local/nagios/etc/meta_escalations.cfg
cfg_file=/usr/local/nagios/etc/meta_host.cfg
cfg_file=/usr/local/nagios/etc/meta_hostgroup.cfg
cfg_file=/usr/local/nagios/etc/meta_services.cfg
cfg_file=/usr/local/nagios/etc/meta_timeperiod.cfg
resource_file=/usr/local/nagios/etc/resource.cfg
log_file=/usr/local/nagios/var/nagios.log
temp_file=/usr/local/nagios/var/nagios.tmp
status_file=/usr/local/nagios/var/status.log
aggregate_status_updates=1
status_update_interval=15
nagios_user=nagios
nagios_group=nagios
enable_notifications=1
execute_service_checks=1
accept_passive_service_checks=1
enable_event_handlers=1
log_rotation_method=d
log_archive_path=/usr/local/nagios/var/archives/
check_external_commands=1
command_check_interval=1s
command_file=/usr/local/nagios/var/rw/nagios.cmd
downtime_file=/usr/local/nagios/var/downtime.log
comment_file=/usr/local/nagios/var/comment.log
lock_file=/usr/local/nagios/var/nagios.lock
retain_state_information=1
state_retention_file=/usr/local/nagios/var/status.sav
retention_update_interval=60
use_retained_program_state=1
use_syslog=0
log_notifications=1
log_service_retries=1
log_host_retries=1
log_event_handlers=1
log_initial_states=1
log_external_commands=1
sleep_time=1
service_interleave_factor=s
max_concurrent_checks=20
service_reaper_frequency=10
interval_length=60
use_agressive_host_checking=0
enable_flap_detection=0
low_service_flap_threshold=25.0
high_service_flap_threshold=50.0
low_host_flap_threshold=25.0
high_host_flap_threshold=50.0
soft_state_dependencies=0
service_check_timeout=60
host_check_timeout=60
event_handler_timeout=60
notification_timeout=60
ocsp_timeout=1
perfdata_timeout=5
obsess_over_services=0
process_performance_data=1
service_perfdata_command=process-service-perfdata
check_for_orphaned_services=0
check_service_freshness=1
date_format=euro
illegal_object_name_chars=~!$%^&*"|'<>?,()=
illegal_macro_output_chars=`~$^&"|'<>
admin_email=admin
admin_pager=admin@localhost
Merci
Dominique
Aviscdr
22nd March 2008, 02:33
Les droits du répertoire /usr/local/nagios/bin
drwxr-xr-x 2 apache nagios 4,0K fév 8 16:05 bin
L'intérieur du répertoire:
drwxr-xr-x 2 apache nagios 4,0K fév 8 16:05 .
drwxr-xr-x 4 apache nagios 4,0K fév 9 21:23 ..
lrwxrwxrwx 1 apache nagios 16 fév 8 16:05 nagios -> /usr/sbin/nagios
As-tu bien créé ton lien entre /usr/local/nagios/var/ et /var/log/nagios/ (avec les droits qui vont bien) ?
dfarcy
25th March 2008, 10:42
Bonjour,
j'espère que le Weekend à été bon.
Donc heu voila mes droits dans le répertoire /usr/local/nagios
drwxrwxrwx 2 wwwrun nagios 4096 Mar 10 18:01 bin
Dans le répertoire /usr/local/nagios/bin
drwxrwxrwx 2 wwwrun nagios 4096 Mar 10 18:01 .
drwxrwxrwx 8 wwwrun nagios 4096 Mar 10 18:05 ..
-rwxrwxrwx 1 wwwrun nagios 423404 Mar 10 18:01 nagios
-rwxrwxrwx 1 wwwrun nagios 28596 Mar 10 18:01 nagiostats
Maintenant pour le symbolic link je vois pas non est-ce utile ? j'en avais pas avant l'export et nagios se lançait bien...
Merci pour toute aide.
A+
Dominique
Aviscdr
25th March 2008, 11:35
Utile ?
A vrai dire, mon agenda est trop rempli pour que je décortique chaque aspect de Centreon, mais toujours est-il que j'ai effectué tout ce qui va suivre pour ne pas être em...beté avec d'éventuels (et certains réels) problèmes de droits.
$ mkdir /usr/local/nagios
$ mkdir /usr/local/nagios/bin
$ mkdir /usr/local/nagios/share
$ mkdir /var/log/nagios/centreon
$ mkdir /var/log/nagios/rw
$ ln -s /var/log/nagios /usr/local/nagios/var
$ ln –s /usr/share/nagios/html/images/ /usr/local/nagios/share/images
$ ln -s /etc/nagios /usr/local/nagios/etc
$ ln -s /usr/lib/nagios/plugins /usr/local/nagios/libexec
$ ln -s /usr/sbin/nagios /usr/local/nagios/bin/nagios
$ chown -R apache:nagios /etc/nagios/
$ chmod -R 775 /etc/nagios/
$ chown -R apache:nagios /usr/lib/nagios/plugins
$ chmod -R 755 /usr/lib/nagios/plugins
$ chown -R apache:nagios /usr/local/nagios
$ chown –R nagios:nagios /var/log/nagios
$ chown –R apache:nagios /var/log/nagios/centreon
Et c'est seulement après cette étape que j'installe centreon.
C'est probable que certaines lignes ne servent à rien, toujours est-il que ça fonctionne au poil.
dfarcy
25th March 2008, 12:12
Ok merci Aviscdr,
Je vais essayer de comprendre ça et de voir ce qui coince, merci pour ton aide :wink:
bàt
Dominique