How do we enable gpcrondump email notifications after a backup of Greenplum Database has completed?
gpcrondump has the ability to send email alerts when a Greenplum database backup is executed. However, the default configuration on a DCA v1/v2 needs customer specific modification in configuration files to enable email alerts.
To have gpcrondump send out status email notifications, you must place a file named mail_contacts in the home directory of the greenplum superuser (gpadmin) or in the same directory as the gpcrondump utility ($GPHOME/bin). This file should contain one email address per line. gpcrondump will issue a warning if it cannot locate a mail_contacts file in either locations. If both locations have a mail_contacts file, then the one in $HOME takes precedence.
1) Put a file named "mail_contacts" in /home/gpadmin. This file should have a single line per email contact
2) As root, modify /etc/mail/sendmail.cf as per the below instruction
\# "Smart" relay host (may be null) DS
\# "Smart" relay host (may be null)
Note: There must be a period after the .com above.
3) Modify /etc/hosts to include an alias
Find the entry for mdw host and add mdw.company.com as an alias like below:
172.28.8.250 mdw mdw-1 mdw.company.com
4) Change the permission of the files
[root@mdw ~]#chmod 755 /
[root@mdw ~]#chmod 755 /etc
5) Restart sendmail
[root@mdw ~]#service sendmail restart
Starting sendmail: [ OK ]
Starting sm-client: [ OK ]
6) Verify if mailx rpm is installed.
[root@mdw ~]# rpm -qa | egrep mailx
If mailx package is already installed, Great !!. If not, please install mailx package from the rpm file at mdw. Example below, please modify the command as per the version of rpm on your DCA v1/v2.
[root@mdw ~]# rpm -ivh /opt/rhel/55/CD1/Server/mailx-8.1.1-44.2.2.x86_64.rpm
Now that sendmail is configured, executing gpcrondump must send an email to everyone in the mail_contacts after it's finished either with success / failure.
All set !!