System information
54 System Analysis and Tuning Guide
with the max_check_attempts directive. All configuration flags beginning with
notification handle how Nagios should behave when a failure of a monitored
service occurs. In the host definition above, Nagios notifies the administrators only
on working hours. However, this can be adjusted with notification_period.
According to notification_interval notifications will be resend every two
hours. notification_options contains four different flags: d, u, r and
n. They control in which state Nagios should notify the administrator. d stands for a
down state, u for unreachable and r for recoveries. n does not send any no-
tifications anymore.
Example3.2: A Service Object Definition
define service {
use generic-service
host_name SRV1
service_description PING
contact_groups router-admins
check_command check_ping!100.0,20%!500.0,60%
}
The first configuration directive use tells Nagios to inherit from the gener
ic-service template. host_name is the name that assigns the service to the host
object. The host itself is defined in the host object definition. A description can be set
with service_description. In the example above the description is just PING.
Within the contact_groups option it is possible to refer to a group of people who
will be contacted on a failure of the service. This group and its members are later de-
fined in a contact group object definition. check_command sets the program that
checks whether the service is available, or not.
Example3.3: A Contact and Contactgroup Definition
define contact {
contact_name admins
use generic-contact
alias Nagios Admin
e-mail nagios@localhost
}
define contactgroup {
contactgroup_name router-admins
alias Administrators
members admins
}
The example listing above shows the direct contact definition and its proper con-
tactgroup. The contact definition contains the e-mail address and the name of