Forum Discussion

Ed_Hammond_2611's avatar
Icon for Nimbostratus rankNimbostratus
Aug 17, 2011

user_alert.conf and automation - good stuff!

For a description on how user_alert.conf works & syntax rules, see

With new messages available in 10.2 such as:

Aug 17 10:34:31 local/localhost notice mcpd[5571]: 01070727:5: Pool member monitor status up.

Aug 17 10:34:31 local/tmm7 err tmm7[7389]: 01010221:3: Pool your-cool-pool now has available members

combined with the older and very useful messages:

Aug 17 10:34:22 local/localhost notice mcpd[5571]: 01070638:5: Pool member monitor status down.

Aug 17 10:34:22 local/tmm9 err tmm9[7404]: 01010028:3: No members available for pool your-cool-pool

you can now perform actions on the F5 itself based on a pool becoming totally unavailable.

In the /config/user_alert.conf file, you can include statements like:

/*  This works with my cool pool */
alert your-cool-pool-DOWN "No members available for pool your-cool-pool" {
   exec command="/config/monitors/MyScript 'your-cool-pool' 'down'"
alert your-cool-pool-UP "Pool your-cool-pool now has available members" {
   exec command="/config/monitors/MyScript 'your-cool-pool' 'up'"

This provides a complete solution to taking an action when a pool goes up or down.

WARNING: Since alertd only examines the /var/log/ltm syslog-ng message body, you can not detect which TMM instance (CPU) cut the message. Since the script has no access to the complete message that triggered the execution, you are left with the challenge to develop your own concurrency collision race condition handler through a lock file of some sort.