
2. Stop the Nagios service.
# service nagios stop
3. Add the user's contact name, alias, and Email to the
/usr/local/nagios/etc/objects/contacts.cfg
file using the following format:
define contact {
contact_name Contact1
alias ContactNameAlias
email email-address
service_notification_period 24x7
service_notification_options w,u,c,r,f,s
service_notification_commands notify-service-by-email
host_notification_period 24x7
host_notification_options d,u,r,f,s
host_notification_commands notify-host-by-email
}
define contact {
contact_name Contact2
alias ContactNameAlias2
email email-address
service_notification_period 24x7
service_notification_options w,u,c,r,f,s
service_notification_commands notify-service-by-email
host_notification_period 24x7
host_notification_options d,u,r,f,s
host_notification_commands notify-host-by-email
}
The
service_notification_options
directive is used to define the service states for which notifications
can be sent out to this contact. Valid options are a combination of one or more of the following:
●
w: Notify on WARNING service states
●
u: Notify on UNKNOWN service states
●
c: Notify on CRITICAL service states
●
r: Notify on service RECOVERY (OK states)
●
f: Notify when the service starts and stops FLAPPING
●
n (none): Do not notify the contact on any type of service notifications
The
host_notification_options
directive is used to define the host states for which notifications can be
sent out to this contact. Valid options are a combination of one or more of the following:
●
d: Notify on
DOWN
host states
●
u: Notify on
UNREACHABLE
host states
●
r: Notify on host
RECOVERY
(UP states)
●
f: Notify when the host starts and stops
FLAPPING
●
s: Send notifications when host or service scheduled downtime starts and ends
●
n (none): Do not notify the contact on any type of host notifications.
By default, a contact and a contact group are defined for administrators in the
contacts.cfg
file and all the
services and hosts will notify the administrators. Add suitable Email ID for the administrator in the
contacts.cfg
file.
System Monitoring
S3016
71