ITADN

[BUG] Proxmox integration: /version endpoint missing /api2/json/ prefix (regression from v2.3.0 partial fix)

#22623Openrichardspicer 创建于 2026-02-13
R
richardspicercommented
### Agent Version ``` Agent 7.75.3 Integration: proxmox 2.3.0 ``` ### Additional Environment Details - Platform: Proxmox VE 9.x - OS: Debian-based (Proxmox host) ### Steps to Reproduce 1. Install Datadog Agent with the Proxmox integration enabled 2. Configure a valid Proxmox API token and server URL 3. Run `datadog-agent check proxmox` 4. Observe the version check request in logs ### Expected Results The version check should request: ``` https://<proxmox_host>:8006/api2/json/version ``` ### Actual Results The version check requests: ``` https://<proxmox_host>:8006/version ``` Proxmox returns `500 Server Error: no such file '/version'`, causing a failure on every check run. ### Root Cause In `check.py` line 375, the `/version` endpoint is missing the required `/api2/json/` prefix: ```python # Line 375 - BUG response = self.http.get(f"{self.config.proxmox_server}/version") ``` All other endpoints in the same file correctly include the prefix: ```python # Line 145 - correct url = f"{self.config.proxmox_server}/api2/json/nodes/{node}/qemu/{vm_id}/agent/get-host-name" # Line 209 - correct ha_response = self.http.get(f"{self.config.proxmox_server}/api2/json/cluster/ha/status/current") # Line 226 - correct metrics_response = self.http.get(f"{self.config.proxmox_server}/api2/json/cluster/metrics/export") # Line 250 - correct resources_response = self.http.get(f"{self.config.proxmox_server}/api2/json/cluster/resources") # Line 356 - correct response = self.http.get(f"{self.config.proxmox_server}/api2/json/nodes/{node_name}/tasks", params=params) ``` ### History This bug originally existed in v2.1.0 where **all** endpoints were missing the `/api2/json/` prefix. v2.3.0 corrected 5 of 6 endpoints but missed `/version`. ### Suggested Fix Line 375 should be: ```python response = self.http.get(f"{self.config.proxmox_server}/api2/json/version") ``` This is a one-line change. Happy to submit a PR if that's preferred. ### Workaround Manual patch (must be reapplied after each agent update): ```bash CHECK_PY="/opt/datadog-agent/embedded/lib/python3.13/site-packages/datadog_checks/proxmox/check.py" sed -i 's|{self.config.proxmox_server}/version|{self.config.proxmox_server}/api2/json/version|' "$CHECK_PY" systemctl restart datadog-agent ```
0 条评论