Repository navigation
[Bug]: monitor prints and logs ${ip} instead of the queried address on the DELAY and WAIT lines #5004
Description
Severity
severity: low
Reproducibility
reproducible: always
Regression
regression: no
Affects latest release
latest-release: yes
User story
As a game server administrator, I want monitor to print and log the address it actually queries, so that I can tell from the output and the script log which address the query used.
Script name
Any (e.g. vhserver)
Game
Any (not game specific)
Linux distro
Other
Command
command: monitor
Expected behavior
Every Querying port: <method>: <address>:<port> line printed or logged by monitor shows the address from queryips that is being queried.
Actual behavior
Three lines in fn_monitor_query show ${ip} instead of the address being queried:
- the
DELAYline printed on screen while the query delay is active, - the
DELAYline written to the script log, - the
WAITcountdown printed between query attempts.
When no IP is set, check_ip.sh sets ip="0.0.0.0", so these lines show 0.0.0.0:<port> although monitor queries 127.0.0.1, the interface IPs and the public IP. On the same run the QUERYING, OK and FAIL lines show the real address.
Further information
fn_monitor_query in lgsm/modules/command_monitor.sh loops with for queryip in "${queryips[@]}" (line 288). Lines 289, 291, 316, 318, 346, 348, 353 and 355 use ${queryip}, but lines 294, 296 and 367 still use ${ip}. These three lines were missed when the loop was added in 33eb01b (#3015, 2020).
Only the output is wrong. The query itself uses the right address.
Suggested fix: use ${queryip} instead of ${ip} on these three lines. Line 367 runs after the inner loop, where ${queryip} still holds the last address queried, the same one shown on the FAIL line just before it. I will open a PR for it.
Pre-checks
- I ran update and validate before reporting this issue.
Not applicable: this was found by reading the code on the current develop branch (f098804) and reproduced with the module function itself (see below).
Relevant log output
# fn_monitor_query from develop (f098804d), print/log helpers stubbed,
# ip="0.0.0.0", queryips=("127.0.0.1" "192.0.2.10" "203.0.113.5"), querymethod="tcp", queryport="27015"
# Query delay active (server started less than querydelay minutes ago):
log: Querying port: tcp: 127.0.0.1:27015 : 1 : QUERYING
OK Querying port: tcp: 0.0.0.0:27015 : 0/1 [DELAY]
log: Querying port: tcp: 0.0.0.0:27015 : 1 : DELAY
# All queries fail, countdown before the next attempt:
FAIL Querying port: tcp: 203.0.113.5:27015 : 0/1 [FAIL]
log: Querying port: tcp: 203.0.113.5:27015 : 1 : FAIL
FAIL Querying port: tcp: 0.0.0.0:27015 : 0/1 [WAIT]
FAIL Querying port: tcp: 0.0.0.0:27015 : 1/1 [WAIT]Steps to reproduce
- Install any game server (e.g.
vhserver) and leaveipunset (or set to0.0.0.0). - Start the server and run
./vhserver monitorwithinquerydelayminutes (1 for most servers). - The screen and
log/script/vhserver-script.logshowQuerying port: <method>: 0.0.0.0:<port> : 1 : DELAY, while theQUERYINGline just before it shows127.0.0.1:<port>. - Make the query fail (e.g. block the query port with a firewall rule) and run
./vhserver monitorafter the query delay has passed: theFAILlines show the queried addresses, theWAITcountdown shows0.0.0.0:<port>.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Done
Activity
fix(monitor): show the queried address on the DELAY and WAIT lines
fix(monitor): show the queried address on the DELAY and WAIT lines (#…
dgibbs64 commentedon Oct 10, 2026
Fixed by #5006 on
develop. It ships in v26.3.0.Release v26.3.0 (#5007)