Need to setup Icinga2/Icingaweb2 to send email alerts only for ping service

Hi Kai,

I know the mailx command to test email and it is working fine for the test emails using mailx.
I thought you were asking me to run the notification bash script using mailx, which I am not sure how to.

I enabled the debug and found out from the debug logs that the state “Down” was not defined in the filters for notifications, once I added the state “Down” I started receiving notifications for Down state, I also added the state Down for the filters in the notifications.conf and updated the notifications.conf to the following from my original notifications.conf…

apply Notification “mail-Admin” to Host {
import “mail-host-notification”
command = “mail-host-notification”
users = [ “Admin” ]
states = [ Up, Down ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
assign where host.vars.notification.mail
vars += {
notification_icingaweb2url = “https://remved-host-name/icingaweb2
notification_from = “Icinga 2 Host Monitoring icinga@remved-host-name
notification_logtosyslog = false
}

period = “24x7”
}

Thank you for your help.

Balaji.