Difference between revisions of "Enabling SNMP/email alerts"

From Tech-Wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
'''[[F5 Networks#Misc|Back to Misc]]'''
 
'''[[F5 Networks#Misc|Back to Misc]]'''
  
# Log in to the Traffic Management Shell (tmsh) by typing the following command:  
+
Log in to the Traffic Management Shell (tmsh) by typing the following command:  
 
  tmsh
 
  tmsh
 
+
To configure the system to send locally generated email messages, use the following command syntax:  
# To configure the system to send locally generated email messages, use the following command syntax:  
+
 
  modify /sys outbound-smtp mailhub <mail_server>:<port>
 
  modify /sys outbound-smtp mailhub <mail_server>:<port>
 
+
To save the configuration, type the following command:  
# To save the configuration, type the following command:  
+
 
  save /sys config
 
  save /sys config
 
+
''Optional'': If the SMTP mail host supports Secure Sockets Layer (SSL)/TLS authentication but does not establish a secure connection automatically, you must add the following four additional parameters into the /etc/ssmtp/ssmtp.conf configuration file:  
#Optional: If the SMTP mail host supports Secure Sockets Layer (SSL)/TLS authentication but does not establish a secure connection automatically, you must add the following four additional parameters into the /etc/ssmtp/ssmtp.conf configuration file:  
+
 
  UseSTARTTLS=yes
 
  UseSTARTTLS=yes
 
  UseTLS=yes
 
  UseTLS=yes
 
  AuthUser=<SMTP-Account-Username>
 
  AuthUser=<SMTP-Account-Username>
 
  AuthPass=<SMTP-Account-Password>
 
  AuthPass=<SMTP-Account-Password>
 +
Verify that ssmtp is configured properly and can send an email message:
 +
echo "ssmtp test mail" | mail -vs "Test email" [email protected]
 +
To modify the permissions on the user_alert.conf file to include write access, type the following command:
 +
chmod 644 /config/user_alert.conf
  
#Verify that ssmtp is configured properly and can send an email message:
+
<nowiki>
 
+
echo "ssmtp test mail" | mail -vs "Test email" [email protected]
+
 
+
 
+
8.To modify the permissions on the user_alert.conf file to include write access, type the following command:
+
chmod 644 /config/user_alert.conf
+
 
+
 
alert BIGIP_SHELL_BP_CONFIGURATION_LOADED {
 
alert BIGIP_SHELL_BP_CONFIGURATION_LOADED {
 
  snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.28";
 
  snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.28";
Line 63: Line 57:
 
  body="A node came up"
 
  body="A node came up"
 
}
 
}
 +
</nowiki>
  
 +
To restore the permissions on the user_alert.conf file, type the following command:
 +
chmod 444 /config/user_alert.conf
 +
To restart the alertd process, type the following command:
 +
tmsh restart /sys service alertd
  
 
+
*[https://support.f5.com/kb/en-us/products/big-ip-afm/manuals/product/network-firewall-policies-implementations-12-1-0/18.html SNMP Traps]
9.To restore the permissions on the user_alert.conf file, type the following command:  
+
chmod 444 /config/user_alert.conf
+
 
+
10.To restart the alertd process, type the following command:
+
tmsh restart /sys service alertd
+

Latest revision as of 01:32, 11 December 2018

Back to Misc

Log in to the Traffic Management Shell (tmsh) by typing the following command:

tmsh

To configure the system to send locally generated email messages, use the following command syntax:

modify /sys outbound-smtp mailhub <mail_server>:<port>

To save the configuration, type the following command:

save /sys config

Optional: If the SMTP mail host supports Secure Sockets Layer (SSL)/TLS authentication but does not establish a secure connection automatically, you must add the following four additional parameters into the /etc/ssmtp/ssmtp.conf configuration file:

UseSTARTTLS=yes
UseTLS=yes
AuthUser=<SMTP-Account-Username>
AuthPass=<SMTP-Account-Password>

Verify that ssmtp is configured properly and can send an email message:

echo "ssmtp test mail" | mail -vs "Test email" [email protected]

To modify the permissions on the user_alert.conf file to include write access, type the following command:

chmod 644 /config/user_alert.conf
alert BIGIP_SHELL_BP_CONFIGURATION_LOADED {
 snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.28";
 email toaddress="[email protected]"
 fromaddress="root"
 body="New configuration loaded"
 }

alert BIGIP_MCPD_MCPDERR_POOL_MEMBER_MON_DOWN "Pool (.*?) member (.*?):(.*?) monitor status down." {
 snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.10";
 lcdwarn description="Node down" priority="1"
 email toaddress="[email protected]"
 fromaddress="root"
 body="A pool member went down"
}

alert BIGIP_MCPD_MCPDERR_POOL_MEMBER_MON_UP "Pool (.*?) member (.*?):(.*?) monitor status up." {
 snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.11"
 email toaddress="[email protected]"
 fromaddress="root"
 body="A pool member came back up"
}


alert BIGIP_MCPD_MCPDERR_NODE_ADDRESS_MON_DOWN "Node (.*?) monitor status down." {
 snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.12";
 lcdwarn description="Node address down" priority="1"
 email toaddress="[email protected]"
 fromaddress="root"
 body="A node went down"
}


alert BIGIP_MCPD_MCPDERR_NODE_ADDRESS_MON_UP "Node (.*?) monitor status up." {
 snmptrap OID=".1.3.6.1.4.1.3375.2.4.0.13"
 email toaddress="[email protected]"
 fromaddress="root"
 body="A node came up"
}
 

To restore the permissions on the user_alert.conf file, type the following command:

chmod 444 /config/user_alert.conf

To restart the alertd process, type the following command:

tmsh restart /sys service alertd