Forum Discussion
lostnytechie_55
Apr 28, 2011Nimbostratus
user_alert.conf not working
Hi all,
I'm hoping someone will be able to tell me what I'm doing wrong. i'm sure it's something simple too but I've been banging my head up against the wall for the last few days and I can't se...
hooleylist
May 05, 2011Cirrostratus
For our reference, here are the steps I cannibalized from C872450 from Chad:
1. Create a script file /usr/local/bin/mycustomscript.pl
vi /root/mycustomscript.pl
2. Add the script to the file and save:
!/usr/bin/perl
system("echo Alert was triggered > /var/tmp/mycustomscriptoutput.txt");
3. Set the permissions on the file:
chmod 755 /root/mycustomscript.pl
4. Edit /config/user_alert.conf and add the following alert definition. The quoted portion is a regex which must match the syslog message.
alert my_custom_alert "this is the text we look for in the syslog message" {
exec command="/usr/local/bin/mycustomscript.pl"
}
5. Trigger the script:
logger -p local0.info "this is the text we look for in the syslog message"
6. Review the script action which was to create a file and output some text:
less /var/tmp/mycustomscriptoutput.txt
Alert was triggered
Aaron
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