- Add database migration 006 for agent_key, agent_installed, agent_install_path, agent_last_seen_at columns - Add Server model methods: findByAgentKey, generateAgentKey, regenerateAgentKey, updateAgentLastSeen, setAgentInstalled - Auto-generate agent_key on server creation - Create AgentService for SSH-based install/uninstall of remote agent - Create bin/agent.sh - bash agent script for remote servers - Create install/agent-install.sh and install/agent-uninstall.sh - Create install/servermanager-agent.service systemd unit - Add POST /api/metrics/push endpoint (auth via agent_key) - Add web routes for agent install/uninstall/regenerate-key - Add agent status section to server detail view with install/uninstall modals - Make MonitoringService::saveMetrics() public for reuse
10 lines
472 B
SQL
10 lines
472 B
SQL
ALTER TABLE servers
|
|
ADD COLUMN agent_key VARCHAR(64) DEFAULT NULL AFTER ssh_key,
|
|
ADD COLUMN agent_installed TINYINT(1) NOT NULL DEFAULT 0 AFTER agent_key,
|
|
ADD COLUMN agent_install_path VARCHAR(255) DEFAULT NULL AFTER agent_installed,
|
|
ADD COLUMN agent_last_seen_at DATETIME DEFAULT NULL AFTER agent_install_path;
|
|
|
|
CREATE UNIQUE INDEX idx_servers_agent_key ON servers(agent_key);
|
|
|
|
UPDATE servers SET agent_key = LOWER(HEX(RANDOM_BYTES(32))) WHERE agent_key IS NULL;
|