Forum Discussion

kuhn_52743's avatar
kuhn_52743
Icon for Nimbostratus rankNimbostratus
Oct 23, 2009

Change iRule variable without reloading rule

Hello,

 

 

I need to be able to change the value of a variable that is used in my iRule, without editing the irule and having to reload it (which would cause service interruption.)

 

 

Really what I want to do is just have the iRule read a value from a file every time it needs to make a certain calculation. That way if I want the value to change I can just update the file, and next time the iRule would need the value it would re-read it. However,using open/close on files seems to be disabled in iRules, so I can't do it that way.

 

 

I might be able to do something like send an http request to the iRule in order to change the value, basically encode my new value in the uri, but I was wondering if anyone has other suggestions or best practices.

 

 

Thanks,

 

Scott

3 Replies

  • Hi Scott,

     

     

    In order to update the configuration running in memory to reflect a change to an external class (aka datagroup) file, you'd need to reload the configuration. So I think it would be easier to use a standard datagroup and reference that from the iRule. You could change the datagroup value from the command line using 'b class' or tmsh in 10.x or via iControl in any version.

     

     

    Aaron
  • Hi Aaron,

     

    Thanks for the reply.

     

    So do I understand you correctly that if I use a datagroup that I reference from the iRule, then it's possible to change the values in the datagroup _without_ reloading the config, and therefore without losing the existing state of my iRules? I'll look into the bigpipe class command.

     

    Thanks

     

    Scott
  • That's correct. As long as the datagroup is not an external datagroup you can change the values in it via the GUI, bigpipe, iControl or tmsh (in v10) and the change will be initialized without reloading the config.

     

     

    Aaron