NetWorker: How to configure email notification on Linux
Сводка: How to configure email notification on Linux.
Инструкции
NetWorker server's deployed on Linux use the Linux mail or
mailx commands to send NetWorker logging through email. This functionality depends on non-NetWorker environment configurations.
Basic syntax of the mail command:
mail [-s <mail server hostname or IP>] -s "<subject>" -r <sender_email> <recipient_email1> [<recipient_email2>]
Specifying the mail server is not always required. In some environments, the mail server is picked up by the recipient email address specified.
Example:
mail -s "${NSR} ${policy} ${workflow} ${status}" -r bkupadmin@amer.local backupadmin@dell.com
Before configuring email notifications in NetWorker, the mail or mailx command must be run from the NetWorker server's command line to ensure that emails are received.
Example:
When you run the mail command, it drops to a new line with no prompt. You can type a test message (as shown above). On a new line, enter . (period) which returns End Of Transmission (EOT).
Check the recipient's email inbox (and spam folders) for an email. If an email message is received, you can configure notifications in NetWorker:
Дополнительная информация
Troubleshooting:
If the email message is not received, there are a few steps which can be performed to identify the issue.
1. Is the postfix service running on the server:
systemctl status postfix
b. If it is not running, can it be started?
systemctl start postfix
c. If any issues are observed, check the service status and messages:
systemctl status postfix
journalctl -xe
d. Confirm if postfix is configured to start after a system reboot:
systemctl enable postfix
systemd. If it was already enabled, no message is outputted and the prompt returns.
2. If you have specified a `-S <mail server hostname or IP>`, confirm that you can reach the mail server from the NetWorker server.
nsrports -t mailserver_hostname -p 25
Example:
Other methods for troubleshooting resolution and connectivity:
nslookup mailserver_fqdn
nslookup mailserver_shortname
nslookup mailserver_ip
c. Check the /etc/hosts file for any entries for the mail server. If any incorrect entries are found, set the correct IP address or remove the entry:
cat /etc/hosts
curl -v mailserver_hostname:25
Example:
mailq
Example:
mailq command does not return anything, then the mail queue is empty.