File copy to agent

Started by Benjamin Dill, August 19, 2015, 03:20:31 PM

Previous topic - Next topic

Benjamin Dill

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

Victor Kirhenshtein

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

Benjamin Dill

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...

Tatjana Dubrovica

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.

Benjamin Dill

Thanks for your reply. I haven't found time yet but I will definitivly test that.