Agent Policies - File Delivery

Started by Borgso, January 31, 2020, 09:16:24 AM

Previous topic - Next topic

Borgso

Hi

Im trying to understand Agent Policies - File Delivery.
Documentation is empty on the topic: https://www.netxms.org/documentation/adminguide/agent-management.html#file-delivery-policy

Im able to create a policy and add "dir".
But when adding a file, nothing seems to happen.

Is there anything required on agent or server to get this function work?

NetXMS Server 3.1-300
NXMC 3.1.343
nxagent 3.1-300

Filipp Sudanov

#1
Currently there is a bug in Mac console, that nothing happens when trying to add a file. If you are on mac, try console on linux or windows.

For this function to work, filemgr should be enabled in agent configuration and root folder(s) should be set:

SubAgent=filemgr.nsm
[FILEMGR]
RootFolder=C:\


In current version all folders along the path should exists on the target system. In future versions agent will create folders. Files are only sent to agents, they are not deleted, when removed from policy / renamed in a policy.

If you edit agent policy, the settings will get applied (files sent to agents) the moment, when you close the list of agent policies. They should also get applied on configuration poll. And in context menu of template there's an option "Force deployment of agents policies".

Borgso

Thanks for reply, i forgot to add os.

NetXMS Server 3.1-300 - Ubuntu LTS 18.04.3
NXMC 3.1.343 - Windows 10
nxagent 3.1-300 - Ubuntu LTS 18.04.3

Tried with your suggested settings, but still can't see any files on agent or in the NXMC dir after uploading to policy.
Im able to browse Node "File manager", upload files there and delete. So settings should be ok at Agent side.

Filipp Sudanov

Can you show the screenshot of how the policy is configured - what's the root folder, are there any subfolders?

Also, if you set debug level on server and agent to 6, you could find some information in the log files. On server you can change that on the fly: nxadm -c "debug 6"
After changing debug level, you can perform "Force deployment of agents policies" and there should be something in the logs.

Borgso

#4
I have attached.
As you can see, i create "TestFileDelivery" File Delivery Policy with folder "test"
When adding/upload files from local machine, nothing seems to happen after i have found file on disk and doing the add.
I do not see any errors in netxmsd.log when adding file

When running Force deployment, this is in log:
Quote2020.02.04 13:07:32.654 *D* [client.session.0   ] Received message CMD_POLICY_FORCE_APPLY
2020.02.04 13:07:32.654 *D* [client.session.0   ] Sending message CMD_REQUEST_COMPLETED (32 bytes)
2020.02.04 13:07:32.655 *D* [                   ] Job 45842 added to queue (node=3636, type=DEPLOY_AGENT_POLICY, description="Deploy policy TestFileDelivery")
2020.02.04 13:07:32.656 *D* [                   ] Template::forceApplyPolicyChanges(001-docker11): "TestFileDelivery" policy deploy scheduled for "001-docker11" node
2020.02.04 13:07:32.656 *D* [client.session.0   ] Sending compressed message CMD_JOB_CHANGE_NOTIFICATION (128 bytes)
2020.02.04 13:07:32.656 *D* [                   ] Job 45842 started
2020.02.04 13:07:32.803 *D* [node.agent         ] Node::createAgentConnection(001-docker11 [3636]): conn=0x7fb1360bc1c0
2020.02.04 13:07:32.803 *D* [agent.policy       ] FileDeliveryPolicy::deploy(001-docker11 [3636] from TestFileDelivery/TestFileDelivery):)
2020.02.04 13:07:32.803 *D* [agent.policy       ] FileDeliveryPolicy::deploy(001-docker11 [3636] from TestFileDelivery/TestFileDelivery): preparing file list
2020.02.04 13:07:32.828 *D* [                   ] Job 45842 finished, status=COMPLETED
2020.02.04 13:07:32.828 *D* [client.session.0   ] Sending compressed message CMD_JOB_CHANGE_NOTIFICATION (144 bytes)

Same after upgrading everyting to latest

NetXMS Server 3.1.343 - Ubuntu LTS 18.04.3
NXMC 3.1.343 - Windows 10
nxagent 3.1.343 - Ubuntu LTS 18.04.3

Tursiops

I created a File Delivery Policy, set root directory to the NetXMS installation folder, tried to add a file but it just doesn't get added to the policy at all.
This is running the latest server (on Ubuntu) and console (on Windows).

The Web Console appears to work - as long as the files are roughly under 1MB in size (I could upload multiple 700kB files, but a single 1.2MB or larger files just lead to the OK button being greyed out indefinitely). Not sure if that's a Tomcat issue (though setting maxPostSize on the connector to 10MB didn't make a difference) or NetXMS simply not accepting anything larger for deployment.

I could not simply add folder name as root folder, I had to give the full path including drive letter, e.g. "C:\SomeFolder". Just entering "SomeFolder" did not work. That makes sense, as otherwise NetXMS can't possibly know which drive I might want that file on. Having said that, the Agent Policy does accept me entering "SomeFolder" as root folder and there is no hint or warning in the UI to tell me that this won't actually do anything.

Borgso

I have tested with Web NXMC and its working there.
Looks to be a bug in NXMC for Windows.

https://track.radensolutions.com/issue/NX-1745