The configuration syntax supports different types and directives.
There is an inheritance system in the templates, one template can inherit directives from a second section:
[first]
foo = bar
[second]
@first
biz = 42
This will expand to:
[first]
foo = bar
[second]
foo = bar
biz = 42
You can define key-value pairs by using the equals sign (=), there are different types the parser may evaluate:
Type Example bool yes, true, enable, no, false, disabled none none, null int 42 [1] long 42 float 42.23 regexp /test/, /test/igm list 42, /test/
| [1] | Integer always converts to long |
You can either use a semi-colon ; or a hash # to put remarks or comments in the configuration files:
; This will be ignored
# and so will this
This is the main configuration file, all file locations will be relative to this file if the given path is a relative path.
An example configuration may read:
; Load repository templates
< repository.cfg
;
; Locations
;
[paths]
; Path to logging directory
log = ../log
;
; Devices configuration
;
[devices]
; Path to model definitions
models = models/
; Path to devices definitions (will be expanded by glob)
load = device/*.cfg
;
; Repository configuration
;
[repository]
; Use mercurial template
@template:mercurial
; Path to repository
path = ../repository
These are the device configurations which specify all parameters to connect to a device. A device configuration may specify multiple devices at once. You may group devices by giving them the same prefix followed by a slash /:
[testing/router]
...
[testing/switch]
...
Defines what model file to use from the configuration.
Username to log in with (if applicable)
Password to log in with (if applicable)
Password used to switch to administrative mode (if applicable)
Hostname or IP address to connect to
Connect method(s) to be used
Boolean to indicate wether or not to switch to administrative mode if required by the model configuration. Some models can partially export their configuration without the need to switch to administrative mode.
An example:
[router]
; Name of model file in devices -> models
model = pc_zebra
; Credentials for device
username = ranrod
password = r4nr0d
; Enable/administrative password
password_enable = r4nr0d
; Device address
hostname = 192.168.213.148
; Connection methods
connect = tcp/telnet:2601
; Switch to admin user?
enable = yes