Not receiving email notifications

For some reason I’m not receiving email notifications for all the hosts I have. Can someone check this configuration or point me to a page that has a good sample configuration so I can get email notifications?

Thanks.

contacts.cfg

define contact{
contact_name me
alias me
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,r
host_notification_options d,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email [email protected]
}

define contact{
contact_name you
alias you
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,r
host_notification_options d,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email [email protected]
}

hosts.cfg

Generic host definitions

define host{
name mygeneric-host ; Generic template name
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

This creates a generic template that any host can use.

Notifies never, checks 15 times before showing critical on CGI interface,

define host{
name basic-host
use mygeneric-host
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}

define host{
use basic-host
host_name myserver-db
alias myserver-db
address 192.168.1.210
contact_groups einsteins
}

services.cfg

Generic service definition template

define service{
name mygeneric-service ; Generic service name
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (Don’t disable)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness’
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
register 0 ; DONT REGISTER THIS DEFINITION - NOT A REAL SERVICE, JUST A TEMPLATE!
}

Generic for all services

#define service{

use mygeneric-service

name basic-service

is_volatile 0

check_period 24x7

max_check_attempts 15

normal_check_interval 10

retry_check_interval 2

notification_interval 0

notification_period none

register 0

}

Service Definitions

#########

define service{
use mygeneric-service
hostgroup_name ssh-clients
service_description SSH
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups einsteins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_ssh
}

what does the nagios notification page say? is it sending them? What kind of MTA do you have installed? what do the logs say?