Skip to content

Add HOSTTYPEURL/HOSTDESCURL templates to link DESCR fields on info page#6

Open
SoundGoof wants to merge 1 commit into
mainfrom
feature/descr-links
Open

Add HOSTTYPEURL/HOSTDESCURL templates to link DESCR fields on info page#6
SoundGoof wants to merge 1 commit into
mainfrom
feature/descr-links

Conversation

@SoundGoof

@SoundGoof SoundGoof commented Jul 9, 2026

Copy link
Copy Markdown
Member

Add HOSTTYPEURL/HOSTDESCURL templates to link DESCR fields on the info page

Problem
hosts.cfg supports a DESCR:Hosttype:Description tag (e.g. DESCR:linux:CIID1234), which is rendered on the host's info page as two plain-text rows — "Host type:" and "Description:" — with no way to make either value a clickable link (e.g. to a CMDB entry, wiki page, or inventory system).

Solution
Add two independent, optional xymonserver.cfg templates, following the existing COLUMNDOCURL/HOSTDOCURL convention (printf-style %s format string, empty/unset = no link):

example:
DESCR="linux:CIID1234"
DESCR="windows:CIID5678"
DESCR="switch:CIID2345"

HOSTTYPEURL — links the host-type part (e.g. linux)
HOSTDESCURL — links the description part (e.g. CIID1234)
Either, both, or neither can be set per installation. When unset (the default), output is byte-for-byte identical to today. Values are urlencode()d before substitution since DESCR text is free-form.

Changes
environ.c: register HOSTTYPEURL/HOSTDESCURL defaults (both empty).
svcstatus-info.c: wrap the host-type/description values in "a href" when the corresponding template is set.
xymonserver.cfg.DIST, xymonserver.cfg.5, hosts.cfg.5: document the new settings.

Testing
Clean build (lib-build common-build xymond-build web-build).
testsuite: 14/14 passed.
groff -man -z clean on both touched man pages.
Manually rendered svcstatus.cgi's info page against a scratch host with DESCR:linux:CIID1234:
Both templates set → both rows linked.
Only HOSTDESCURL set → type plain, description linked.
Neither set → identical to current plain-text output (no regression).
DESCR with no Description part (no colon) → renders correctly.

hosts.cfg's DESCR:Hosttype:Description tag is rendered as plain text on
the info page. Add two independent xymonserver.cfg templates, following
the COLUMNDOCURL/HOSTDOCURL convention, so either or both parts can be
turned into links (e.g. a CMDB lookup for the description). Unset/empty
keeps today's plain-text behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant