70 lines
3.2 KiB
YAML
70 lines
3.2 KiB
YAML
# OPC DA Diagnozer — example configuration.
|
|
# Copy to config.yaml and adjust. Every threshold below is configurable
|
|
# (defaults live in src/opcda_diagnozer/config.py; rules in docs/SPECIFICATION.md §6).
|
|
|
|
opc:
|
|
server: "Matrikon.OPC.Simulation.1" # OPC DA server ProgID
|
|
#host: "CONTROL-HOST01" # DCOM host; omit for a local server
|
|
connect_timeout_s: 10
|
|
|
|
poll:
|
|
interval_s: 1.0 # poll cadence; keep modest (read-only tool)
|
|
timeout_ms: 5000 # beyond this the call is flagged as a hang (D7)
|
|
hard_hang_s: 120 # COM thread abandoned + rebuilt after this (§10.4)
|
|
|
|
tags:
|
|
- { name: "Channel1.Device1.Counter", expect_change: true } # D13 frozen-value detection applies
|
|
- { name: "Channel1.Device1.Level" }
|
|
|
|
# D16 device-link indicators: tags saying whether the OPC server can reach the
|
|
# device. DOWN (= DEVICE_LINK_DOWN, CRITICAL, clear-text status in the log) when
|
|
# the tag reads non-GOOD, errors, or its GOOD value is NOT in ok_values.
|
|
# ok_values defaults to [true] (boolean connected-flags); set it per system
|
|
# convention: inverted fault flags -> [false, 0], string states -> ["RUN"].
|
|
# Compared by string equality on the rendered value ("True"/"1"/"RUN").
|
|
# Do NOT also list these under tags: - they are polled automatically.
|
|
#
|
|
# tags: and devices: are each optional (devices-only monitors just the links;
|
|
# tags-only runs classic surveillance) — but both empty is rejected:
|
|
# the tool would read nothing.
|
|
devices:
|
|
- { name: "Conveyor 3", tag: "Channel1.Device3.Connected" } # ok: true/1
|
|
- { name: "Conveyor 4", tag: "Channel1.Device4.Connected", ok_values: [true, 1] }
|
|
- { name: "Pump A", tag: "Channel1.PumpA.Fault", ok_values: [false, 0] } # inverted: 0 = ok
|
|
- { name: "Boiler 2", tag: "Channel1.Boiler2.State", ok_values: ["RUN"] }
|
|
|
|
latency:
|
|
warn_ms: 1000 # D4 single-spike threshold
|
|
critical_ms: 5000 # D5 sustained-slow severity
|
|
slow_poll_streak: 5 # D5 consecutive slow polls
|
|
window_polls: 60 # D6 rolling window for the p95 trend
|
|
|
|
quality:
|
|
persistent_bad_s: 30 # D10 single tag BAD longer than this
|
|
flapping_transitions_per_window: 5 # D11 quality transitions per window...
|
|
flapping_window_s: 600 # ...within this window (10 min)
|
|
|
|
stale:
|
|
enabled: true
|
|
max_age_s: 120 # D12 device timestamp older than this while GOOD
|
|
|
|
browse:
|
|
max_depth: 32 # address-space walk guard (list-items --depth 0)
|
|
|
|
report:
|
|
heartbeat_s: 300 # D15 periodic stats snapshot
|
|
jsonl:
|
|
dir: "C:/ProgramData/OPCDA-Diagnozer/logs"
|
|
max_mb: 50 # rotate after this size
|
|
backups: 10 # rotated files kept
|
|
textlog: # human-readable anomaly log (spec 9.1)
|
|
dir: "C:/ProgramData/OPCDA-Diagnozer/logs"
|
|
max_mb: 20
|
|
backups: 10
|
|
eventlog:
|
|
source: "OPCDA-Diagnozer"
|
|
min_severity: WARN # INFO / WARN / CRITICAL
|
|
#http: # optional webhook; omit = off
|
|
# url: "https://alerts.example.com/api/opcda"
|
|
# bearer_token: "..."
|
|
# timeout_s: 5 |