Forum Discussion

C__Marbacher_57's avatar
C__Marbacher_57
Icon for Nimbostratus rankNimbostratus
Jun 09, 2007

Read a value from a file on the BIG-IP or query through SNMP

Hello,

 

 

Is it possible from an iRule to read from a file stored on the BIG-IP?

 

 

The idea is to limit the number of sessions (not tcp clients, really sessions) based on a value returned by our back-end servers.

 

 

So one possibility would be to upload to the big-ip (through scp for example) 1 file containing the maximum number of new sessions available (1 session available = 1 cookie available).

 

 

Steps go this way:

 

 

1) upload the initial number of sessions to the BIG-IP in a file

 

2) the iRule would use that file to initialize a global variable, and keep the timestamp of the file to know if it's newer or not

 

3) every time a query hits the BIG-IP, the iRule would first look at it's global variable and see if there are remaining sessions, if yes it would set the cookie, otherwise it would redirect to a sorry page

 

 

Is it also possible to share a global variable amongst many iRules. This way we could have 1 special iRule used to update the global variable with the number of remaining sessions.

 

 

Is it possible from an iRule to interrogate and SNMP server?

 

 

Thanks a lot for your answers.

 

Christophe

 

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    The short answer is "no". iRules are not allowed any file-system access for many reasons, speed and security most of all.

     

     

    The longer answer is that you can write to a class via iControl, and then have the rule re-read the values from that class. This makes it possible to programmatically update the information that a given rule is operating off of. It's just not as simple as scping up a file.

     

     

    HTH,

     

    Colin