Chapter 4. noitd

Example 4.1. Basic noitd configuration struture

  <noit>
    <eventer/>
    <modules>
      <...>
        <module />
      </...>
    </modules>
    <logs>
      <...>
        <log>
          <outlet />
          <outlet />
        </log>
      </...>
    </logs>
    <listeners>
      <...>
        <listener/>
        <listener>
          <config />
          <sslconfig />
        <listener>
      </...>
    </listeners>
    <checks>
      <...>
        <check uuid="xxx" />
      </...>
    </checks>
  </noit>

4.1. Implicit Inheritance

Unless otherwise specified, elements and attributes are inherited from all ancestors. As is typical with inheritance, the youngest/deepest value overrides values of ancestors. If the value requested is a set of key/value pairs, the top-most ancestor is queried, then its child is queried, merging values, replacing conflicts and so on until the youngest/deepest node is reached.

Example 4.2. Simple implicit inheritance configuration example

      <a foo="bar">
        <config>
          <key1>val a 1</key1>
          <key2>val a 2</key2>
        </config>
        <b quux="baz">
          <config>
            <key1>val b 1</key1>
            <key3>val b 3</key3>
          </config>
          <c foo="meme" />
        </b>
      </a>

When looking at the "foo" attribute we see the following values at nodes:

a

bar

b

bar

c

meme

When looking at the "quux" attribute we see the following values at nodes:

a

(none)

b

baz

c

baz

When looking at the key/value set "config" we see the following values at nodes:

a

{ key1: "val a 1", key2: "val a 2" }

b

{ key1: "val b 1", key2: "val a 2", key3: "val b 3" }

c

{ key1: "val b 1", key2: "val a 2", key3: "val b 3" } (same as b)

This inheritance model allows for "non-repetitive" configuration approaches: "express yourself once and reuse."