@@ -60,6 +60,12 @@
|
||||
"historyLookbackSec": 3600
|
||||
},
|
||||
|
||||
"opcuaclient": {
|
||||
"$comment": "Optional upstream-redundancy probe (PR-14). When both primaryUrl and secondaryUrl are set, test-opcuaclient.ps1 runs an extra bridged read while both upstreams are reachable. Leave keys absent to skip the redundancy stage. The OtOpcUa server's DriverConfig for the OpcUaClient instance must already have Redundancy.Enabled=true + the same EndpointUrls list; this script doesn't reconfigure the driver.",
|
||||
"primaryUrl": "opc.tcp://localhost:50000",
|
||||
"secondaryUrl": "opc.tcp://localhost:50002"
|
||||
},
|
||||
|
||||
"phase7": {
|
||||
"$comment": "Virtual tags + scripted alarms. The VirtualNodeId must resolve to a server-side virtual tag whose script reads the modbus InputNodeId and writes VT = input * 2. The AlarmNodeId is the ConditionId of a scripted alarm that fires when VT > 100.",
|
||||
"modbusEndpoint": "127.0.0.1:5502",
|
||||
|
||||
@@ -95,7 +95,15 @@ param(
|
||||
# surfacing BadHistoryOperationUnsupported, which would indicate the filter-aware
|
||||
# ReadEventsAsync path lost wiring.
|
||||
[switch]$HistoryEvents,
|
||||
[string]$EventsNotifierNodeId = "i=2253"
|
||||
[string]$EventsNotifierNodeId = "i=2253",
|
||||
# PR-14: upstream-redundancy probe. Passes the primary + secondary URLs
|
||||
# straight through to the gateway driver via DriverConfig (operator must have
|
||||
# already wired Redundancy.Enabled=true on the OpcUaClient instance — this
|
||||
# script doesn't reconfigure the driver, only verifies the bridged read still
|
||||
# works while both upstreams are reachable, and that the driver's redundancy
|
||||
# diagnostics are non-null). Stage is no-op when neither URL is provided.
|
||||
[string]$PrimaryUrl,
|
||||
[string]$SecondaryUrl
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -183,6 +191,28 @@ if ($triggerCmd) {
|
||||
# launched with --alm. When set, the stage issues a historyread against the
|
||||
# bridged notifier ($EventsNotifierNodeId) and confirms the gateway returns
|
||||
# the request without BadHistoryOperationUnsupported.
|
||||
# Stage 6 (gated): upstream-redundancy probe (PR-14)
|
||||
#
|
||||
# When -PrimaryUrl + -SecondaryUrl are both supplied, the script runs an extra
|
||||
# read against the bridged NodeId and reports whether the gateway is still
|
||||
# answering. The actual ServiceLevel-driven failover is observable only on the
|
||||
# server side (driver-diagnostics RPC reports RedundancyFailoverCount); this
|
||||
# stage is a smoke check that the bridged path keeps round-tripping while
|
||||
# both upstreams are reachable. Drive a real failover by writing to the
|
||||
# primary's ServiceLevel node from outside this script.
|
||||
if ($PrimaryUrl -and $SecondaryUrl) {
|
||||
Write-Host "[INFO] Upstream redundancy probe: primary=$PrimaryUrl secondary=$SecondaryUrl"
|
||||
$results += Test-Probe `
|
||||
-Name "OpcUaClient redundancy bridged-read" `
|
||||
-Cmd $opcUaCli `
|
||||
-Args @("read", "-u", $OpcUaUrl, "-n", $BridgedNodeId)
|
||||
} else {
|
||||
if (-not $PrimaryUrl -and -not $SecondaryUrl) {
|
||||
Write-Host "[INFO] Upstream redundancy stage skipped (set -PrimaryUrl and -SecondaryUrl to enable)."
|
||||
$results += [pscustomobject]@{ Stage = "Upstream-redundancy"; Status = "SKIP" }
|
||||
}
|
||||
}
|
||||
|
||||
if ($HistoryEvents) {
|
||||
Write-Host "[INFO] HistoryEvents stage: issuing historyread against $EventsNotifierNodeId"
|
||||
$start = (Get-Date).ToUniversalTime().AddMinutes(-30).ToString("o")
|
||||
|
||||
Reference in New Issue
Block a user