PDA

View Full Version : [REGLE]Probléme de notification par Mail


yannick
01-18-2006, 09:47 AM
Salut,

Voila j'ai regarder sur les forums, j'ai utilisé le Wiki, le FAQ, la doc avec POSTFIX 2.1.5-9, mais sa ne marche pas !!! Je comprend plus rien ....

Voila mes config sous Postfix:

mtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
myhostname = Oreon.nom_domaine
mydomain = nom_domaine
myorigin = $myhostname
mydestination = $myhostname, localhost, $myhostname.$mydomain, localhost.$mydomain
relayhost = [smtp.nom_domaine]
mynetworks = mon_adresse_reseau, 127.0.0.0/8
inet_interfaces = all
mail_owner = postfix


Config dans OREON :
Misccommands.cfg

# 'notify-by-email' command definition 2
define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios 1.X *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}

Contact.cfg

# 'Administrateur' contact definition 0
#
define contact{
contact_name Administrateur
alias Admin
host_notification_period 24x7
host_notification_options d,u,r
host_notification_commands notify-by-email
service_notification_period 24x7
service_notification_options w,u,c,r
service_notification_commands notify-by-email
email mon_email

Par exemple Services.cfg

# 'Check_Zombie_Procs' service definition 101
#
#service_id 27
define service{
service_description Check_Zombie_Procs
host_name CAS
check_command check_nrpe!check_zombie_procs
max_check_attempts 20
normal_check_interval 10
retry_check_interval 10
check_period 24x7
freshness_threshold 0
low_flap_threshold 0
high_flap_threshold 0
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
notifications_enabled 1
contact_groups Oreon_Administrateur
stalking_options o,w,u,c

Sous OREON dans les Option générale j'ai rajouté au MAILER:
/usr/bin/mail

Voila si qq'un peut m'aider !!!! Merci beaucoup :roll:

DonKiShoot
01-18-2006, 11:04 AM
déja tester à la mano sans se préoccuper d'oreon le client bin/mail

yannick
01-18-2006, 11:10 AM
bin la réponse qui me sort c'est :

Oreon:/usr/bin# /usr/bin/printf "%b" xxx | /bin/mail -s "test de mail" mon_mail

-bash: /bin/mail: is a directory

donc sa marche meme pas !!

julio
01-18-2006, 11:19 AM
nan peut etre simpklement le path du mailer qui n'est pas bon....

fait un 'whereis -b mail'

et remplace par la valeur de retour

yannick
01-18-2006, 11:27 AM
sa me donne sa :

Oreon:~# whereis -b mail
mail: /bin/mail /usr/bin/mail /etc/mail.rc

Dans mon Mailer c'est :
/usr/bin/mail (je l'ai rejouter à la fin de l'install)

julio
01-18-2006, 11:40 AM
oauis mais regarde ta commande au dessus c /bin/mail

donc remplace dans toutes tes commandes de notification /bin/mail par @mailer@... et regenere

c'est un bug que nous avons fait sans faire expres... je l'ai corrigé hier soir pour les prochaine versions... ca le remplacera automatiquement a la generation par le path que tu as entré dans les options générales :)

yannick
01-18-2006, 11:42 AM
je fait koi dans le mailer ??


@mailer@/bin/mail ???????

julio
01-18-2006, 11:57 AM
remplace toutes les chaines de caractere type /bin/mail par @mailer@

et apres tu regenere...

tu verra les fichiers de conf auront changé :)

yannick
01-18-2006, 01:07 PM
oué c bon je l'ai fait par contre qd je reteste :

Oreon:~# /usr/bin/printf "%b" xxx | /bin/mail -s "test de mail" mon_mail
-bash: /bin/mail: is a directory


sa me fait toujour sa :?

julio
01-18-2006, 01:14 PM
mais biensur car comme je te l'ai dit toi c /usr/bin/mail !! donc change dans ta ligne de commande de test....

yannick
01-18-2006, 01:21 PM
arff oué c vrai désolé .... mais sa passe tjr pas :(

yannick
01-18-2006, 02:25 PM
Yeah belle maintenant elle fonctionne ma commande :

/usr/bin/printf "%b" encore un test | /bin/mail/mail -s "test de mail" mon_mail

c'est cool j'ai tout réinstallé en faite avec une bonne config ... Bon maintenant faut que mon serveur Oreon envoi ses erreurs !!!!


Alors dans les config général, pour testé j'ai donc mis au MAILER :
/bin/mail/mail

Et bien sur sa ne passe pas :(

yannick
01-18-2006, 03:04 PM
Belle, belle, belle c'est enfin bon !!!!!
Donc je "récapépéte" :wink:

Faut suivre l'install de la doc, c'est nikel et complet: http://wiki.oreon-project.org/wakka.php?wiki=ConfigEnvoiMail

Ensuite faut faire attention lors de la création du lien symbolique (En faite sa créer un /bin/mail mais en t'en que dossier).
Donc pour la config dans OREON =>> option => Configuration => Général
Puis MAILER, il faut mettre => /bin/mail/mail pour aller chercher le "binaire mail" !!!

Pour tester en ligne de command (ce qui serai pas mal)
/usr/bin/printf "%b" xxx | /bin/mail/mail -s "test de mail" Mail_Destination

Voili voilou happy happy (sa fait plaisir qd sa marche :P)

Pour info:
Oreon v1.2.2
Nagios v1.2
Debian 2.6.8-2-386

inconnuflo
01-18-2006, 07:54 PM
c'est bizarre car je passe mon temps a installer et tester des version d'oreon
et je n'ai jamais eu ce pb
Pour la config de postfix, je me sers a chaque fois du wiki.
http://wiki.oreon-project.org/wakka.php?wiki=ConfigEnvoiMail#4

et je cree a chaque fois le lien symboique
ln -s /usr/bin/mail /bin/mail


bizarre enfin l'essentiel c'est ke ca marche

yannick
01-18-2006, 09:10 PM
Franchement moi aussi j'ai trouvé sa trop bizzard surtout que sur le net personne n'a ce probléme !!! Alors je te dit pas la galére :? (j'y ai passé 2 jours) ... Heureusement que j'avais un serveur de test qui était deja en place. J'ai donc pu comparer nos config .. c'est vrai que l'autre c'était bien "/bin/mail" :P !!!! Seulement pas moi :roll: ................

Mais bon ta doc est nikel y a rien à dire :wink: ...
En cas si un jour qq'un à ce probléme y check mon post et y test :)

Allé bonne continuation