# Re-mote

Setting up Re-mote does not take much, most of the work is making sure that an SSH key is deployed to your remote machines (using pre-packaged keys in Re-pack for your managed VMs is the way to go).

# Setup

Re-mote is now a part of the re-core repo so all you need is to set re-core first:

; creating 3 vms
[re-core]λ: (create kvm defaults local c1-medium :basic "base instances" 3)

; using ssh to install sysstat
[re-core]λ: (install (hosts ip :ip) "sysstat")

Run listing summary:

   ✔ 192.168.2.28192.168.2.27192.168.2.26

# Configuration

Re-mote uses the same configuration file re-ops.edn file:

{
  :re-mote {
    :elasticsearch {
      :index "re-mote"
    }
  }
}

Most of configuration is shared with Re-core.

# SSH

Re-mote uses SSH as the base band for performing remote operations, deploying Re-gent and distributing CurveMQ keys.

In order to deploy the ssh-keys to a single machine:

$ ssh-copy-id user@host

Its recommend to use pre-baked VM images to include the keys by using Re-pack.

Another required setting is to disable to known_hosts file for the managed hosts subnet:

host 192.168.122.*
    GSSAPIAuthentication no
    UserKnownHostsFile /dev/null
    StrictHostKeyChecking no

# Publishing

Re-mote has support for publishing metrics, security scan results and reports into monitoring/database systems:

  • Collected metrics can be persisted into Elasticsearch for visualization in Kibana/Grafana.
  • Publishing metrics to Riemann in order to monitor for issues.
  • Sending reports emails when pipelines are finished with the results.

Note: check the publish (opens new window) and persist (opens new window) namespaces.

# Riemann

Riemann is configured under the re-ops.edn file:

 {
  :riemann {
   :host "127.0.0.1"
   :port 5555
   :to ""
  }
 }

Publishing to Riemann is easy as:

(defn ^{:category :stats} du-persist
    "Collect disk usage with persist (metrics collection):
       (du-persist hs)"
    [hs]
    (run> (du hs) | (enrich "du") | (persist) | (riemann)))

In the above snippet we run du on our hosts collect the result save it to Elasticsearch after which we publish the metrics to Riemann (check riemann.config (opens new window) for an example configuration).