Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

When Active/Standby failover send mail

Michaelyang
Cirrostratus
Cirrostratus

Hello,

I'm trying to get email notifications on my gmail if a BigIP redundancy pair failover occurs.
Here are my settings :

# vi /etc/ssmtp/ssmtp.conf
root=XXXXX@gmail.com
mailhub=smtp.gmail.com:587
Hostname=bigipA.gmail.com
FromLineOverride=YES
TLS_CA_FILE=/etc/pki/tls/certs/ca-bundle.crt
UseSTARTTLS=Yes
UseTLS=Yes
AuthUser=XXXXX@gmail.com
AuthPass=xxxxxxxxxxxx

#vi /etc/alertd/alert.conf
alert BIGIP_SOD_SODERR_SOD_STANDBY {
snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.14";
lcdwarn description="Unit going standby." priority="0";
email toaddress="XXXXX@gmail.com"
fromaddress="root"
body="LTM Failover : going to standby"
}
alert BIGIP_SOD_SODERR_SOD_ACTIVE {
snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.15";
lcdwarn description="Unit going Active." priority="0";
email toaddress="XXXXX@gmail.com"
fromaddress="root"
body="LTM Failover : going to active"
}

sSMTP configuration should be correct, because sending emails can be received
#echo -e "Subject: Test email for K13180\n\nssmtp test mail" | ssmtp -v XXXXX@gmail.com

Michaelyang_0-1665631750608.png

When failover occurs, it does not work...

Michaelyang_1-1665631973785.png

How do I change the settings?
Any help is appreciated.

 

1 ACCEPTED SOLUTION

If you tested the SMTP email is working and configured for your feature then maybe see /config/user_alert.conf as this is the only file that you should touch for custom alerts. (https://support.f5.com/csp/article/K30371285 ).

 

Other usefull links:

https://support.f5.com/csp/article/K54018808

https://support.f5.com/csp/article/K87630102

https://support.f5.com/csp/article/K2446

 


Also you can create a bash script that triggers the "logger -p " command and add a message to /var/log/ltm (https://support.f5.com/csp/article/K11127 ) and place the script as You can even trigger scripts on the F5 device if the state changes from active to standby or from standby to active by adding the scripts under /config/failover/. For example if you have a bug for a critical process that causes a failover ( you can use the command show /sys ha-status all-properties to check for this https://support.f5.com/csp/article/K20060182 ) but the device does not reboot or fix the process you can run a script to when the device becomes standby to restart the process. (https://support.f5.com/csp/article/K6008 )

An article I made about this long ago:

https://community.f5.com/t5/codeshare/knowledge-sharing-ways-to-trigger-and-schedule-scripts-on-the-...

View solution in original post

2 REPLIES 2

If you tested the SMTP email is working and configured for your feature then maybe see /config/user_alert.conf as this is the only file that you should touch for custom alerts. (https://support.f5.com/csp/article/K30371285 ).

 

Other usefull links:

https://support.f5.com/csp/article/K54018808

https://support.f5.com/csp/article/K87630102

https://support.f5.com/csp/article/K2446

 


Also you can create a bash script that triggers the "logger -p " command and add a message to /var/log/ltm (https://support.f5.com/csp/article/K11127 ) and place the script as You can even trigger scripts on the F5 device if the state changes from active to standby or from standby to active by adding the scripts under /config/failover/. For example if you have a bug for a critical process that causes a failover ( you can use the command show /sys ha-status all-properties to check for this https://support.f5.com/csp/article/K20060182 ) but the device does not reboot or fix the process you can run a script to when the device becomes standby to restart the process. (https://support.f5.com/csp/article/K6008 )

An article I made about this long ago:

https://community.f5.com/t5/codeshare/knowledge-sharing-ways-to-trigger-and-schedule-scripts-on-the-...

Hi Nikoolayy1,

Thank you for your reply
I set it up according to the link below
https://community.f5.com/t5/technical-forum/monitoring-active-standby-failover/m-p/44838
I don't know what's wrong with the settings

Any help is appreciated