Icinga client API and email notification

hi Community

hope this email finds you all well

appreciate your assistance in the above topic

below is the current version setup

director 1.11.5
doc 2.12.5
undefined ---- ---- ----
grafana 2.0.3
undefined ---- ---- ----
icingadb 1.1.4
undefined ---- ---- ----
incubator 0.23.0
undefined ---- ---- ----
map 2.0.0
undefined ---- ---- ----
migrate 2.12.5
undefined ---- ---- ----
monitoring 2.12.5
undefined ---- ---- ----

icinga2 clients agent are communicating with icinga2 master via Rest API,
i need the community assistance in verifying the email notification is triggered when

icinga2 clients agent update icinga2 master of the host and service status

i did not setup the initial installation…

so when icinga2 clients communicate to master or satelite that their client host or service status has changed….via api….

need a email notification trigger….as currently the email notification is not triggering….

kindly seek your assistance community

given your vast experience with icinga architecture as i am new the architecture of icinga2

Is the notification feature enabled on the master?

If you enable passive on a host or service check in Icingaweb2, you can send in warning or critical states directly on the host or service page to trigger messages.

If no message goes out look in the log why.

hi @rivad

yes the feature notification has been enabled…

and currently hosts and services are offline but there is no triggered emails…

i have done a test of smtp setup and it works…outside of icinga application…i receive emails from the master

i am using the default email host and service notification but its not triggering..

can please elaborate more on your suggestion so i can try it out…

i have hosts showing in host problems and their feature command active checks, passive checks, notification, event handler all enabled but still no notifications

thanks

What’s your setup of the notification command, host and service notifications, contact users and groups?
Can you provide excerpts of your config?
Do you see anything relating to notifications in the logs?

currently under notifications i am only using two notifications host and service…

under Main properities

Imports: mail-host-notification

User: my email address

Apply to: Hosts

notification interval: 60

Time Period: 24x7 inherted from mail-host-notification

Disable: No

Assigned where

host.notification = true

States

Down, Critical, Unknown and Warning

Transition Type

Recovery, Problem, Downtime Start and Downtime End

Same setup with email-service-notification but apply to services

yes i see below but only when i force a custom notification

[2025-11-27 18:54:22 +0000] information/HttpServerConnection: Request POST /v1/actions/send-custom-notification (from [::ffff:127.0.0.1]:42896, user: icinga2, agent: , status: OK) took total 0ms.

Do you use the director? If so please post the code it shows you in the preview tabs.
Do you see something like this on your hosts and services:

hi Dominik as requested, yes i used director….but i dont see any contacts or contact groups under host or services…my version maybe a lower version of icinga

apply Notification "mail-host-notification-v3" to Host {
    import "mail-host-notification-v2"

    interval = 1m
    assign where host.enable_notifications == "true"
    states = [ Critical, Down, Unknown, Warning ]
    types = [ DowntimeEnd, DowntimeStart, Problem, Recovery ]
    users = [ "joseph" ]
}

If you don’t see any contacts on the host or service details in Icingaweb2, my bet is on that, Icinga isn’t launching the notification command as nobody is to be notified.

Do you see the notification object with:

icinga2 object list --type notification

Depending on the size of your installation, you probably need to filter some more by name.
Also look for the whole chain of objects: Host / Host & Service, Notification, User Group/ User…

hi @rivad after running the command the output is nothing…

can please advise how i can correct this such that put email address so as to notify users of hosts and services down status

thanks

icinga2 daemon -C --dump-objects

I think you need to remove this or they will not be attached / created.

This is something that you can use to disable / enable at hock in the Web GUI and IMHO shouldn’t be used in your config. If you created your own enable_notifications then it would be under host.vars.enable_notifications.

The warnings in your screenshot

hi @rivad can please advise what i can put as the assignment fill cant be empty i removed the statement and put below and reload icinga2 via systemctl reload icinga2

apply Notification "mail-service-notification" to Service {
    import "service-notification-default-template"

    interval = 1m
    assign where host.retry_interval == "true"
    states = [ Critical, Down, Unknown, Warning ]
    types = [ DowntimeEnd, DowntimeStart ]
    users = [ "joseph" ]
}

but still the same output…no changes….appreciate your advise

Thanks

I would rebuild from the recommendations in the official documentation.

1 Like

Can please advise how important is the database icingaweb2 for notification of email to users as its currently missing from the backend databases, only director, icinga2, icingadb, and mysql is present .

Thanks

The database of icingaweb2 is not important at all for notifications. Well, not directly.

Notifications are sent entirely by the core, i think it doesnt even need icingadb for it - but im not 100% sure about this.

Anyways, you need to configure them. You can do this in Icinga DSL, in this case no icingaweb2 would be needed. If you want to configure them in the Icinga Director you would need databases for icingaweb2 and the director.

I dont really understand your setup, why do you have an director database but no icingaweb2 database?

thank you for the insight….i am just continuing on from a former colleague that setup the initial architecture….when i try and trigger notifications using director…no notifications are sent on the system without icingaweb2……i have created another instance where i have the icingaweb2 database and the email notification is being sent out…i will do some more research and see if i can resolve my issue but thank you @rivad @bberg for your insight and assistance….God bless