David_G__33241
Dec 16, 2015Nimbostratus
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