travisghansen / node-red-contrib-lftp

A node-red node that supports FTP(s) and SFTP file transfer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support "site quota" or abitrary command execution

Vermatic opened this issue · comments

I have a ftp server where some stuff is automatically uploaded to.
I started to use node-red-contrib-lftp and it is working great so far.
Now I want to monitor if the ftp server is getting full.
The server I am using supports the "site quota" command.

ftp> site
(arguments to SITE command) quota
200 Available: 0 (0MiB) Limit: 30737596416 (29314MiB)
ftp> 221 Goodbye.

I was under the impression that I can just set msg.operation to "site quota", but apparently this does not work - only the already supported commands can be sent.

Two solutions come to my mind:

  1. Implement "site quota" as a native command.
  2. Implement a mechanism that allows it to pass-through arbitrary commands to the ftp server and feed back the result to node-red.

What do you think?

Glad you're finding the node useful! The command reference is actually lftp commands and not ftp commands per-se. Looking at the code and lftp doc you may be able to do the following:

msg = {};
msg.operation = "raw";
msg.payload = "command site quota";

Give it a whirl and let me know what you get.

Thank you very much, that did the trick. I now receive the following answer that I can process further:
image
Thanks for your help!