Object.assign(window.search,{"doc_urls":["introduction.html#introduction","user_guide_install_docker.html#install-with-docker","user_guide_install_host.html#install-on-a-host","user_guide_install_host.html#run-as-service","core_messaging_overview.html#messaging","core_messaging_overview.html#example-of-message-flow","core_messaging_message_fields.html#message-fields"],"index":{"documentStore":{"docInfo":{"0":{"body":172,"breadcrumbs":2,"title":1},"1":{"body":167,"breadcrumbs":4,"title":2},"2":{"body":176,"breadcrumbs":4,"title":2},"3":{"body":40,"breadcrumbs":4,"title":2},"4":{"body":170,"breadcrumbs":2,"title":1},"5":{"body":0,"breadcrumbs":4,"title":3},"6":{"body":352,"breadcrumbs":4,"title":2}},"docs":{"0":{"body":"ctrl is a Command & Control (C2) backend system for Servers, IOT and Edge platforms. Simply put, control anything. Example use cases: Send shell commands or scripts to control one or many end nodes that will instruct to change config, restart services and control those systems. Gather data from both secure and not secure devices and systems, and transfer them encrypted in a secure way over the internet to your central system for handling those data. Collect metrics or monitor end nodes, then send and store the result to some ctrl instance, or pass those data's on to another ctrl instance for further handling of metrics or monitoring data. Distribute certificates. Run as a sidecar in Kubernetes for direct access to the pod. As long as you can do something as an operator in a shell on a system you can do the same with ctrl in a secure and encrypted way to one or all end nodes (servers) in one go with one single message/command. Ctrl is a system control tool that uses NATS as its messaging architecture. It allows you to send commands using request methods which are then executed on servers. If a receiving node is down, messages are retried based on the criteria set in their body. The results of these methods are delivered back to the sender. Ctrl is designed for concurrent processing and can handle multiple messages independently, even if some processes are slow or fail. It's compatible with various host OSs and systems including cloud containers, Raspberry Pi, and others with an installed operating system. Ctrl supports most major architectures such as x86, amd64, arm64, ppc64, and can run on operating systems like Linux, OSX, Windows.","breadcrumbs":"introduction » introduction","id":"0","title":"introduction"},"1":{"body":"Start up a local nats message broker docker run -p 4444:4444 nats -p 4444 Create a ctrl docker image. git clone git@github.com:postmannen/ctrl.git\ncd ctrl\ndocker build -t ctrl:test1 . Create a folder which will be the working directory for the node. This is where we keep the .env file, and can mount local host folders to folders within the container. mkdir -p testrun/readfolder\ncd testrun create a .env file cat << EOF > .env\nNODE_NAME=\"node1\"\nBROKER_ADDRESS=\"127.0.0,1:4444\"\nENABLE_DEBUG=1\nSTART_PUB_REQ_HELLO=60\nIS_CENTRAL_ERROR_LOGGER=0\nEOF Start the ctrl container. To be able to send messages into ctrl we mount the readfolder to a local directory. When we later got a messages to send we just copy it into the read folder and ctrl will pick it up and handle it. Messages can be in either YAML or JSON format. docker run --env-file=\".env\" --rm -ti -v $(PWD)/readfolder:/app/readfolder ctrl:test1 Prepare and send a message. cat << EOF > msg.yaml\n---\n- toNodes: - node1 method: REQCliCommand methodArgs: - \"bash\" - \"-c\" - | echo \"some config line\" > /etc/my-service-config.1 echo \"some config line\" > /etc/my-service-config.2 echo \"some config line\" > /etc/my-service-config.3 systemctl restart my-service replyMethod: REQNone ACKTimeout: 0\nEOF cp msg.yaml readfolder With the above message we send to ourselves since we only got 1 node running. To start up more nodes repeat the above steps, replace the node name under toNodes with new names for new nodes. NB: If more nodes share the same name the requests will be loadbalanced between them round robin.","breadcrumbs":"Inst