Forum Discussion
2cushty_206
Nimbostratus
Jul 09, 2010irule trigger external script
Hi,
I'm looking for a way to initiate a script on an external server from within the irule logic. I know this can be done via monitors but I want to do it under the control of an irule? I gu...
juan_salinas_47
Nimbostratus
Jul 10, 2010hi 2cushty,
i have an ugly solution...
1.- in the irule use the log command to send a specific magic message to the syslog ltm:
log local0. "launch_my_script_xxx"
2.-in the LTM write a shell (myscript.sh) or perl script to create a pipe (/var/log/myscript.pipe) and read it waiting for the magic message
3.-in the LTM add this lines to the OS syslog configuration /etc/syslog-ng/syslog-ng.conf
filter my_magic_message {
match("launch_my_script_xxx");
};
destination d_myscript {
pipe("/var/log/myscript.pipe");
};
log {
source(s_syslog_pipe);
filter(f_local0);
filter(my_magic_message);
destination(d_myscript);
};
start your script and restart syslog-ng service
4.-when your script read the magic message on the pipe it must start the logic connecting via ssh to the stanby servers and sending the commands to start or stop any service necesary .
5.-in the LTM add your script to /etc/rc.local to startup after reboot the box
6.- excuse my english...
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