Icinga 2 DSL Feature: Namespaces coming in v2.10

Under the hood, Icinga 2 uses many constants and reserved keywords, e.g. “Critical” or “Zone” which are respected by the config parser and compiler. This sometimes leads to errors when users accidentally override such things, or re-define their own global constants. v2.10 introduces namespaces for this purpose, and ensures that such accidents won’t happen anymore.
 

What exactly is a namespace?

Think of a defined “room” for variables, functions, etc. which can be defined similar to constants. They are isolated from other namespaces and must be loaded by the user/developer. Namespaces need a defined name – we prefer to use a capitalized string, e.g. “MyNamespace”. This helps to immediately qualify this as customization when reading the configuration.
Icinga 2 v2.10 uses namespaces which are registered and loaded by default. In order to test this, open the debug console on a test VM which has the snapshot packages installed. Fetch the keys in global namespace “globals” first.
(more…)