Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

feat: Agent reports CommandsEnabled status to server. Related to #903

rcourtman598285d3d237
diff --git a/frontend-modern/src/types/api.ts b/frontend-modern/src/types/api.ts
index ef4209a9ad..ebd909a65e 100644
--- a/frontend-modern/src/types/api.ts
+++ b/frontend-modern/src/types/api.ts
@@ -437,6 +437,7 @@ export interface Host {
lastSeen: number;
intervalSeconds?: number;
agentVersion?: string;
+ commandsEnabled?: boolean; // Whether AI command execution is enabled on this agent
tokenId?: string;
tokenName?: string;
tokenHint?: string;
diff --git a/internal/hostagent/agent.go b/internal/hostagent/agent.go
index afe0c2b8bb..1a2373fab4 100644
--- a/internal/hostagent/agent.go
+++ b/internal/hostagent/agent.go
@@ -360,6 +360,7 @@ func (a *Agent) buildReport(ctx context.Context) (agentshost.Report, error) {
IntervalSeconds: int(a.interval / time.Second),
Hostname: a.hostname,
UpdatedFrom: a.updatedFrom,
+ CommandsEnabled: a.cfg.EnableCommands,
},
Host: agentshost.HostInfo{
ID: a.machineID,
diff --git a/internal/models/models.go b/internal/models/models.go
index c076d61404..3e4211bb59 100644
--- a/internal/models/models.go
+++ b/internal/models/models.go
@@ -181,6 +181,7 @@ type Host struct {
IntervalSeconds int `json:"intervalSeconds,omitempty"`
LastSeen time.Time `json:"lastSeen"`
AgentVersion string `json:"agentVersion,omitempty"`
+ CommandsEnabled bool `json:"commandsEnabled,omitempty"` // Whether AI command execution is enabled
TokenID string `json:"tokenId,omitempty"`
TokenName string `json:"tokenName,omitempty"`
TokenHint string `json:"tokenHint,omitempty"`
diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.go
index f555290203..de403f8d5d 100644
--- a/internal/monitoring/monitor.go
+++ b/internal/monitoring/monitor.go
@@ -2178,6 +2178,7 @@ func (m *Monitor) ApplyHostReport(report agentshost.Report, tokenRecord *config.
IntervalSeconds: report.Agent.IntervalSeconds,
LastSeen: timestamp,
AgentVersion: strings.TrimSpace(report.Agent.Version),
+ CommandsEnabled: report.Agent.CommandsEnabled,
Tags: append([]string(nil), report.Tags...),
IsLegacy: isLegacyHostAgent(report.Agent.Type),
}
diff --git a/pkg/agents/host/report.go b/pkg/agents/host/report.go
index 26e6fee611..d6111f4490 100644
--- a/pkg/agents/host/report.go
+++ b/pkg/agents/host/report.go
@@ -26,6 +26,7 @@ type AgentInfo struct {
IntervalSeconds int `json:"intervalSeconds,omitempty"`
Hostname string `json:"hostname,omitempty"`
UpdatedFrom string `json:"updatedFrom,omitempty"` // Previous version if recently auto-updated
+ CommandsEnabled bool `json:"commandsEnabled,omitempty"` // Whether AI command execution is enabled
}
// HostInfo contains platform and identification details about the monitored host.