NetWorker server's deployed on Linux utilize the Linux mail command to send NetWorker logging through email. This functionality is dependent 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 will be picked up by the recipient email address specified.
Example:
mail -s "${NSR} ${policy} ${workflow} ${status}" -r bkupadmin@emclab.local backupadmin@dell.com
Before configuring email notifications in NetWorker, the mail command should be run from the NetWorker server's command line to ensure that emails are received.
Example:
When you run the mail command it will drop to a new line with no prompt. You can type a test message (as shown above). On a new line enter . (period) which will return EOT.
An email message should be received by the recipient email address. 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:
a. To check if postfix is running, run:
systemctl status postfix
b. If it's not running, can it be started:
systemctl start postfix
c. If any issues are observed check:
systemctl status postfix
journalctl -xe
d. Confirm if postfix is configured to start after a system reboot:
systemctl enable postfix
NOTE: If it was not enabled you will see a message about a symlink being created for systemd. If it was already enabled, no message will be outputted and the prompt will return.
2. If you have specified a `
-s <mail server hostname or IP>`, confirm that you can reach the mail server from the NetWorker server.
a. NetWorker comes with the nsrports command which can be used to test name resolution and network connectivity. Confirm that you can reach port 25 (default SMTP) on the mail server:
nsrports -t mailserver_hostname -p 25
Example:
Other methods for troubleshooting resolution and connectivity:
b. Is host name resolution working:
nslookup mailserver_fqdn
nslookup mailserver_shortname
nslookup mailserver_ip
c. Check the /etc/hosts file for any entries for the mailserver. If any incorrect entries are found, set the correct IP address or remove the entry:
cat /etc/hosts
d. Does port 25 respond using the curl command:
curl -v mailserver_hostname:25
Example:
3. Check the mail queue to see if any errors are returned:
mailq
Example:
If the mailq command does not return anything then the mail queue is empty.
Any issues observed with the above steps will need to be resolved by the appropriate system administrator in the environment.