Add latest version metric

* Add a special handler for latest version info

* Add initial latest version items/triggers to the Zabbix template
This commit is contained in:
2025-06-03 01:58:44 -04:00
parent 39a6a9d23e
commit 180fa31d14
2 changed files with 77 additions and 0 deletions

View File

@@ -699,6 +699,18 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
if metric_name == "agent_version":
self._reply(200, VERSION)
return
elif metric_name == "latest_version_info":
try:
get_latest_version()
self._reply(
200,
json.dumps(
{"latest": latest_version, "supported": 1 if release_supported else 0}
),
)
except LatestVersionCheckError as e:
log.error("Failed to retrieve latest version information: {}".format(e))
self._reply(503, "Failed to retrieve latest version info")
# Note: parse_qs returns the values as a list. Since we always expect
# single values, just grab the first from each.