Email Notification Problem


(Ghost) #1

Hi,

I installed Postfix and configured it.
The Test Email from Postfix to my Email Account works.

When i create a “Fake Notification” nothing happens.

Is there anything i have to configure on the Check_MK Master Server to get Notifications.

Somehow the Fallback Email works, but it only works when i manually send Notification Mails over .> WATO -> Notifications -> “Replay this Notification”


(Philipp Näther) #2

Which cmk version do you use? Do you use the check_mk raw omd package or installed from source?

What is a fake notification? Do you mean a custom notification via command?


(Ghost) #3

Im Using version 1.5.0p6, Raw on Ubuntu 16.04
I have one master that is accessable from outside.

I installed Postfix to get Notifications from the Master to my Email.

My Config looks like this: (Example fields are filled with my local informations)

See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA’s job.
append_dot_mydomain = no

# Uncomment the next line to generate “delayed mail” warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = example.checkmk01
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, example.net, exampe.int
relayhost = xxx.xx.xx.xx
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all

I naviagte to any machine, click on any service, click on the hammer (Execute Commands on Hosts, Services and other objects), navigate to “FAKE CHECK RESULTS” and enter my output.

Like the Manual says, it should send a notification Email, but it doesnt.

Also on the Notification Menu i cant find the Parameters to configure the notification rules.

The existing rule does nothing.

When i go to notification rule -> Replay this notification, send it again! in the Ananlysis section, i receive an email.

How can i configure to send Mails automaticly to my applied email adresses?

Thank you !


(Philipp Näther) #4

Does the custom notification command work (as I described in the first post)?

Does a notification get sent if you force (not fake) a service to go crit or host to go down?


(Ghost) #5

Does the custom notification command work (as I described in the first post)?

No, it doesnt work. i says “successfully sent 1 commands” but i dont get anything.

Does a notification get sent if you force (not fake) a service to go crit or host to go down?

No

… The only way to send emails is manually. i dont know where to configure automated noticfications …


(Philipp Näther) #6

For notifications to work you need the following:

  • a notification rule that matches events and users/contactgroups
  • a user with an email address of course
  • the user needs to be in a contactgroup
  • the hosts/services need to be in a contactgroup

Usually the notifications should work out of the box if you set the contact group of the admin user or your user to “Everything” and give this user an email address. By default there is one notification rule that matches everything and sends an email to the contacts of a service/host.

Make sure to check the docs to understand rule based notifiactions: https://mathias-kettner.com/cms_notifications.html


(Leon) #7

Hey @marcel.hafner please check following thread:

and check this post, maybe that’s the way how to fix your problem:

Cheers
Leon :v:t3:


(Philipp Näther) #8

Yes, this could apply to Marcel’s issue here aswell since he mentioned a master in his config too.