Skip to content

[Bug]: monitor prints and logs ${ip} instead of the queried address on the DELAY and WAIT lines #5004

Closed

Description

@borzaka

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 DELAY line printed on screen while the query delay is active,
  • the DELAY line written to the script log,
  • the WAIT countdown 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

  1. Install any game server (e.g. vhserver) and leave ip unset (or set to 0.0.0.0).
  2. Start the server and run ./vhserver monitor within querydelay minutes (1 for most servers).
  3. The screen and log/script/vhserver-script.log show Querying port: <method>: 0.0.0.0:<port> : 1 : DELAY, while the QUERYING line just before it shows 127.0.0.1:<port>.
  4. Make the query fail (e.g. block the query port with a firewall rule) and run ./vhserver monitor after the query delay has passed: the FAIL lines show the queried addresses, the WAIT countdown shows 0.0.0.0:<port>.

🤖 Generated with Claude Code

Activity

  1. added a commit that references this issue on Oct 10, 2026
    e80f307
  2. added a commit that references this issue on Oct 10, 2026
    5b099d5
  3. added this to the v26.3.0 milestone on Oct 10, 2026
  4. dgibbs64 commented on Oct 10, 2026

    @dgibbs64
    Member

    Fixed by #5006 on develop. It ships in v26.3.0.

  5. moved this from 🆕 New Issues to ✅ Done in LinuxGSM Backlogon Oct 10, 2026
  6. added a commit that references this issue on Oct 10, 2026
    e84afe7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions