Forum Discussion
Hebex_35785
Nimbostratus
Mar 11, 2009Generic command in user_alert.conf
Hi,
I would like to execute a generic command when the state of a instance change
Is it possible to keep the message and pass it to my commande
Ex:
alert BIGIP_GTMD_MONITOR_INSTANCE_STATE_CHANGE "Monitor instance (.*) (.*).*) (.*) --> (.*) from (.*) (.*)"
{
exec command="/usr/local/bin/my_command $LOG"
}
With result :
/usr/local/bin/my_command Monitor instance HTTP x.x.x.x:80 DOWN --> UP from x.x.y.y (state: success)
Tanks
Romain
- hoolio
Cirrostratus
Hi Romain, - Hebex_35785
Nimbostratus
Hi Aaron, - hoolio
Cirrostratus
Of course you you're correct... sorry about the mis-statement. I still don't think you can call a shell script from the alert.conf/user_alert.conf though. But I think Mike's script should provide the functionality you're looking for. - Hebex_35785
Nimbostratus
It's possible to call a shell script from alert.conf or user_alert.conf but the problem is to pass the log line in argument. I'm trying with the support. - hoolio
Cirrostratus
Sorry for the misinformation. That's a nice surprise. SOL9469 (Click here) describes the ability to run a shell script from the alert.conf or user_alert.conf files. I couldn't figure out a way to pass the original log message as an argument to the script though. If you don't get any suggestions here, you might try opening a case with F5 Support on this. - hoolio
Cirrostratus
Hi Romain, - patrickdaj_7040
Nimbostratus
Did anyone ever determine whether it was possible to pass the log content on to the executed script? - hoolio
Cirrostratus
Nope. Could you try opening a case with F5 Support to see if they have any recommendations? If you find out anything, could you reply back here for future reference? - Ed_Hammond_2611
Nimbostratus
You cannot pass anything from the message (at least I never found one after looking for quite a while). While you can have glob expressions for the pattern match, you can not alter the execution based on the pattern matched. Worse yet, you can only match the variable text of the message, so for those systems with multiple CPUs and the message is issued once for each CPU, the match will occur many times (12 times on a 11050 10.2.1 HF2 system). That means you have to deal with collision/race conditions on your own. Very sad! - hoolio
Cirrostratus
Hi Ed,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects