Questo contenuto non è disponibile nella lingua selezionata.
18.4. Monitoring Notifications
18.4.1. Configuring Nagios Server to Send Mail Notifications Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
- In the
/etc/nagios/gluster/gluster-contacts.cfg
file, add contacts to send mail in the format shown below:Modifycontact_name
,alias
, andemail
.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Theservice_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 statesu
: Notify on UNKNOWN service statesc
: Notify on CRITICAL service statesr
: Notify on service RECOVERY (OK states)f
: Notify when the service starts and stops FLAPPINGn (none)
: Do not notify the contact on any type of service notifications
Thehost_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 statesu
: Notify on UNREACHABLE host statesr
: Notify on host RECOVERY (UP states)f
: Notify when the host starts and stops FLAPPINGs
: Send notifications when host or service scheduled downtime starts and endsn (none)
: Do not notify the contact on any type of host notifications.
Note
By default, a contact and a contact group are defined for administrators incontacts.cfg
and all the services and hosts will notify the administrators. Add suitable email id for administrator incontacts.cfg
file. - To add a group to which the mail need to be sent, add the details as given below:
define contactgroup{ contactgroup_name Group1 alias GroupAlias members Contact1,Contact2 }
define contactgroup{ contactgroup_name Group1 alias GroupAlias members Contact1,Contact2 }
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In the
/etc/nagios/gluster/gluster-templates.cfg
file specify the contact name and contact group name for the services for which the notification need to be sent, as shown below:Addcontact_groups
name andcontacts
name.Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can configure notification for individual services by editing the corresponding node configuration file. For example, to configure notification for brick service, edit the corresponding node configuration file as shown below:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To receive detailed information on every update when Cluster Auto-Config is run, edit
/etc/nagios/objects/commands.cfg
file add$NOTIFICATIONCOMMENT$\n
after$SERVICEOUTPUT$\n
option innotify-service-by-email
andnotify-host-by-email
command definition as shown below:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the Nagios server using the following command:
service nagios restart
# service nagios restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The Nagios server sends notifications during status changes to the mail addresses specified in the file.
Note
- By default, the system ensures three occurences of the event before sending mail notifications.
- By default, Nagios Mail notification is sent using
/bin/mail
command. To change this, modify the definition fornotify-host-by-email
command andnotify-service-by-email
command in/etc/nagios/objects/commands.cfg
file and configure the mail server accordingly. - Ensure that the mail server is setup and configured.
18.4.2. Configuring Simple Network Management Protocol (SNMP) Notification Copia collegamentoCollegamento copiato negli appunti!
Copia collegamentoCollegamento copiato negli appunti!
- Log in as root user.
- In the
/etc/nagios/gluster/snmpmanagers.conf
file, specify the Host Name or IP address and community name of the SNMP managers to whom the SNMP traps need to be sent as shown below:HostName-or-IP-address public
HostName-or-IP-address public
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the/etc/nagios/gluster/gluster-contacts.cfg
file specify the contacts name as +snmp as shown below:Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can download the required Management Information Base (MIB) files from the URLs given below: - Restart Nagios using the following command:
service nagios restart
# service nagios restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow