Skip to content

Configuration

netsert looks for config in this order:

  1. -c, --config flag
  2. netsert.yaml in current directory
  3. ~/.config/netsert/config.yaml
netsert.yaml
# Authentication
credentials:
username: admin
password: admin
# TLS settings
tls:
insecure: true
# cert: /path/to/cert.pem
# key: /path/to/key.pem
# ca: /path/to/ca.pem
# Concurrency
workers: 10 # Max concurrent gNMI connections
parallel: 5 # Assertions per target in parallel
# Inventory groups
inventory:
groups:
spines:
- spine1:6030
- spine2:6030
leaves:
- leaf1:6030
- leaf2:6030
all:
- "@spines"
- "@leaves"

Three ways to provide credentials (priority: CLI > env > config):

credentials:
username: admin
password: admin
Terminal window
export NETSERT_USERNAME=admin
export NETSERT_PASSWORD=admin
netsert run -f assertions.yaml
Terminal window
netsert run -f assertions.yaml -u admin -p admin
tls:
insecure: true
tls:
cert: /path/to/client.crt
key: /path/to/client.key
ca: /path/to/ca.crt
workers: 10 # Max concurrent device connections
parallel: 5 # Assertions per device in parallel

Defaults: 10 workers × 5 parallel = up to 50 concurrent operations

Override via CLI:

Terminal window
netsert run -f assertions.yaml -w 20 -p 10

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:

Terminal window
netsert run -f assertions.yaml -g dc1-leaves
VariableDescription
NETSERT_USERNAMEDefault username
NETSERT_PASSWORDDefault password
NETSERT_CONFIGConfig file path