An intelligent system monitoring agent that uses NetData for metrics collection and AI to analyze alerts and recommend remediation actions.
No Node.js required - Powered by Bun
Click to watch: architecture overview, dashboard, issue tracking, AI analysis, and human-in-the-loop feedback.
curl -fsSL https://raw.githubusercontent.com/goshops-com/opsagent/main/install.sh | bashThe installer will:
- Install Bun runtime (if not present)
- Install PM2 process manager
- Install NetData for system metrics
- Clone OpsAgent to
~/.opsagent - Guide you through API key configuration
- Add
opsagentcommand to your PATH
| Requirement | Notes |
|---|---|
| OS | macOS or Linux |
| curl | Pre-installed on most systems |
| git | Pre-installed on most systems |
Everything else (Bun, PM2, NetData) is installed automatically.
After installation, start monitoring:
# Start the agent (NetData + AI analysis)
opsagent start
# Check status
opsagent status
# View logs
opsagent logs
# Open dashboards
open http://localhost:19999 # NetData metrics
open http://localhost:3001 # OpsAgent AI analysis- NetData Integration - Real-time system metrics with 1-second granularity
- AI-Powered Remediation - Uses LLMs to analyze alerts and recommend actions
- Multiple AI Providers - Choose between OpenCode or OpenRouter
- Database Monitoring - Monitor MongoDB, PostgreSQL, Redis, and more via NetData
- Issue Tracking - Groups related alerts into issues, prevents notification spam
- Permission Levels - Control what the agent can do automatically
- Discord Notifications - Alerts humans via Discord when intervention is needed
- Multi-Server Support - Deploy agents to multiple servers, monitor from a central panel
- Password Protected - Control panel secured with auto-generated password
- Safe Action Execution - Auto-executes safe actions, requires approval for risky ones
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NetData β
β (System Metrics & Alerting) β
β http://localhost:19999 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β Alerts via API
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OpsAgent β
β β’ Polls NetData for alerts β
β β’ Groups related alerts into issues β
β β’ Sends to AI for analysis β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI Agent (OpenCode or OpenRouter) β
β β’ Analyzes the problem β
β β’ Decides: auto-remediate OR notify humans OR both β
β β’ Executes safe actions automatically β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Auto Actions β β Discord β β Control Panelβ
β (safe ops) β β Notification β β (optional) β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
Monitor a single server with AI-powered analysis:
curl -fsSL https://raw.githubusercontent.com/goshops-com/opsagent/main/install.sh | bashCentral dashboard to view all agents:
OPSAGENT_MODE=panel curl -fsSL https://raw.githubusercontent.com/goshops-com/opsagent/main/install.sh | bashAgent + Control Panel on the same machine:
OPSAGENT_MODE=both curl -fsSL https://raw.githubusercontent.com/goshops-com/opsagent/main/install.sh | bashEdit ~/.opsagent/.env with your credentials:
# AI Provider (choose one)
# Option 1: OpenCode (default)
OPENCODE_API_KEY=sk-your-opencode-key
# Option 2: OpenRouter (100+ models available)
OPENROUTER_API_KEY=sk-or-v1-your-key
# Backend (choose one)
# Option 1: Connect to a Control Panel (for agents)
CONTROL_PANEL_URL=http://your-control-panel:3002
CONTROL_PANEL_PASSWORD=your-panel-password
# Option 2: Direct database (for standalone or control panel)
TURSO_DATABASE_URL=libsql://your-db.turso.io
TURSO_AUTH_TOKEN=your-turso-token
# Optional: Discord webhook for notifications
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...
# Optional: Custom server name
SERVER_NAME=web-server-1Configure the AI provider in ~/.opsagent/config/netdata.yaml:
opsagent:
# Provider: opencode or openrouter
provider: opencode
# Model (depends on provider)
# OpenCode: kimi-k2.5, gpt-4o, claude-3.5-sonnet
# OpenRouter: anthropic/claude-sonnet-4, openai/gpt-4o, google/gemini-pro-1.5
model: kimi-k2.5
# Permission level
permissionLevel: limitedopsagent start # Start the agent daemon
opsagent stop # Stop the agent daemon
opsagent restart # Restart the agent daemon
opsagent status # Show agent and NetData status
opsagent logs [n] # Show last n log lines (default: 100)
opsagent logs-live # Follow logs in real-time
opsagent run # Run in foreground (development)
# Setup
opsagent setup # Install NetData and dependencies
opsagent startup # Enable auto-start on boot
# NetData management
opsagent netdata-status # Check NetData status
opsagent netdata-logs # Show NetData logs
opsagent netdata-reload # Reload NetData alert config
opsagent help # Show all commands| Dashboard | URL | Description |
|---|---|---|
| NetData | http://localhost:19999 | Real-time system metrics |
| OpsAgent | http://localhost:3001 | AI analysis and actions |
| Control Panel | http://localhost:3002 | Multi-server overview |
For multi-server deployments, the Control Panel provides centralized monitoring:
# On the control panel server
OPSAGENT_MODE=panel curl -fsSL https://raw.githubusercontent.com/goshops-com/opsagent/main/install.sh | bash
cd ~/.opsagent && bun run panelThe installer will generate a secure password and display it. Save this password!
# On each monitored server, install the agent and provide the password
curl -fsSL https://raw.githubusercontent.com/goshops-com/opsagent/main/install.sh | bash
# When prompted, enter the Control Panel URL and passwordFeatures:
- Password protected - Web UI uses Basic Auth (username:
admin) - View all registered agents and their online/offline status
- Aggregated alerts across all servers
- AI agent analysis and recommendations
- Action history with execution status
| Action | Risk | Auto-Execute | Description |
|---|---|---|---|
notify_human |
Low | Yes | Send Discord notification |
clear_cache |
Low | Yes | Clear system caches |
log_analysis |
Low | Yes | Analyze system logs |
kill_process |
Medium | No | Kill a process (requires approval) |
restart_service |
Medium | No | Restart a service (requires approval) |
cleanup_disk |
Low | No | Clean temp files (requires approval) |
custom_command |
High | No | Run shell command (requires approval) |
OpsAgent can monitor databases through NetData collectors:
| Database | Metrics | Documentation |
|---|---|---|
| MongoDB | Connections, operations, memory, replication | Setup Guide |
| PostgreSQL | Connections, transactions, locks, replication | Setup Guide |
| Redis | Memory, clients, commands, keyspace | Setup Guide |
| MySQL | Connections, queries, replication | NetData Docs |
See docs/monitoring-databases.md for detailed setup instructions.
Configure via config/netdata.yaml:
opsagent:
permissionLevel: limited # readonly, limited, standard, full| Level | Description |
|---|---|
readonly |
Only monitor and notify, no actions |
limited |
Safe actions only (clear_cache, log_analysis) |
standard |
Medium-risk actions with limits |
full |
All actions (use with caution) |
opsagent/
βββ install.sh # One-liner installer
βββ uninstall.sh # Uninstaller
βββ bin/
β βββ opsagent # CLI command wrapper
β βββ opsagent.sh # CLI implementation
βββ src/
β βββ index.ts # Entry point (NetData integration)
β βββ config/ # Configuration loading
β βββ collector/ # NetData alert collector
β βββ alerts/ # Alert management
β βββ agent/ # AI agent interface
β βββ api/ # Backend abstraction (DB or Control Panel)
β βββ db/ # Direct database access
β βββ notifications/ # Discord integration
β βββ dashboard/ # Web UI (per-server)
βββ packages/
β βββ control-panel/ # Next.js centralized dashboard
βββ config/
β βββ netdata.yaml # NetData integration config
βββ scripts/
β βββ install-netdata.sh # NetData installer
βββ ecosystem.config.cjs # PM2 configuration
βββ package.json
# Run in foreground (development mode)
opsagent run
# Or with bun directly
bun run dev
# Run tests
bun test| Variable | Default | Description |
|---|---|---|
OPSAGENT_DIR |
~/.opsagent |
Installation directory |
OPSAGENT_MODE |
agent |
Installation mode: agent, panel, both |
OPSAGENT_NO_START |
(unset) | Set to skip starting daemon |
OPSAGENT_BRANCH |
main |
Git branch to install |
# Example: Install control panel to custom directory
OPSAGENT_DIR=/opt/opsagent OPSAGENT_MODE=panel \
curl -fsSL https://raw.githubusercontent.com/goshops-com/opsagent/main/install.sh | bashcurl -fsSL https://raw.githubusercontent.com/goshops-com/opsagent/main/uninstall.sh | bashOr manually:
opsagent stop
rm -rf ~/.opsagent
# Edit ~/.bashrc or ~/.zshrc to remove OpsAgent PATH entriesMIT