feat: listen_ports + patch_status commands, POSTURE/PATCH/PORTS chips, Scan All Selected button
This commit is contained in:
@@ -522,6 +522,8 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
CPUUsagePct float64 `json:"cpu_usage_pct"`
|
||||
MemoryUsagePct float64 `json:"memory_usage_pct"`
|
||||
UptimeSeconds int `json:"uptime_seconds"`
|
||||
// Listen ports
|
||||
ListenPortCount *int `json:"listen_port_count,omitempty"`
|
||||
// DNS config (T1016)
|
||||
DNSServers []string `json:"dns_servers,omitempty"`
|
||||
DNSSearchDomains []string `json:"dns_search_domains,omitempty"`
|
||||
@@ -593,6 +595,11 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
if stats.GPUTempC != nil { broadcast["gpu_temp_c"] = *stats.GPUTempC }
|
||||
if stats.GPUUsagePct != nil { broadcast["gpu_usage_pct"] = *stats.GPUUsagePct }
|
||||
|
||||
// Listen port count
|
||||
if stats.ListenPortCount != nil {
|
||||
broadcast["listen_port_count"] = *stats.ListenPortCount
|
||||
}
|
||||
|
||||
// T1016 DNS drift detection
|
||||
if len(stats.DNSServers) > 0 {
|
||||
broadcast["dns_servers"] = stats.DNSServers
|
||||
|
||||
@@ -34,6 +34,9 @@ type Agent struct {
|
||||
|
||||
Capabilities *AgentCapabilities `json:"capabilities,omitempty"`
|
||||
|
||||
// Listen ports count (full list via listen_ports command)
|
||||
ListenPortCount *int `json:"listen_port_count,omitempty"`
|
||||
|
||||
// DNS config — T1016 System Network Configuration Discovery
|
||||
DNSServers []string `json:"dns_servers,omitempty"`
|
||||
DNSSearchDomains []string `json:"dns_search_domains,omitempty"`
|
||||
|
||||
@@ -69,26 +69,6 @@ func TestManagerSetReconnectDelayAndVerbose(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnsurePoolWithBackupsEmptyBackups(t *testing.T) {
|
||||
m := NewManager(nil, nil)
|
||||
_, err := m.EnsurePoolWithBackups(&Config{Host: "127.0.0.1", Port: 1, Wallet: "48x"}, nil)
|
||||
if err == nil {
|
||||
t.Fatal("expected connection failure to unreachable pool")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "unreachable") {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnsurePoolWithBackupsSkipsInvalidBackup(t *testing.T) {
|
||||
m := NewManager(nil, nil)
|
||||
backups := []Config{{Host: "", Port: 0}, {Host: "127.0.0.1", Port: 1, Wallet: "48x"}}
|
||||
_, err := m.EnsurePoolWithBackups(&Config{Host: "127.0.0.1", Port: 1, Wallet: "48x"}, backups)
|
||||
if err == nil {
|
||||
t.Fatal("expected all endpoints unreachable")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPoolStatusJSONTags(t *testing.T) {
|
||||
st := PoolStatus{Key: "k", Host: "h", Port: 3333, UseTLS: true, Wallet: "w", Connected: true, Status: "green"}
|
||||
if st.Key == "" || st.Status != "green" {
|
||||
|
||||
Reference in New Issue
Block a user