Bonjour,
J’ai configuré postfix sur ma debian 12 et le test mail fonctionne, mais je n’ai pas d’alerte sous centreon pourtant les notifications semblent bien activées quelqu’un à déjà rencontré le problème ?
Merci pour vos réponses.
Bonjour,
J’ai configuré postfix sur ma debian 12 et le test mail fonctionne, mais je n’ai pas d’alerte sous centreon pourtant les notifications semblent bien activées quelqu’un à déjà rencontré le problème ?
Merci pour vos réponses.
As-tu vérifié dans Configuration → Commands → Notifications que les commandes de notif utilisent les bonnes commandes pour ton système ?
Merci pour ton retour,
J’utilise la commande par défaut:
Perso j’utilise Postfix pour faire relais interne parce qu’on a un serveur externe mais j’utilise apprise pour envoyer des mails. J’ai trop galéré avec l’envoi direct (impersonation, dkim...).
Et je ne voulais pas laisser les identifiants du serveur externe visible de mes utilisateurs dans la commande apprise.
A la fin de ma config dans main.cf j’ai quelque-chose de ce style :
mydomain = domaine.fr
myhostname = centreon
relayhost = /smtp.domaine.fr]:587
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = static:login@domaine.fr:motdepasse
smtp_use_tls = yes
smtp_tls_security_level = encrypt
#smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
sender_canonical_maps = regexp:/etc/postfix/sender_canonical_maps
sender_canonical_classes = envelope_sender, header_sender
smtp_header_checks = regexp:/etc/postfix/header_check
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject
Dans sender_canonical_maps :
/.+/ alerte@domaine.fr
(mon serveur externe m’autorise à envoyer en tant que ce que je veux @mondomaine.fr)
Et dans header_check :
/FROM:.*/ REPLACE From: alerte@domaine.fr
/SENDER:.*/ REPLACE Sender: alerte@domaine.fr
Ensuite j’ai installé apprise : https://github.com/caronc/apprise
Et mes commandes ressemblent à ça :
service_notification_email :
apprise "mailto://localhost?from=Centreon<alerte@domaine.fr>&to=$CONTACTEMAIL$" -t "Centreon : $SERVICESTATE$ - $HOSTNAME$ / $SERVICEDESC$" -b "***** Notification Centreon *****\n\nType de notification: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTNAME$\nEtat du service: $SERVICESTATE$\nEtat du Host: $HOSTSTATE$\n\nDate/Time: $DATE$ $TIME$\n\nAdditional Info du Service: $SERVICEOUTPUT$\nAdditional Info du Host: $HOSTOUTPUT$"
host_notification_email :
apprise "mailto://localhost?from=Centreon<alerte@domaine.fr>&to=$CONTACTEMAIL$" -t "Centreon $HOSTSTATE$ : $HOSTNAME$" -b "***** Notification Centreon *****\n\nType de notification: $NOTIFICATIONTYPE$\n\nHost: $HOSTNAME$\nEtat: $HOSTSTATE$\n\nDate/Time: $DATE$ $TIME$\n\nAdditional Info: $HOSTOUTPUT$"
Je sais pas si ça peut t’aider, j’ai eu marre de me battre avec postfix ;)
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.