Email notification to 2 emails addreses with different statu


#1

Hi,

i want to ask you for little bit help if is possible.

i want to configure nagios to send email notification to 2 email addresses. First one should be received all crytical messages and second should be receive a message only when host is down.

Now i have this configuration of host, contact and services, but it doesn’t send email to the second mail address.

Host.cfg:
[blockquote]define host{
host_name server.example.com ; hostname
use generic-host ; general options
alias server 1 ; alias name for this host
address xxx.xxx.xxx.xxx ; IP Address
check_command check_ssh ; Checking for host-alive, we can check with check_ssh options
max_check_attempts 10
check_period 24x7
notification_period 24x7
notification_interval 120
notification_options d,r,u
contact_groups admins
}
[/blockquote]

contacts.cfg
[blockquote]define contact{
contact_name adminuser
alias Sys Admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c
host_notification_options d,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email admin@example.com
}

define contact{
contact_name casamerica_customer
alias casamerica_cust
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c
host_notification_options d,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email jchurba@example.com
}
[/blockquote]

contactgroups.cfg

[blockquote]
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members adminuser
}

define contactgroup{
contactgroup_name casamerica
alias Casamerica Customer Notification
members casamerica_customer
}
[/blockquote]

so i want adminuser to receive every message for crytical services and when host is down, but casamerica user to receive only message when host is down.

these are the services, that i have defined
[blockquote]
#################################################################################

CHECK SSH - HOST A LIVE !!!IMPORTANT!!!

#################################################################################

define service{
use local-service
host_name server.example.com
service_description Check SSH
check_command check_ssh
contact_groups admins, casamerica
}

#################################################################################

CHECK HTTPD - APACHE

#################################################################################

define service{
use local-service
host_name server.example.com
service_description Check server.example.com httpd
check_command check_http!87.106.12.40!15!30!60
contact_groups admins
}

#################################################################################

CHECK USERS

#################################################################################

define service{
use local-service
host_name server.example.com
service_description Check users in remote machines
check_command check_nrpe!check_users!20%!10%!/
contact_groups admins
}

#################################################################################
[/blockquote]

This is what i did.

I hope that i will find some help here. [/blockquote]

Thanks in advanced!