diff --git a/agent-cs/AgentWorker.cs b/agent-cs/AgentWorker.cs
index 70845fa..1f44a89 100644
--- a/agent-cs/AgentWorker.cs
+++ b/agent-cs/AgentWorker.cs
@@ -6,7 +6,7 @@ namespace ITNexusAgent;
public class AgentWorker
{
- private const string Version = "2.4.0";
+ private const string Version = "2.5.0";
private const string DataDir = @"C:\ProgramData\IT Nexus Agent";
private const string ConfigPath = @"C:\ProgramData\IT Nexus Agent\config.json";
private const string StatusPath = @"C:\ProgramData\IT Nexus Agent\status.json";
diff --git a/agent-cs/IT-Nexus-Agent.csproj b/agent-cs/IT-Nexus-Agent.csproj
index c483d07..8a9fc34 100644
--- a/agent-cs/IT-Nexus-Agent.csproj
+++ b/agent-cs/IT-Nexus-Agent.csproj
@@ -7,8 +7,8 @@
true
IT-Nexus-Agent
ITNexusAgent
- 2.3.0
- 2.3.0.0
+ 2.5.0
+ 2.5.0.0
enable
enable
false
diff --git a/agent-cs/Services/ApiService.cs b/agent-cs/Services/ApiService.cs
index 1b5e6ac..b43da5d 100644
--- a/agent-cs/Services/ApiService.cs
+++ b/agent-cs/Services/ApiService.cs
@@ -65,9 +65,9 @@ public class ApiService(string serverUrl, string agentKey)
return await resp.Content.ReadAsByteArrayAsync();
}
- public async Task DownloadSetupAsync()
+ public async Task DownloadSetupAsync(string hostname)
{
- var req = BuildRequest(HttpMethod.Get, "/api/monitoring/agent-setup");
+ var req = BuildRequest(HttpMethod.Get, $"/api/monitoring/agent-setup?hostname={Uri.EscapeDataString(hostname)}");
var resp = await _http.SendAsync(req);
resp.EnsureSuccessStatusCode();
return await resp.Content.ReadAsByteArrayAsync();
diff --git a/agent-cs/Services/CommandExecutor.cs b/agent-cs/Services/CommandExecutor.cs
index 780206d..5683408 100644
--- a/agent-cs/Services/CommandExecutor.cs
+++ b/agent-cs/Services/CommandExecutor.cs
@@ -125,7 +125,7 @@ public class CommandExecutor(ApiService api, string hostname, string dataDir, st
private async Task UpdateAgent()
{
- var bytes = await _api.DownloadSetupAsync();
+ var bytes = await _api.DownloadSetupAsync(_hostname);
if (bytes.Length < 512 * 1024) return "Download fehlgeschlagen - Installer zu klein";
var setupPath = Path.Combine(_dataDir, "IT-Nexus-Agent-Setup-Update.exe");
diff --git a/agent-cs/setup.iss b/agent-cs/setup.iss
index d85dfbb..46a273d 100644
--- a/agent-cs/setup.iss
+++ b/agent-cs/setup.iss
@@ -1,5 +1,5 @@
#define MyAppName "IT Nexus Agent"
-#define MyAppVersion "2.4.0"
+#define MyAppVersion "2.5.0"
#define MyAppPublisher "Cereda Systems GmbH"
#define MyAppURL "https://it-nexus.cereda-systems.de"
#define MyAppExeName "IT-Nexus-Agent.exe"
diff --git a/backend/src/controllers/monitoringAgent.controller.js b/backend/src/controllers/monitoringAgent.controller.js
index 73206b6..5a4b43d 100644
--- a/backend/src/controllers/monitoringAgent.controller.js
+++ b/backend/src/controllers/monitoringAgent.controller.js
@@ -212,7 +212,26 @@ const downloadSetup = asyncHandler(async (req, res) => {
const path = require('path');
const fs = require('fs');
- const version = process.env.AGENT_VERSION || '2.0.0';
+
+ // Zielversion: Gruppen-spezifisch (staged rollout) oder globaler Default â gleiche Logik wie checkin()
+ let version = process.env.AGENT_VERSION || '2.0.0';
+ const hostname = req.query.hostname;
+ if (hostname) {
+ try {
+ const db = getDatabase();
+ const agent = db.prepare('SELECT id FROM monitoring_agents WHERE hostname = ?').get(hostname);
+ const groupRow = agent && db.prepare(`
+ SELECT pg.target_agent_version
+ FROM patch_agent_groups pag
+ JOIN patch_groups pg ON pg.id = pag.group_id
+ WHERE pag.agent_id = ?
+ ORDER BY pg.sort_order ASC
+ LIMIT 1
+ `).get(agent.id);
+ if (groupRow?.target_agent_version) version = groupRow.target_agent_version;
+ } catch { /* kein Gruppe zugewiesen â global */ }
+ }
+
const setupPath = path.join(__dirname, `../../agent/IT-Nexus-Agent-Setup-v${version}.exe`);
if (!fs.existsSync(setupPath)) {
return res.status(404).json({ status: 'error', message: 'Setup nicht gefunden' });
diff --git a/frontend/src/pages/PatchManagementPage.jsx b/frontend/src/pages/PatchManagementPage.jsx
index 7ed5310..cc187c5 100644
--- a/frontend/src/pages/PatchManagementPage.jsx
+++ b/frontend/src/pages/PatchManagementPage.jsx
@@ -5,7 +5,7 @@ import { useAuth } from '../context/AuthContext';
const ANN_TYPES = { maintenance: { icon: 'đ§', label: 'Wartung', color: '#f59e0b' }, warning: { icon: 'â ī¸', label: 'Warnung', color: '#ef4444' }, info: { icon: 'âšī¸', label: 'Info', color: '#6366f1' } };
-const LATEST_AGENT_VERSION = '2.4.0';
+const LATEST_AGENT_VERSION = '2.5.0';
const SEVERITY_LABELS = { critical: 'Kritisch', important: 'Wichtig', moderate: 'Moderat', low: 'Niedrig', all: 'Alle' };
const SEVERITY_COLORS = { critical: '#EF4444', important: '#F59E0B', moderate: '#3B82F6', low: '#6B7280', all: '#0D9488' };
const COMMAND_LABELS = { check_updates: 'đ Update-Scan', install_updates: 'âŦī¸ Installation', reboot: 'đ Neustart', upgrade_win11: 'đĒ Win 11 Upgrade', update_agent: 'âŦī¸ Agent-Update' };