Request: Standalone executable for agent
Cronicle looks like a really awesome project, which is just what I need.
I'm running a docker setup, where I've gotten Cronicle to run with intelliops' image. It all works well for the HTTP executor, but I'd like to run shell commands on the host as well. I've envisioned running the master as a docker container, with a slave on the Host machine to do stuff there (maintain filesystems, run things only available to the host etc.), but without having node and npm on the host itself.
Ideally. My hosts should run the barebones needed, ie. SSH and a Docker Engine (but they'll have other resources, like storage and so on).
I've tried to make a self contained node setup, but was unable to get any output from the main.js application - it simply just exited, even with "--debug".
Would something like pkg be a thing to do?
Hello, and thanks!
Unfortunately I have absolutely no idea how to get Cronicle running on a server without Node.js. It completely relies on it. I've never looked into pkg before, so I don't know if it would work. Cronicle has a number of different "entry points", not just main.js, so I am not sure how pkg deals with that sort of thing.
I think you may be better off just having your job contain an SSH command. The SSH command could include the remote command to run on the remote server, and it would log the result as well. The only prerequisite would be to setup an SSH keypair on both sides, so there is no password prompt. So for example, using the Shell Plugin:
#!/bin/bash
ssh -i /path/to/my/ssh/private.key [email protected] "/path/to/remote/command/here.sh"
This would run the /path/to/remote/command/here.sh remote script on the myserver.com server, and log the response in the Cronicle job output. You'd just need to setup the /path/to/my/ssh/private.key SSH key using something like ssh-keygen, and place the public key on the remote server in the ~/.ssh/authorized_keys file.
Good luck, and sorry I don't have a better solution!
I wasn't suggesting ditching Node.js, obviously that would be basically rewriting the app. I've ended up installing Node on my server directly, and from then on, Cronicle works great :).
If anything. I'd suggest starting by splitting the project a bit, so that the slave doesn't have the UI or any other fancyness - it's purely a daemon that can run commands from a remote master. Then one could consider using something like pkg, so that the end result is:
- Cronicle master run in docker (or wherever)
- Cronicle slave, run as single executable on N servers, connected to by Cronicle master
Ah, I see what you mean. Yeah, the current design is such that any Cronicle server could potentially become the master, if you just changed the group rules around in the UI. It also simplifies the installation process, because you just have one single install command to run.
I really don't want to split up the repository into separate projects, but maybe I could have a separate "slave install" script that only installed certain directories out of the tarball. I'll mark this as an enhancement and come back to it when I am working on the next major release.
Thanks!
I have exact the same need for this feature. Also using ssh as a compromised method, can I send the log result as a parameter to webhookd, so I can display it on some chatting app?
If there is some kind of command could send some standalone executable by remote server could be a good option too, the benefit could be add remote server from web page, and monitor task exectution. (If I do this from ssh within a task, cpu and memory usage is only the ssh process instead of the real task)