below is my contacts and services templates...
contacts_nagios2.cfg
Code: Select all
###############################################################################
# contacts.cfg
###############################################################################
###############################################################################
###############################################################################
#
# CONTACTS
#
###############################################################################
###############################################################################
# In this simple config file, a single contact will receive all alerts.
define contact{
name contact-template
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
}
define contact{
contact_name root
alias Root
use contact-template
email xxx
}
define contact{
contact_name itdba
alias IT DBA
use contact-template
email xxxx
}
###############################################################################
###############################################################################
#
# CONTACT GROUPS
#
###############################################################################
###############################################################################
# We only have one contact in this simple configuration file, so there is
# no need to create more than one contact group.
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members root
}
define contactgroup{
contactgroup_name dbadmins
alias DB Admins
members itdba
}
Code: Select all
# generic service template definition
define service{
name generic-service-template ; The 'name' of this service template
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 (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 0 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction 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
#notification_interval 0 ; Only send notifications on status change by default.
notification_interval 60 # 30min
is_volatile 0
check_period 24x7
normal_check_interval 5
retry_check_interval 1
max_check_attempts 1
notification_period 24x7
notification_options w,u,c,r
#contact_groups admins
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
define service{
name generic-service ; The 'name' of this service template
use generic-service-template
#contact_groups admins
contacts root
}
define service{
name generic-service-dba ; The 'name' of this service template
use generic-service-template
#contact_groups dbadmins
contacts itdba
}
Code: Select all
define service{
use generic-service-dba
hostgroup_name db-servers
service_description H Drive
check_command check_snmp_disk!public!H!70%!80%
}
so my question is, what is the different between contacts and contact_groups??
I also notice a similar problem in the forum http://support.nagios.com/forum/viewtop ... =7&t=28534 but no detail explanation about it
Code: Select all
[2014-08-21 10:39:51] SERVICE NOTIFICATION: itdba;6800SRETDB;H Drive;CRITICAL;notify-service-by-email;SNMP CRITICAL - H:\ Label:New Volume Serial Number 56a61c06 at 96% with 9,453 of 279,797 MB free
[2014-08-21 10:39:51] SERVICE NOTIFICATION: root;6800SRETDB;H Drive;CRITICAL;notify-service-by-email;SNMP CRITICAL - H:\ Label:New Volume Serial Number 56a61c06 at 96% with 9,453 of 279,797 MB free