Forum Discussion
Execute iCall from iRule
I have an iRule that executes a sideband connection in order to execute a bash script that runs a bunch of openssl commands. I would like to implement this using iCall so that I can eliminate the sideband connection and make the script part of the big-ip configuration.
The script and handler are pretty straight forward (thanks to the DevCentral community):
sys icall script helloworld_script {
app-service none
definition {
set ifilename [exec bash -c "ls /config/filestore/files_d/Common_d/ifile_d/*testscript.sh*"]
exec /bin/bash $ifilename
}
description none
events none
}
sys icall handler triggered helloworld_trigger {
script helloworld_script
subscriptions {
helloworld_subscription {
event-name helloworld_event
}
}
}
I can test this with:
generate sys icall event helloworld_event context none
The part I am not sure about is executing this from an iRule. The only thing I have come across is to Jason’s article which talks about using an ISTATS::set trigger from the iRule. Is this really the only way to execute an iCall from an iRule?
Thanks,
David
1 Reply
- PeteWhite
Employee
There are three ways to trigger this and it is configured based on the handler - triggered, perpetual and periodic. If you want it triggered then you need to create the event and the event only has iStats configuration, which you would call from the iRule using ISTATS::set or ISTATS::incr.
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