Help with sending mail and general service and monitoring services

Hello everyone, I am currently configuring icinga2 and have the following problems:

I only get email from icinga2 with IP: 127.0.0.0 and I don’t get any mail from the other hosts even if they have problems.

how can I set up multiple services for hosts? everything I did was somehow wrong and the host gets only one service. (only what is in chech_command)

I have installed icinga2 on a VM and I want to monitor a service from another VM, how does it work?

sorry for my bad english
Thank you very much and I look forward to your help!

Hello and welcome to the community.
Did you read the docs about notifications?

Regards,
Carsten

Hi,
Thank you for your reply

yes, I read it, but it didn’t help me.
I’ve set up director so far and it doesn’t work with that now.

zones.d/master/notification_templates.conf

template Notification "alles" { 
times = { begin = 10s } 
command = "[mail-service-notification]
 interval = 5s 
states = [ Critical, Down, Unknown, Up, Warning ] 
types = [ Custom, Recovery ] users = [ "admin" ] 
}

zones.d/master/notification_apply.conf

apply Notification "mail_senden" to Service { 
import "[alles]
assign where host.enable_notifications == "true" 
users = [ "me" ] 
}

zones.d/master/users.conf

object User "me" { 
import "[admin]
email = "myemail@myemail" 
enable_notifications = true 
states = [ Critical, Down, Unknown, Warning ] 
types = [ Recovery ] 
}

I feel like I did something wrong somewhere, but unfortunately I don’t know where.

Hi,

first of all you want to get a notification every 5 seconds? if not change the interval in allestemplate to something like 15m or even higher.
Your imports should contain only the name of the template, the brackets [] are wrong.
Iam not sure if your assign works, because you do a assignt to the string true, it should look like

assign where host.enable_notification

Thats a short form for (bolean) variables or variables that are set with whatever they contain as long it is not false.

Regards,
Carsten

P.S.: please format your configuration posts in the future for better readability