SMTP and Sentinel
The Interactive Voice Gateway (IVG) management system has the ability to generate alarms when workers are stopped, started, or down. These alarms are sent over an SMTP server, which acts as a relay host to send the alerts. The Sentinel, a process which monitors the Foreman and Configuration Manager, can also generate alerts should one of the monitored applications stop or fail.
The SMTP server and Sentinel email are configured during IVG Installation, but can also be configured post-installation by using the following steps.
Configuring the SMTP server
If the values for smtpserver, smtpuser, and smtppwd were configured during IVG Installation, executing the manual configuration will override the values written by the installer.
To configure the SMTP server:- Configure postfix smtp secure password file by running the following echo command:
>echo "smtpserver smtpuser:smtppwd" > /etc/postfix/sasl_passwd
Example:
>echo "196.10.10.1 installer@mobi.com:testing" > /etc/postfix/sasl_passwd
- Verify the contents of the /etc/postfix/sasl_passwd file.
- Configure the relay host using the following echo command:
>postconf -e 'relayhost = 'relayhostIPaddress =' '
Example:
>postconf -e 'relayhost = '196.10.10.1''
- Verify action by running the following command:
>postconf -n |grep '^relayhost ='
- Verify the output is similar to:
Relayhost=196.10.10.1
- Enable SMTP secure authentication using the following echo command:
>postconf -e 'smtp_sasl_auth_enable = yes'
- Verify action by running the following echo command:
>postconf -n |grep '^smtp_sasl_auth_enable ='
- Verify output of the echo command is similar to:
smtp_sasl_auth_enable = yes
- Set a secure SMTP password file for postfix using the following echo command:
>postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl/password
- Verify action by running the following echo command:
>postconf -n |grep '^smtp_sasl_password_maps='
- Verify the output of the echo command is similar to:
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
- Allow the postfix to use plain text authentication using the following echo command:
>postconf -e 'smtp_sasl_security_options='
- Verify action by running the following echo command:
>postconf -n |grep '^smtp_sasl_security_options ='
- Verify the output of the echo command is similar to:
smtp_sasl_security_options =
Important:
The configuration parameter smtp_sasl_security_options should not be set.
- Secure the password file using the following echo commands:
>chowm root:root /etc/postfix/sasl_password
>chmod 600 /etc/postfix/sasl_psswd
- Hash the password file to generate the password database file using the following echo command:
>postmap /etc/postfix/sasl_psswd
- Verify action by verifying the /etc/postfix/sasl_psswd.db file is generated.
- Restart postfix and check its status by running the following echo commands:
>/etc/init./d/postfix restart
>/etc/init.d/postfix status
- Log in using the Holly user and restart the subagent by running the following echo commands:
>su - holly
>fm start subagent
- Verify the subagent status by running the following echo command:
>fm status
Note:
It is recommended to wait a minute prior to running the >fm status command.
- Verify the status reads OK.
- Send a test email by running the following echo command:
>echo "this is a test email." | mail -s "send mail config testing." smtpuser
Important:
The value for smtpuser should be the email address configured in Step 1.
- Verify the email was sent to the smtpuser email address.
- Check /ver/log/mailog and verify the email was sent using the configured smtp. The log should resemble the following:
Nov 29 04:21:19 installhvp02 postfix/pickup[21520]: 797DE22070D: uid=5431 from=<holly>
Nov 29 04:21:19 installhvp02 postfix/cleanup[15570]: 797DE22070D: message-id=<20161129092119.797DE22070D@installhvp02.qalab.local>
Nov 29 04:21:19 installhvp02 postfix/qmgr[8332]: 797DE22070D: from=<holly@installhvp02.qalab.local>, size=469, nrcpt=1 (queue active)
Nov 29 04:21:19 installhvp02 postfix/smtp[15593]: 797DE22070D: to=<developer@developer.com>, relay=196.10.10.1[196.10.10.1]:25, delay=0.11, delays=0.04/0.06/0.01/0.01, dsn=2.0.0, status=sent (250 Queued (0.000 seconds))
Nov 29 04:21:19 installhvp02 postfix/qmgr[8332]: 797DE22070D: removed
Notes:
- The value for to should be the smtpuser email address.
- The value for relay should be the value for smtpserver.
- The value for status should be sent.
After configuring the SMTP server, user, and password, alarms can be configured in the management system by navigating to Configuration > Holly Alarms.
Configuring Sentinel email
After configuring the SMTP server, a recipient must be configured to receive the email alerts. To configure an email recipient:
- Navigate to /export/home/holly/bin/sentinel
- Locate the MAILTO line.
- Add the recipient email address.
- Save the file.
- Run the following command to restart Sentinel:
sentinelctl start
Configuring Sentinel Polling Period
The Sentinel polls the status of the Foreman and Configuration Manager every five minutes in a 60 minute period. Update the polling frequency by:
- Navigate to /var/spool/cron/holly
- Locate the bin/sentinel line. The default values indicate a polling frequency of every five minutes within a 60 minute period:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * bin/sentinel
- Update the integer string with the desired polling frequency for a 60 minute period. The following example represents a polling interval of every 15 minutes:
0,15,30,45 * * * * bin/sentinel
- Save the file.
- Restart the Cron service by executing the following commands:
- /sbin/service crond stop
- /sbin/service crond start