Replace # with - in Zabbix host names (Zabbix 7.x compatibility)

Zabbix 7.x rejects '#' in host names. Changed hostname format from
'yodeck#<id>' to 'yodeck-<id>' (e.g. yodeck-54239).
Updated SNMP col 1 value and docs for consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-17 10:21:05 +02:00
parent fc6a0c1605
commit 5db8beb847
4 changed files with 7 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ net-snmp pass_persist handler for Yodmon.
Reads player data from the SQLite database and serves it over SNMP v2c.
OID layout (base = ENTERPRISE_OID.1.1):
base.1.<yodeck_id> STRING "yodeck#<id>"
base.1.<yodeck_id> STRING "yodeck-<id>"
base.2.<yodeck_id> STRING player display name
base.3.<yodeck_id> INTEGER online (1 = online, 0 = offline)
base.4.<yodeck_id> STRING last_seen (ISO-8601 timestamp)
@@ -27,7 +27,7 @@ BASE_OID = f"{ENTERPRISE_OID}.1.1"
# (column_index, snmp_type, value_extractor)
COLUMNS = [
(1, 'STRING', lambda p: f"yodeck#{p['id']}"),
(1, 'STRING', lambda p: f"yodeck-{p['id']}"),
(2, 'STRING', lambda p: p.get('name') or ''),
(3, 'INTEGER', lambda p: str(p.get('online', 0))),
(4, 'STRING', lambda p: p.get('last_seen') or ''),