[Check_mk (english)] Problem with email notifications

Garrett Smith thegunitsmith at gmail.com
Mon Feb 27 17:25:29 CET 2017

Hey everyone,
I'm trying to get check_mk to run with Nagios and send email alerts. I've
configured the rules, but it's still not sending. Nagios sends emails
successfully, and I can send emails by using the mail command, but for some
reason, when I try to use check_mk --notify, this happens:

2017-02-27 10:49:49 ------------------------------
2017-02-27 10:49:49 Got raw notification (UNKNOWN) context with 0 variables
2017-02-27 10:49:49 Raw context:

2017-02-27 10:49:49 Error on completing raw context: 'HOSTNAME'
2017-02-27 10:49:49 Computed variables:
                    MAIL_COMMAND=mail -s '$SUBJECT$' '$CONTACTEMAIL$'
                    MONITORING_HOST=<removed for privacy>
2017-02-27 10:49:49 Preparing rule based notifications
2017-02-27 10:49:49 Found 0 user specific rules
2017-02-27 10:49:49 Global rule 'email mailer'...
2017-02-27 10:49:49 ERROR: 'HOSTNAME'
Traceback (most recent call last):
  File "/usr/share/check_mk/modules/notify.py", line 278, in
    return notify_rulebased(raw_context, analyse=analyse)
  File "/usr/share/check_mk/modules/notify.py", line 385, in
    why_not = rbn_match_rule(rule, raw_context) # also checks disabling
  File "/usr/share/check_mk/modules/notify.py", line 578, in rbn_match_rule
    return event_match_rule(rule, context)             or \
  File "/usr/share/check_mk/modules/events.py", line 296, in
    event_match_exclude_hosts(rule, context)         or \
  File "/usr/share/check_mk/modules/events.py", line 435, in
    if context["HOSTNAME"] in rule.get("match_exclude_hosts", []):
KeyError: 'HOSTNAME'

Anyone know how to fix this? it happens regardless of whether I run the
command as root or nagios. Just a note: I'm using mostly default settings.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mathias-kettner.de/pipermail/checkmk-en/attachments/20170227/8531a255/attachment.html>

More information about the checkmk-en mailing list