Am 17.06.2015 um 13:45 schrieb Tejas Gadaria:
Hi Michael,
Missed to paste Notification object configuration part, it's as below.
apply Notification "mail-icingaadmin" to Host {
import "mail-host-notification"
users = [ "Tejas","icingaadmin" ]
user_groups = host.vars.notification.mail.groups
assign where host.vars.notification.mail
}
Make sure verify that the actual notification object is generated, e.g. by
invoking 'icinga2 object list --type Notification'
Kind regards,
Michael
Regards,
Tejas
On Wed, Jun 17, 2015 at 4:57 PM, Michael Friedrich
<[email protected]<mailto:[email protected]>> wrote:
Am 17.06.2015 um 13:20 schrieb Tejas Gadaria:
Hi,
I am not able to receive mail notification from icinga2 when host goes down or
host restarts. Although it notifies me on dashboard if host is down. It sends
notification for services also.
I am using below host notification configuration..
Notification command :
---------------------------------
object NotificationCommand "mail-host-notification" {
import "plugin-notification-command"
command = [ SysconfDir + "/icinga2/scripts/mail-host-notification.sh" ]
env = {
NOTIFICATIONTYPE = "$notification.type$"
HOSTALIAS = "$host.display_name$"
HOSTADDRESS = "$address$"
HOSTSTATE = "$host.state$"
LONGDATETIME = "$icinga.long_date_time$"
HOSTOUTPUT = "$host.output$"
NOTIFICATIONAUTHORNAME = "$notification.author$"
NOTIFICATIONCOMMENT = "$notification.comment$"
HOSTDISPLAYNAME = "$host.display_name$"
USEREMAIL = "$user.email$"
}
}
Template:
-------------
template Notification "mail-host-notification" {
command = "mail-host-notification"
/* interval = 15m */
states = [ Up, Down ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
period = "24x7"
}
User
-------
object User "Tejas" {
import "generic-user"
enable_notifications = true
states = [ OK, Warning, Critical ]
types = [ Problem, Recovery ]
display_name = "Tejas Gadaria"
groups = [ "icingaadmins","ZePMGRelease"]
email = "refond,[email protected]<mailto:[email protected]>"
}
Where is the Notification object/apply rule defined for your host? (Hint:
'icinga2 object list --type Notification')
Add both, the notification and host config objects.
Kind regards,
Michael
Also I tried to add "Up, Down" attribute to user states but no luck.
While surfing i found this bug https://dev.icinga.org/issues/6973
any help will be appreciated
Regards,
Tejas
_______________________________________________
icinga-users mailing list
[email protected]<mailto:[email protected]>
https://lists.icinga.org/mailman/listinfo/icinga-users
--
Michael Friedrich, DI (FH)
Application Developer
NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77<tel:%2B49%20911%2092885-77>
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de |
[email protected]<mailto:[email protected]>
** OSBConf 2015 - September - osbconf.org<http://osbconf.org> **
** OSMC 2015 - November - netways.de/osmc<http://netways.de/osmc> **
_______________________________________________
icinga-users mailing list
[email protected]<mailto:[email protected]>
https://lists.icinga.org/mailman/listinfo/icinga-users
_______________________________________________
icinga-users mailing list
[email protected]<mailto:[email protected]>
https://lists.icinga.org/mailman/listinfo/icinga-users
--
Michael Friedrich, DI (FH)
Application Developer
NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | [email protected]
** OSBConf 2015 - September - osbconf.org **
** OSMC 2015 - November - netways.de/osmc **
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users