Establishing an Event Stream API connection failed, will be retried

I’m new to icinga2 and want to setup the new (beta) notifications.
I’ve followed the documentation but I can’t get it to work. I want to be notified if a host goes down or a service changes to Warning, or from Warning to Critical.

I added the database and the resource - as in the documentation.
I created a channel with my MS365 SMTP Settings.
I tried to set the sources:

Type: Icinga
API URL: localhost
API username: root
API Password: <from conf.d/api-users.conf> has permissions [ * ]
Verify API Certificate: Disabled

My Icinga Dashboard is available via apache webserver and https://icinga.my.domain/dashboard.
I can see following warning/error:

journalctl -fu  icinga-notifications.service
icinga2: Establishing an Event Stream API connection failed, will be retried

I’ve also tried to set a shedule for 24/7 and the admin for every day. Do I need a shedule?
Event Rule: No Filter – Incident Severity >= Warning – User|MS365(name of the channel)
in notifications/events - There are no events, even if I shutdown a minitored host.

  • Icinga Web 2 version: 2.12.4-1+debian12
  • Used modules and their versions (System - About):icingadb 1.1.3, icinganotifications 0.1.0
  • Web browser used: Chrome
  • Icinga 2 version used: version: r2.14.5-1
  • PHP 8.2.28
  • Server OS: Debian 12.10

Hey,
I remember having the exact same warnings in the log.
My solution was to set the API URL to https://localhost:5665/, like that:

API URL: https://localhost:5665/
1 Like

Thanks! I thought I tried all combinations, seems this I didn’t try. The warning is gone!

Do you may also know what causes this error:

Apr 10 12:48:24 icinga2 icinga-notifications[11208]: incident: Source 1 opened incident at severity "crit"

Apr 10 12:48:24 icinga2 icinga-notifications[11208]: incident: Rule matches

Apr 10 12:48:24 icinga2 icinga-notifications[11208]: incident: Rule reached escalation

Apr 10 12:48:24 icinga2 icinga-notifications[11208]: incident: Notify contact "the admin" via "ms365" of type "email"

Apr 10 12:48:26 icinga2 icingadb[600]: history-sync: Synced 1 notification history items

Apr 10 12:48:26 icinga2 icingadb[600]: history-sync: Synced 2 state history items

Apr 10 12:48:26 icinga2 icingadb[600]: runtime-updates: Upserted 2 ServiceState items

Apr 10 12:48:34 icinga2 icinga-notifications[11208]: incident: Failed to send notification via channel plugin

I’ve only set the settings via config → modues → notifications → channels. Did I overlook something to send emails via smtp?
Can I enable more log, why it’s failing?

The details are within journald fields, which are shown when using another --output. Please read the doc section about this in the Icinga DB docs - Configuration - Icinga DB. This will also be included in the Icinga Notification Docs in the upcoming release - doc/03-Configuration.md: Logging Fields in Journald by oxzi · Pull Request #274 · Icinga/icinga-notifications · GitHub.

1 Like

Thanks!
I see following if STARTTLS or NONE as “SMTP Transport Encryption”:

ICINGA_NOTIFICATIONS_ERROR=SMTP error 504: Unrecognized authentication type [PA7P264CA0269.FRAP264.PROD.OUTLOOK.COM 2025-04-14T08:04:15.552Z 08DD7AEB578DD3F7]

or if TLS as “SMTP Transport Encryption”

ICINGA_NOTIFICATIONS_ERROR=tls: first record does not look like a TLS handshake

does icinga-notifications depend on a local postfix service configured as SMTP relay? I try to use MS365 SMTP authentication, which is working for other services. I only filled this fields:

No, the email channel speaks SMTP itself and uses the configured SMTP Host.

However, your error message when using STARTTLS seems to be O365-related. Based on similar web results[1], you have to use Microsoft’s so called Legacy SMTP endpoint.


  1. https://learn.microsoft.com/en-us/answers/questions/1276627/smtp-authentication-error, https://learn.microsoft.com/en-us/answers/questions/788460/504-5-7-4-unrecognized-authentication-type-(with-o, and many more ↩︎

unfortunately also this endpoint does not work.
Maybe the authentication method of the channel is not “plain”.
I’ll move on to setup smtp-relay with postfix.
Thanks anyway!

smtp-relay with postfix and configure the notifications-plugin to use localhost on 25 without authentication worked :grinning_face:

1 Like