Configuration
Config file location
Section titled “Config file location”netsert looks for config in this order:
-c, --configflagnetsert.yamlin current directory~/.config/netsert/config.yaml
Full example
Section titled “Full example”# Authenticationcredentials: username: admin password: admin
# TLS settingstls: insecure: true # cert: /path/to/cert.pem # key: /path/to/key.pem # ca: /path/to/ca.pem
# Concurrencyworkers: 10 # Max concurrent gNMI connectionsparallel: 5 # Assertions per target in parallel
# Inventory groupsinventory: groups: spines: - spine1:6030 - spine2:6030 leaves: - leaf1:6030 - leaf2:6030 all: - "@spines" - "@leaves"Credentials
Section titled “Credentials”Three ways to provide credentials (priority: CLI > env > config):
Config file
Section titled “Config file”credentials: username: admin password: adminEnvironment variables
Section titled “Environment variables”export NETSERT_USERNAME=adminexport NETSERT_PASSWORD=adminnetsert run -f assertions.yamlCommand line
Section titled “Command line”netsert run -f assertions.yaml -u admin -p adminTLS settings
Section titled “TLS settings”Insecure (skip verification)
Section titled “Insecure (skip verification)”tls: insecure: trueWith certificates
Section titled “With certificates”tls: cert: /path/to/client.crt key: /path/to/client.key ca: /path/to/ca.crtConcurrency
Section titled “Concurrency”workers: 10 # Max concurrent device connectionsparallel: 5 # Assertions per device in parallelDefaults: 10 workers × 5 parallel = up to 50 concurrent operations
Override via CLI:
netsert run -f assertions.yaml -w 20 -p 10Inventory groups
Section titled “Inventory groups”Define reusable device groups (groups can reference other groups with @):
inventory: groups: dc1-spines: - dc1-spine1:6030 - dc1-spine2:6030 dc1-all: - "@dc1-spines" - "@dc1-leaves"Filter at runtime:
netsert run -f assertions.yaml -g dc1-leavesEnvironment variables
Section titled “Environment variables”| Variable | Description |
|---|---|
NETSERT_USERNAME | Default username |
NETSERT_PASSWORD | Default password |
NETSERT_CONFIG | Config file path |