nb.cfg(5) NodeBrain Administrator Guide
Version 0.9.03 - December 2014
nb.cfg(5)

NAME | SYNOPSIS | DESCRIPTION | COMMANDS | ENVIRONMENT | DIAGNOSTICS | HISTORY | BUGS | AUTHOR | DOCUMENTATION | SEE ALSO


NAME

  nb.cfg - NodeBrain Configuration Files

SYNOPSIS

  ~/.nb/user.nb

.nb/caboodle.nb

*.nb

DESCRIPTION

  This primer describes basic NodeBrain configuration concepts. For a more complete understanding of individual commands, refer to the NodeBrain Language manual available at http://nodebrain.org.

We call a NodeBrain application directory a caboodle. NodeBrain does not dictate the structure of a caboodle, but we assume it is organized logically as a set of sub-directories containing rule files, event collector servants, alarm adapters, log files, etc. It is best to make file references relative to a caboodle's root directory so components can be easily used in multiple caboodles without modification.

When nb(1) starts, it first processes an optional user profile ~/.nb/user.nb, if found. It then processes an optional caboodle profile .nb/caboodle.nb, if found. The syntax of these files is the same as any *.nb rule file. They are only special because they are processed without explicit reference, and they are not listed when processed. Other NodeBrain *.nb rule files are processed when explicitly referenced as an executable script, a file argument, or included by another rule file.

The user profile should contain declarations and definitions you always want to be available when executing nb(1) as a given user. The caboodle profile should contain declarations and definitions you want to be available when executing nb(1) within a given caboodle. NodeBrain doesn't care how other *.nb files are constructed, organized and managed. However, we assume that a caboodle is structured in some way and perhaps supported by a set of tools that simplify rule development and maintenance.

COMMANDS

  Examples of commands you will want to understand for basic NodeBrain configuration are introduced here.

Identities are typically declared in ~/.nb/user.nb or .nb/caboodle.nb files because they are needed by multiple NodeBrain scripts in most applications.

    declare identity identity rank;

Identities are used by nodes that support communication with other applications or other instances of NodeBrain. Authentication is the responsibility of any node module providing communication with external entities. Here's an example of a "peer.client" node that uses an identity for authentication and authorization. Refer to the Peer NodeBrain Module manual for more information.

    # define a peer node

    define node node peer.client("identity@host:port");

Use the SOURCE or %INCLUDE command to include commands from another file. This helps to organize rules into logical sets for maintenance and reuse.

    # source commands from another file

    source file,[assertions];

    - or -

    %include file,[assertions];

The nb.syn(5) man page provides more information on command syntax. You should at least scan it if you plan to do anything with NodeBrain application rule files (*.nb).

ENVIRONMENT

  Some of the C functions nb calls (e.g. for loading dynamic modules) are influenced by environment variables in ways we assume you can figure out for your environment.

NB_MODULE_PATH    The NB_MODULE_PATH variable provides a platform independent way of specifying a path for locating NodeBrain modules. This path overrides the native system search paths by qualifying module names so that a search is avoided. The following example illustrates a setting that directs NodeBrain to search the current directory first and then the parent directory when loading modules (plug-ins).
    NB_MODULE_PATH="./:../" nb myscript.nb

DIAGNOSTICS

  When errors are found in configuration files, NodeBrain displays an error message. Because user and caboodle profile lines are not displayed, it may be difficult to identify the line causing the error. To work around this problem you can rename your profile and execute it under the new name.

    $ cd ~/.nb
$ mv user.nb user.nb.
$ nb user.nb. ... find the problem
$ vi user.nb. ... resolve the problem
$ nb user.nb. ... verify
$ mv user.nb. user.nb
See nb(1) for information on message format.

HISTORY

  The ~/.nb/user.nb file was introduced with NodeBrain Protocol (NBP) client authentication in March, 2000, although it was originally called private.nb and renamed in version 0.7.1. This file is now more general and no longer associated with NBP which has moved to the Peer module.

The .nb/caboodle.nb file was introduced in version 0.7.1 in July, 2008.

BUGS

  There are no known bugs in the processing of configuration files. Please report bugs to <bugs@nodebrain.org> or enter a bug report at http://nodebrain.org.

AUTHOR

  Ed Trettevik <eat@nodebrain.org>

DOCUMENTATION

  Online documentation is available at http://nodebrain.org. Manuals are also available in Texinfo format in the git repository. These documents are included in source distribution files.

SEE ALSO

  nodebrain(7), nb(1), nb.syn(5), nb.mod(7), nb.lib(3) nbkit(1), nbkit.caboodle(7)

NodeBrain 0.9.03December 2014nb.cfg(5)