PyPNM-WebUI can read runtime agent configuration from:
public/config/pypnm-instances.yamlpublic/config/pypnm-instances.local.yaml
These files define:
- available
PyPNM Agentdropdown targets - the default selected agent
- per-agent request defaults for capture forms
- runtime polling and request timeout defaults
The UI does not treat .local as a full replacement file.
Current behavior from code:
- load
public/config/pypnm-instances.yamlwhen present - load
public/config/pypnm-instances.local.yamlwhen present - merge both configs by instance
id - keep unmatched instances from both files
- use the merged result as the runtime agent list
That means:
- one file can contain multiple instances
- both files can contribute instances
- a
.localinstance with the sameidas the template instance overrides that instance's fields - a
.localinstance with a newidadds another agent to the dropdown
Use:
public/config/pypnm-instances.yaml- version-controlled template
- safe example agents
- repo-wide defaults
public/config/pypnm-instances.local.yaml- machine-local additions or overrides
- lab-specific base URLs
- local modem/IP/community defaults
If neither runtime YAML file exists or both are invalid:
- the UI does not auto-write a YAML file on startup
- the UI falls back to an in-memory default config
- that fallback uses
VITE_PYPNM_API_BASE_URLfrom.env
So today:
- startup fallback exists
- automatic YAML generation does not exist
If you want a real file on disk, use one of these:
- run
./install.sh - run
pypnm-webui config-menu - create the YAML file manually
Use the interactive editor when you want to manage the local runtime config:
pypnm-webui config-menuWhat it edits:
- runtime instance entries
defaults.selected_instancedefaults.logging.level- per-instance
request_defaults
Behavior:
- the menu saves
public/config/pypnm-instances.local.yaml - if the file already exists and the content changes, the menu creates a
timestamped
.bakbackup beside it before overwrite - changes to runtime YAML are not part of Vite hot reload
- after editing runtime config, reload the browser page so the updated YAML is read
- the UI starts on
defaults.selected_instancefrom the merged config - the selected instance base URL overrides
VITE_PYPNM_API_BASE_URL VITE_PYPNM_API_BASE_URLremains the fallback only when runtime YAML is missing or invalid- use the
PyPNM Agentdropdown to switch between configured agents at runtime
Each instance can carry its own request defaults. This is where you keep values that differ by PyPNM agent, such as:
- cable modem MAC address
- cable modem IP address
- TFTP IPv4
- TFTP IPv6
- channel ids
- SNMP RW community
Those values live under each instance entry as request_defaults.
Notes:
channel_ids: []means all channels- the selected instance's
request_defaultsprefill the capture and device request forms in the UI
Use only public/config/pypnm-instances.yaml when:
- you want one default local agent in Git
- the values are sanitized and safe to commit
- no machine-local overrides are needed
Use both files when:
- the repo should keep a generic template
- your machine needs real lab URLs or modem defaults
- you want to keep those local values out of Git
Typical result:
- template contributes safe baseline agents
.localoverrides matchingids.localadds extra lab-only agents
Use only public/config/pypnm-instances.local.yaml when:
- the template file is absent
- this machine owns all runtime targets locally
- you do not want any version-controlled runtime agents
Use no runtime YAML when:
- you only need one API target
- you are doing a quick local dev run
.envis enough
In that case the UI uses its in-memory fallback instance and points it at
VITE_PYPNM_API_BASE_URL.
This is the recommended master example shape for the repo. It shows:
- one safe template instance in the version-controlled file
- two lab-specific instances in
.local - merge-by-
idbehavior
version: 1
defaults:
selected_instance: local-pypnm-agent
poll_interval_ms: 5000
request_timeout_ms: 30000
health_path: /health
logging:
level: INFO
instances:
- id: local-pypnm-agent
label: Local PyPNM Agent
base_url: http://127.0.0.1:8000
enabled: true
tags:
- lab
- local
capabilities:
- health
- analysis
- files
polling:
enabled: true
interval_ms: 5000
request_defaults:
cable_modem:
mac_address: 00:00:00:0B:1B:E0
ip_address: 10.0.0.1
tftp:
ipv4: 127.0.0.1
ipv6: ::1
capture:
channel_ids: []
snmp:
rw_community: privateversion: 1
defaults:
selected_instance: lab-local
poll_interval_ms: 5000
request_timeout_ms: 30000
health_path: /health
logging:
level: INFO
instances:
- id: lab-local
label: Lab Local
base_url: http://172.19.8.28:8000
enabled: true
tags:
- lab
- local
capabilities:
- health
- analysis
- files
polling:
enabled: true
interval_ms: 5000
request_defaults:
cable_modem:
mac_address: FC:77:7B:0B:1B:E0
ip_address: 172.19.32.53
tftp:
ipv4: 172.19.8.28
ipv6: ::1
capture:
channel_ids: []
snmp:
rw_community: private
- id: speedtest
label: Speedtest
base_url: http://172.19.8.250:8000
enabled: true
tags: []
capabilities:
- health
- analysis
polling:
enabled: true
interval_ms: 5000
request_defaults:
cable_modem:
mac_address: FC:77:7B:0B:1B:E0
ip_address: 172.19.32.53
tftp:
ipv4: 172.19.8.250
ipv6: ::1
capture:
channel_ids: []
snmp:
rw_community: privateThe dropdown will contain:
Local PyPNM AgentLab LocalSpeedtest
because the runtime loader keeps instances from both files unless they share
the same id.