Forum Discussion

Roman_80473's avatar
Roman_80473
Icon for Nimbostratus rankNimbostratus
Jun 06, 2011

Invoke java method from iRule or iControl

Hi folks,

 

I'm new to iRules/iControl, and was wondering if I could get a sound advice here. We have an LTM with some pool members (Weblogic servers). The Weblogic servers have java MBeans (managed beans) and WebServices installed on them. Is there a way to invoke a method inside an MBean or WebService from either iRule or iControl? I've done some basic things with iControl API, but wasn't sure I could invoke an outside component.

 

 

Any help is appreciated,

 

Roman
  • From a server-perspective, there is no direct way to call out to outside methods from our iRules or iControl. For iControl, you could make a call to an outside object from your client, but not in the server implementation. Now, that's not saying it can't be done, just not directly. We've seen folks use iRules issuing log statements to the syslog system and then configured the syslog system to execute a script based on entries in the log. You can also use the high speed logging (or external logging with the log command) to pipe syslog based messages to the target of your choice. You could implement a syslog server that listened for your commands and then did something on that behalf. Both solutions do fairly the same thing. The first is on the LTM, the second would be on a target system of your choice.

     

     

    -Joe

     

  • Joe, thanks for the post. I think I have a rough idea now. On the same token, can I add/delete LTM pool member from inside iRule based on the return value?

     

    Thanks Roman
  • Unfortunately that's a no as well. iRules are purely a data-plane engine. adding/deleting pool members is a control-plane function and that is handled from external processes like the GUI or iControl apps. Now, you can make a data-plane decision by sending traffic to/from certain pools or members within a pool, but you can't add/remove directly.

     

     

    But, you could do something like I mentioned before where you log a message to the syslog system and have a monitoring process look for certain messages and then perform the actions based on those messages with a shell command.

     

     

    -Joe

     

  • ok, got it, thanks.

     

    Roman

     

     

    P.S. http://devcentral.f5.com/wiki/default.aspx/iRules/LB__down.html states it's possible to take the pool member down from inside an iRule. I haven't actually tried it. Any thoughts?