4. SLB Command Line Syntax

The format of slb invocation is:

 
slb options args

where options are command line options and args are non-optional arguments.

Non-optional arguments are allowed only if either ‘--test’ or ‘--eval’ option is used in options.

4.1 Program Mode Options

--config-file=file
-c file

Use file instead of the default configuration file.

--cron

Start in cron mode. Normally slb operates in daemon mode, in which it polls the monitored servers at fixed intervals and outputs the resulting load table. In contrast, when in cron mode, slb performs a single poll, outputs the table and exits. This mode is useful when starting slb from cron, hence its name.

Notice that the function ‘d’ (derivative, see derivative) does not work in this mode.

--dry-run
-n

Run in foreground mode and print to the standard output what would have otherwise been printed to the output file. This option implies ‘--stderr --debug snmp.1 --debug output.1’. Use additional ‘--debug’ options to get even more info.

The ‘pidfile’ configuration statement is ignored in dry run mode (see pidfile).

--eval=name

Evaluate the named expression name, print its result and exit. Arguments for the expression can be supplied in the form of assignments in the command line, e.g.:

 
slb --eval=loadavg la1=10 x=18

See section eval, for a detailed discussion of the expression evaluation mode.

--test

Test mode. Instead of polling servers via SNMP, slb reads data from the file given as the first non-option argument on the command line (or from the standard input, if no arguments are given). The output is directed to the standard output, unless the ‘--output-file’ option is also given.

See section Test Mode, for a detailed information about the test mode, including a description of the input format.

Example usage:

 
slb --test input.slb
-E

Show preprocessed configuration and exit.

--lint
-t

Parse configuration file, report any errors on the standard error and exit with code 0, if the syntax is OK, and with code 1 otherwise.

4.2 Modifier Options

--foreground

Remain in the foreground. Useful for debugging purposes. See foreground statement.

--output-file=file
-o file

Direct output to file. This option overrides the ‘output-file’ setting in the configuration file. See output-file, for a discussion of file syntax.

4.3 Logging Control Options

--stderr
-e

Log to the standard error.

--syslog

Log all diagnostics to syslog.

4.4 Preprocessor Control Options

--define=name[=value]
-Dname[=value]

Define the preprocessor symbol name as having value, or empty. See section Preprocessor.

--include-directory=dir
-I dir

Add dir to include search path.

See section #include.

--no-preprocessor

Disable preprocessor. see section Preprocessor.

--preprocessor=command

Use command instead of the default preprocessor. see section Preprocessor.

4.5 Debugging Options

--debug=cat[.level]
-d cat[.level]

Sets debugging level for the category cat.

Category is a string that designates a part of the program from which the additional debugging information is requested. See below for a list of available categories.

Level is a decimal number between 0 and 100 which indicates how much additional information is required. The level of 0 means ‘no information’ and effectively disables the category in question. The level of 100 means maximum amount of information available. If level is omitted, 100 is assumed.

The following table lists categories available in version 1.0:

main

Main program block.

eval

Expression evaluation.

egram

Expression grammar and parser.

elex

Expression lexical analyzer.

snmp

SNMP request-reply loop.

output

Output driver.

cfgram

Configuration file grammar.

cflex

Configuration file lexer.

4.6 Informational Options

--config-help

Show configuration syntax summary.

--help
-h

Print a concise usage summary and exit.

--usage

Print a summary of command line syntax and exit.

--version
-v

Print the program version and exit.