Forum Discussion

Kumar_Annamalai's avatar
Kumar_Annamalai
Icon for Nimbostratus rankNimbostratus
Jul 04, 2013

how to upload iFile dynamcially so that iRule gets the runtime file for manipulation

Hi All,

 

Please help as i'm a newbie.

 

From shell script i get a runtime file generated using cronjob and stored on the local folder in \config\xyz folder\poolname_poolmember_status_txt) with the key value pairs. I need this file (poolname_poolmember_status_txt) to be uploaded automatically onto the F5 -Local Traffic iRule -iFile location either using command line or any other route so that the iRule can get the dynamica data available @ that moment.

 

Is there a way to upload the file automatically using command line so that whenever the cron job is run it automatically uploads this on the iFile location on F5.

 

 

I tried using the following command line to upload the iFile onto F5.

 

1) F5 Console/abc/> tmsh delete ltm ifile poolname_poolmember_status_txt

 

Error: 01070340:3: ifile (/Common/poolname_poolmember_status_txt) is referenced by one or more rules

 

 

I tried to delete and recreate a new one with the same file name but failed with the above error and not sure how to dereference from the iRule and delete it).

 

 

 

2) F5 Console/abc > tmsh create ltm ifile poolname_poolmember_status file-name poolname_poolmember_status.txt

 

Error : 0107134a:3: File object by name (poolname_poolmember_status.txt) is missing. (how to fix this error as well)

 

I have the poolname_poolmember_status_txt file available in the abc folder.

 

 

Please help how to recreate this ifile (filename remains same poolname_poolmember_status_txt) and upload from the command line onto the /Common partition.

 

 

Thanks in advance for your kind reply.

 

 

Thanks

 

Kumar

 

 

 

 

1 Reply

  • You can't delete and recreate an iFile that's in use. Also understand that an LTM iFile is a reference to a system level iFile. The system level (SYS) iFile is the link to the actual file. So if you're simply updating the contents of the iFile, use tmsh create/modify sys file ifile. Interesting, the source-path option of this command performs a curl request to whatever is specified. If your file is remotely accessible via HTTP, then you could probably just do this:

     

     

    tmsh modify sys file ifile [ifile-name] source-path http://10.70.0.1/poolname_poolmember_status_txt

     

     

    If the file is local (you've already uploaded it to the F5, try this:

     

     

    tmsh modify sys file ifile [ifile-name] source-path file://localhost/config/ifile/poolname_poolmember_status_txt

     

     

    - where "/config/ifile/poolname_poolmember_status_txt" is the physical path on the local system.