Skip to content

Cookbook

Ioannis Charalampidis edited this page Apr 25, 2016 · 6 revisions

1. Nested SSH Access

Let's say that you are trying to access a node that is inside a private network for which you need to SSH into a gateway first. You can achieve this by nesting two SSH accessors:

node:
  - name: protected-node
    host: protected1.mydomain.com
    access:
       - class: robob.access.ssh
         username: username-for-protected-node
         password/key: secret
       - class: robob.access.ssh
         host: gateway.mydomain.com
         username: username-for-gateway
         password/key: secret

2. Re-using a streamlet to another stream

Streamlets expose some metrics in the global scope. If you want to specialize them in a specific stream you can use the alias keyword to rename the metrics:

metrics:
  - name: node1.load
    title: CPU Load of node 1
  - name: node2.load
    title: CPU Load of node 2

stream:
  - app: myapp
    node: node1
    streamlets:
      - streamlet: uptime
        alias:
          load: node1.load      

  - app: myapp
    node: node2
    streamlets:
      - streamlet: uptime
        alias:
          load: node2.load      

3. Separating Configuration

In roBob is possible to load other configuration files, therefore it's possible to separate your configuration into different re-usable files. For example:

You can keep the application generic configuration in application.yaml:

environments:
   myapp.env:
     LD_LIBRARY_PATH: "/lib:/usr/lib:/usr/local/lib:/opt/special/lib"

parsers:
  - name: myapp.parser
    class: robob.parser.regex
    match:
      - "^.*?Bandwidth: (?P<bandwidth>[0-9\.]+).*$"
apps:
  - name: myapp
    binary: /path/to/binary
    env: myapp.env
    parser: myapp.parser

And you can use it in your main.yaml:

load:
  - application.yaml

...
streams:
  - app: myapp

Clone this wiki locally