DX Infrastructure Management

Expand all | Collapse all

File transfer between UIM robots

Jump to Best Answer
  • 1.  File transfer between UIM robots

    Posted 08-26-2016 02:43 AM

    Hi All,

     

      Is there any possible to transfer the files between uim robots using any of the probes. Same like distrv probe.but the probe should transfer the files.



  • 2.  Re: File transfer between UIM robots

    Posted 08-26-2016 04:30 AM

    Hi Issac08

    In Dr.Nimbus there is an option to transfer files from NimBus Robot.

    Please check if this meets your needs.

    Regards.

    iulian



  • 3.  Re: File transfer between UIM robots
    Best Answer

    Posted 08-28-2016 11:27 AM

    Look into the controller callback text_file_get/put. Works pretty well - make sure that you set your buffers large enough to get the file in one chunk to keep things simple. Otherwise there is a methodology related to sessions to help deal with not getting all the work done in one issuance of the callback.

     

    -Garin



  • 4.  Re: File transfer between UIM robots

    Posted 12-12-2016 11:36 PM

    How about any binary file?  Does it support only TEXT File?   

    Such as PDF it does not transfer..   Is there any other method to transfer the file between robots?



  • 5.  Re: File transfer between UIM robots

    Posted 01-03-2017 08:38 AM

    You can take a look at the file_get_* and file_put_* callbacks, these give you the ability to transfer a binary or ascii file.

     

    file_get_start (directory, file, type, buffer_size, start_pos)

    Get the first part of a file. The controller will return the following parameters:

    ‘file_content’ string or void data area containing the first section of the file (see type below to determine type).

    ‘id’ string identifier to be used in file_get_next and file_get_end calls.

    ‘position’ current file position

    ‘read’ bytes read by this call. If this value is 0, the next call should be file_get_end.

    Parameter

    Type

    Req

    Description

    directory

    string

    yes

    The directory containing the file.

    file

    string

    yes

    The file to fetch.

    type

    string

    yes

    The file type, basically “binary”, “ascii” or “string”. Specify “binary” if the ‘raw’ contents of the file are needed. Specify “string” if you want the file contents returned as a PDS_PCH instead of PDS_VOID. This is useful for interactive checking of a file, but note that the file must be a ‘clean’ text file.

    buffer_size

    integer

    no

    Specify the size of each chunk you want to fetch from the file. The default is 1k. Note that the default buffer_size is only appropriate for small files.

    start_pos

    integer

    no

    Seek to this file position  before starting to read the file. The default is 0.

    file_get_next (id)

    Get the next part of the file. Returns the same as the file_get_first call above.

    Parameter

    Type

    Req

    Description

    id

    string

    yes

    The file identifier returned by the file_get_start call.

    file_get_end (id)

    Finish fetching from the file.

    Parameter

    Type

    Req

    Description

    id

    string

    yes

    The file identifier returned by the file_get_start call.

    file_put_start (directory,file,type,mode)

    Write the first part of a file. The file contents to be written are supplied in an additional parameter ‘file_content’ of type VOID. The following parameters are returned:

    ‘id’ – string identifier to be used with subsequent calls to file_put_next and file_put_end.

    ‘written’ – total bytes written to the file.

    Parameter

    Type

    Req

    Description

    directory

    string

    yes

    The directory that will contain the file. A directory hierarchy will be created if it does not exist.

    file

    string

    yes

    The file to store.

    type

    string

    no

    The file type, “binary” or “ascii”. “ascii” is the default if not specified.

    mode

    string

    yes

    Octal string defining the file permissions on file creation. Only significant on UNIX/Linux platforms.

    file_put_next (id)

    Write the next part of the file. The data to be added to the file are supplied in an additional parameter ‘file_content’ of type VOID. The following parameters are returned:

    ‘id’ – string identifier to be used with subsequent calls to file_put_next and file_put_end.

    ‘written’ – total bytes written to the file.

    Parameter

    Type

    Req

    Description

    id

    string

    yes

    The file identifier returned by the file_put_start call.

    file_put_end (id)

    Finish writing to the file. The controller will clean up internal information about the file identified by the ‘id’ parameter. The following parameters are returned:

    ‘id’ – string identifier to be used with subsequent calls to file_put_next and file_put_end.

    ‘written’ – total bytes written to the file.



  • 6.  Re: File transfer between UIM robots

    Posted 04-11-2018 01:39 PM

    I'm trying to understand this, but when I use the file_get commands I get an ID back. But using a file_put command it creates a different ID. So how do I get the file contents I got with the file_get commands to a different location with the file_put commands? I can run the file_get (start,next,end) commands succesfully, but I'm missing the part of how to put the content in a new file. The file_put command just creates a new empty file for me on the destination location.



  • 7.  Re: File transfer between UIM robots

    Posted 09-21-2018 09:49 AM

    Bryan,
    Where can we get the documentation for file_get_* and file_put_* commands?
    Thanks!



  • 8.  Re: File transfer between UIM robots

    Posted 09-21-2018 11:22 AM

    Bryan posted the documentation that is known to exist and that's publically available.

     

    Many of these functions require you to reverse engineer them. Often the documentation is wrong too but it's a starting point.

     

    My suggestion on this is to put together a LUA script with the callback and try it - look at the results returned. Even if the the documentation is missing or wrong, usually you can figure out what the developer was intending if you baby step through the process.

     

    If you get something working post it back so that in the future someone can find the correct information by searching here.

     

    -Garin



  • 9.  Re: File transfer between UIM robots

    Posted 09-21-2018 11:42 AM

    I will do that.
    Thanks!



  • 10.  Re: File transfer between UIM robots

    Posted 03-09-2018 01:41 PM

    I also have an issue with file transfer. I tried the following command:

     

    pu -u administrator -p password /address/to/controller text_file_get (filename) 30000 > (outputfilename)

     

    And all I get is the first coupe of line. How can I get the whole file and not just part of it.



  • 11.  Re: File transfer between UIM robots

    Posted 03-09-2018 03:42 PM

    Increase the buffer size. 



  • 12.  Re: File transfer between UIM robots

    Posted 03-09-2018 03:47 PM

    I think that you will find that pu is truncating the results regardless of the buffer size.

     

    pu will only display the first hundred or so characters before truncating the rest of the output.

     

    -Garin



  • 13.  RE: Re: File transfer between UIM robots

    Posted 08-22-2019 09:30 AM
    Hi!

    Have you got a use case example for this command?

    I'm running this on a Linux server,(our primary UIM Server):

    ./pu -u administrator -p password /DOMAIN/HUB/ROBOT/controller text_file_get test.txt 30000 > testtest.txt

    The file that outputs to the Bin directory reads?

    text_file_get failed: error

    Any ideas?


    ------------------------------
    CA - UIM administrator
    ------------------------------



  • 14.  RE: Re: File transfer between UIM robots

    Posted 08-22-2019 09:37 AM
    Does the source file exist? I think that without a path it is going to try to pull from /opt/nimsoft.



    -Garin


  • 15.  RE: Re: File transfer between UIM robots

    Posted 08-22-2019 11:03 AM
    Scratch that request, I've got it :)

    ------------------------------
    CA - UIM administrator
    ------------------------------



  • 16.  Re: File transfer between UIM robots

    Posted 03-09-2018 03:50 PM

    So there's no way to transfer the complete file...only portion of it?

     

    btw I did increase the buffer size to 300000000000000....and got the same result



  • 17.  Re: File transfer between UIM robots

    Posted 03-09-2018 04:35 PM

    You have to understand the limitation of the tools you are using.

     

    You are using pu. By design, it executes the command you ask of it - in this case it transfers the file you requested. It then posts to stdout a maximum number of characters from each of the items in the result.

     

    Because of this intentional design, pu will only display a portion of the file unless the file is shorter than that display limit.

     

    You need to use one of the other methods mentioned in order to get the full result.

     

    -Garin



  • 18.  RE: File transfer between UIM robots

    Posted 08-22-2019 09:47 AM
    Edited by Daniel Blanco 08-22-2019 09:56 AM
    How about a different approach. Create an archive package called say _FileXfer
    Edit the package and in the FILES tab attach the file you want to send. 
    Save it then just deploy to the robot you want to get this over to.

    This totally works..
    drag a controller probe into your archive and rename to _FileXfer
    Edit that package.
    Add a new Tab and call it FileToXfer
    In the Files tab r-click Add File
    Find your file and in the PATH specify where under Nimsoft\ you'd want it. I created a new folder by specifying: FileTranser
    You can remove the win32 tab as its not needed.
    Save. 

    Now when you deploy it, it does send the file(s) you specified.


  • 19.  RE: File transfer between UIM robots

    Posted 08-23-2019 04:29 AM
    Like your thinking Daniel!

    Could come in useful!

    ------------------------------
    CA - UIM administrator
    ------------------------------