Forum Discussion
Fire irule when condition met
Hello, is there a way to fire an irule when a condiftion met (such as VS connction limit is reached 90%). I thought about
"/etc/alertd/alert.conf"
file, but i don't know to fire the irule inside it, any thoughts....- Satoshi_Toyosa1Ret. Employee
This one? K14397: Running a command or custom script based on a syslog message
You can write a code that attaches an iRule to a virtual using tmsh scripting. See TMSH Scripting in v10.1
- Satoshi_Toyosa1Ret. Employee
Sample implementation:
(see K14397) -- this attaches the iRule/config/alert_user.conf
to the virtualTestMe
when a message containing "I sense something" appears invs
./var/log/ltm
alert st_exec_command "I sense something" { exec command="tmsh modify ltm virtual vs rules { TestMe }" }
Send a test log message:
logger -p local0.info "I sense something; a presence I have not felt since..."
Check if the iRule is attached:
tmsh list ltm virtual vs rules ltm virtual vs { rules { TestMe } }
Access the virtual. See if it fired. In this example, the
iRule logs message (log local0. "xxxx").TestMe
Jul 26 12:18:36 ltm1310 info tmm[12214]: Rule /Common/TestMe : Obi-Wan is here. The Force is with him.
You need to find the exact log message that trigers the iRule. If the virtual already had other iRules, the logic may become more complex. In that case, you may want to write a tmsh script.
Recent Discussions
Related Content
* 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