NetXMS Support Forum

English Support => General Support => Topic started by: Benjamin Dill on August 19, 2015, 03:20:31 PM

Title: File copy to agent
Post by: Benjamin Dill on August 19, 2015, 03:20:31 PM
Hello,

I have a some powershell scripts which i use on windows agents by the ExternalParameter or ExternalList-options. This works quite well, but currently I copy these scripts manually to the agents data folder.
Is it possible that that agent automatically loads additional files in its data folder? I guess the configuration poll hook would be a good place for such an "action", but I can't find any info how to upload or download a file to the agent by NXSL.
Or is there even a simpler method to copy files from server to agent for some library files?

Regards,
Ben
Title: Re: File copy to agent
Post by: Victor Kirhenshtein on August 22, 2015, 05:11:21 PM
Hi,

currently there is no option to relate scripts to DCIs or templates and copy them automatically. You can simplify your task a bit by using mass file upload (upload file to server, then select container and choose "upload file" - it will upload selected server file to all agents in container). We have plans for simplifying related files distribution, but I cannot tell now in what release it will be.

Best regards,
Victor
Title: Re: File copy to agent
Post by: Benjamin Dill on August 24, 2015, 11:25:30 AM
Thanks for your answer, Victor.
Is there a NXSL function to upload files to an agent? I thought I read something some time ago but I can't find it anymore...
Title: Re: File copy to agent
Post by: Tatjana Dubrovica on August 25, 2015, 01:05:52 PM
There is no NXSL function for that. You can use nxupload command line tool or nxshell( https://wiki.netxms.org/wiki/Using_nxshell_to_automate_bulk_operations ) to automate file upload. You can generate Event from hook and on event execute action(runn server command), that executes nxupload or nxshell commands.
Title: Re: File copy to agent
Post by: Benjamin Dill on September 04, 2015, 09:42:26 AM
Thanks for your reply. I haven't found time yet but I will definitivly test that.