Netmond V2. Configuration syntax

This document describes syntax of Netmond configuration file.


Introduction

Great potential and flexibility of Netmond can be utilized with the special language for configuration.

Netmond configuration is a plain text file. Netmond read it at startup or when SIGHUP signal caught, interpret it according to their syntax and translate to internal machine-level structures.

On a first step special lexical analyzer built with flex utility scans configuration text. This analyzer produces language lexemes - keywords, numeric and string parameters, punctuation signs, etc.

Second, special syntax parser built with yacc (bison) utility interprets lexemes as language constructions. This parser looks for configuration directives and its parameters. Found directives are translated to internal memory structures. Netmond use these structures to construct monitoring algorithm.

So, Netmond configuration is an ordered sequence of directives. Directives consist of keywords and optional parameters separated by any combination of space chars. Space chars are blanks, tabs and carriage returns.

For in-line documentation user can write comments and remarks. Comments are not interpreted, and have no influence to Netmond work.
Preprocessor directives define some actions to make before configuration interpretation.


Syntax description agreement

Netmond configuration file syntax description in this document use following visualization conventions:

  • Keywords and special letters marked out by bold type and bright color.
  • Parameters and arguments marked out by normal type and bright color.
  • References to keywords and arguments groups marked out by italic type and bright color.
  • Keywords and arguments in square brackets [ and ] is optional.
  • Vertical line | means choice variants
  • Round brackets ( and ) used for keywords and arguments grouping.
  • Dots ... mean possible multiple repeat of last directive or parameter.

Syntax description example:

[ keyword1 | ( keyword2 parameter ) ]

Square brackets mean both keywords keyword1 and keyword2 are optional. Vertical line between keywords means variants possible: only keyword1 or only keyword2 - parameter is valid in this directive definition. If used keyword1 - no arguments expected. If used keyword2 - parameter is mandatory.


Preprocessor directives

Preprocessor commands begin with percent sign % and consist of command keyword and optional parameter. Percent sign have to be first character in string.

These commands are seen to parser only.

Only one preprocessor directive available now. It provides nesting in configuration files. This command inserts (include) other file inside current file. Maximum nesting depth is 10.

% include file
file
The including file name. If relative path used, main configuration file directory is the base.

Directives

Configuration language directive define the operations Netmond do while running. Directives consist of keywords and parameters.

Complex directives exist, with a great number of parameters. Parameters may be grouped to blocks. Block of parameters begins with opening brace { and finishes with close brace }. Blocks may be nested.
This scheme simplifies defining of complex directives and relations between them.

Ordered directives divide configuration file to semantic sections. Parsing fall if some directives used not in order.


Parameters

Parameters are detailing the way Netmond execute directives. Parameters consist of parameter keywords and values.

There are numerical and string parameters values may appear in configuration file.
String value has to be quoted with ". Quote itself has to be escaped with \ inside string parameter value.

Special characters approved to use in string values:

  • \r - carriage return.
  • \n - line feed.
  • \t - tab.
  • \" - double quote.
  • \\ - backslash.

Backslash \ in end of line can be used to divide long-long one-string value to number of strings for readability.


Comments

Comments enable to hide arbitrary text fragments from parser. It is very useful for inline documenting of configuration file.

Two comments forms allowed:

Unix-shell style comments
Comment string begins with # and propagate till and of line.
C-style comments
Like in C language, multiline comments begin from /* and propagate till */.

Nested C-style comments unsupported. Shell-style comments may appear inside C-style comments block.


See also:
Configuration directives
Configuration examples

© 1998-2002, Rinet Software