[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10945":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":14,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":15,"rankGlobal":8,"rankLanguage":8,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":8,"pushedAt":8,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":13,"starSnapshotCount":13,"syncStatus":14,"lastSyncTime":24,"discoverSource":25},10945,"watchup-agent-v2","tomurashigaraki22\u002Fwatchup-agent-v2","tomurashigaraki22",null,"Go",143,1,119,0,2,0.9,"MIT License",false,"main",true,[],"2026-06-12 02:02:28","# WatchUp Agent\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n[![Go Version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGo-1.19+-blue.svg)](https:\u002F\u002Fgolang.org)\n[![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPlatform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)](https:\u002F\u002Fgithub.com\u002Ftomurashigaraki22\u002Fwatchup-agent-v2)\n\nA production-grade, open source Go agent that collects comprehensive system metrics and sends them to the WatchUp monitoring platform. The agent uses secure device linking authentication and runs as a lightweight background service.\n\n## 🌟 Open Source\n\n**WatchUp Agent is fully open source** under the MIT License. You can:\n- ✅ **Audit the code** for security and functionality\n- ✅ **Customize and modify** for your specific needs  \n- ✅ **Contribute features** and improvements\n- ✅ **Self-host** against custom backends\n- ✅ **Use in enterprise** environments with confidence\n\nThe agent integrates with the **WatchUp platform** (proprietary) but can be adapted for other monitoring backends.\n\n## Features\n\n- **Device Linking Authentication**: Secure one-time setup similar to GitHub CLI\n- **Comprehensive System Metrics**: CPU, Memory, Disk, Network monitoring\n- **Extended Network Monitoring**: Active connections, port checks, latency monitoring\n- **Real-time Collection**: Configurable intervals (1s to hours)\n- **Robust Communication**: Retry logic with exponential backoff\n- **Production Ready**: Graceful shutdown, error handling, comprehensive logging\n- **Lightweight**: Minimal resource usage (\u003C5% CPU, \u003C50MB RAM)\n- **Cross-platform**: Works on Windows, Linux, macOS\n\n## Quick Start\n\n### One-Line Installation\n\n#### Linux & macOS:\n```bash\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Ftomurashigaraki22\u002Fwatchup-agent-v2\u002Fmain\u002Finstall.sh | bash\n```\n\n#### Windows (PowerShell as Administrator):\n```powershell\niwr -useb https:\u002F\u002Fraw.githubusercontent.com\u002Fwatchup\u002Fwatchup-agent\u002Fmain\u002Finstall.ps1 | iex\n```\n\n### Manual Installation\n\n#### Option 1: Download Pre-built Binary\n\n1. **Download the latest release** for your platform:\n   - Visit [Releases](https:\u002F\u002Fgithub.com\u002Ftomurashigaraki22\u002Fwatchup-agent-v2\u002Freleases\u002Flatest)\n   - Download the appropriate binary:\n     - Linux: `watchup-agent-linux-amd64`\n     - macOS: `watchup-agent-darwin-amd64` or `watchup-agent-darwin-arm64`\n     - Windows: `watchup-agent-windows-amd64.exe`\n\n2. **Install the binary**:\n   \n   **Linux\u002FmacOS**:\n   ```bash\n   # Make executable\n   chmod +x watchup-agent-*\n   \n   # Move to system path\n   sudo mv watchup-agent-* \u002Fusr\u002Flocal\u002Fbin\u002Fwatchup-agent\n   ```\n   \n   **Windows**:\n   ```powershell\n   # Move to Program Files\n   Move-Item watchup-agent-windows-amd64.exe \"C:\\Program Files\\WatchUp\\watchup-agent.exe\"\n   ```\n\n3. **Create configuration**:\n   ```bash\n   # Download example config\n   curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fwatchup\u002Fwatchup-agent\u002Fmain\u002Fconfig.example.yaml -o config.yaml\n   \n   # Edit config.yaml and set your server_id\n   nano config.yaml\n   ```\n\n4. **Run the agent**:\n   ```bash\n   .\u002Fwatchup-agent\n   ```\n\n#### Option 2: Build from Source\n\n1. **Prerequisites**:\n   - Go 1.19 or later\n   - Git\n\n2. **Clone and build**:\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Ftomurashigaraki22\u002Fwatchup-agent-v2.git\n   cd watchup-agent\n   go build -o watchup-agent cmd\u002Fagent\u002Fmain.go cmd\u002Fagent\u002Fsetup.go\n   ```\n\n3. **Run**:\n   ```bash\n   .\u002Fwatchup-agent\n   ```\n\n### First Run Setup\n\n1. **Configure server ID**:\n   - Agent will prompt for a **server ID** if not configured\n   - Enter a unique identifier for your server (e.g., \"web-prod-01\")\n   - **Important**: Server ID must be unique within your WatchUp account\n\n2. **Link to your account**:\n   - Visit the provided URL in your browser\n   - Enter the displayed code to approve the agent\n   - Agent will start collecting metrics automatically\n\n> **Note**: Each agent is linked to your WatchUp user account. The server_id you choose must be unique within your account but can be reused by other users.\n\n### Running as a Service\n\n#### Linux (systemd):\n```bash\n# Create service file\nsudo tee \u002Fetc\u002Fsystemd\u002Fsystem\u002Fwatchup-agent.service > \u002Fdev\u002Fnull \u003C\u003CEOF\n[Unit]\nDescription=WatchUp Monitoring Agent\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nExecStart=\u002Fusr\u002Flocal\u002Fbin\u002Fwatchup-agent\nWorkingDirectory=\u002Fetc\u002Fwatchup-agent\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\n# Start and enable service\nsudo systemctl daemon-reload\nsudo systemctl start watchup-agent\nsudo systemctl enable watchup-agent\n\n# Check status\nsudo systemctl status watchup-agent\n\n# View logs\nsudo journalctl -u watchup-agent -f\n```\n\n#### macOS (launchd):\n```bash\n# Create plist file\ntee ~\u002FLibrary\u002FLaunchAgents\u002Fcom.watchup.agent.plist > \u002Fdev\u002Fnull \u003C\u003CEOF\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!DOCTYPE plist PUBLIC \"-\u002F\u002FApple\u002F\u002FDTD PLIST 1.0\u002F\u002FEN\" \"http:\u002F\u002Fwww.apple.com\u002FDTDs\u002FPropertyList-1.0.dtd\">\n\u003Cplist version=\"1.0\">\n\u003Cdict>\n    \u003Ckey>Label\u003C\u002Fkey>\n    \u003Cstring>com.watchup.agent\u003C\u002Fstring>\n    \u003Ckey>ProgramArguments\u003C\u002Fkey>\n    \u003Carray>\n        \u003Cstring>\u002Fusr\u002Flocal\u002Fbin\u002Fwatchup-agent\u003C\u002Fstring>\n    \u003C\u002Farray>\n    \u003Ckey>RunAtLoad\u003C\u002Fkey>\n    \u003Ctrue\u002F>\n    \u003Ckey>KeepAlive\u003C\u002Fkey>\n    \u003Ctrue\u002F>\n\u003C\u002Fdict>\n\u003C\u002Fplist>\nEOF\n\n# Load service\nlaunchctl load ~\u002FLibrary\u002FLaunchAgents\u002Fcom.watchup.agent.plist\n\n# Check status\nlaunchctl list | grep watchup\n```\n\n#### Windows (Service):\n```powershell\n# Install as Windows Service\nsc.exe create WatchUpAgent binPath= \"C:\\Program Files\\WatchUp\\watchup-agent.exe\" start= auto\n\n# Start service\nStart-Service WatchUpAgent\n\n# Check status\nGet-Service WatchUpAgent\n```\n\n## Configuration\n\nSee `config.example.yaml` for all available options.\n\n### Core Settings:\n- `server_id`: Unique identifier for this server\n- `endpoint`: Your backend API URL\n- `interval`: How often to send metrics (e.g., \"5s\", \"1m\")\n- `metrics`: Which metrics to collect (cpu, memory, disk, network, connections)\n\n### Network Monitoring (Phase 4):\n- `ports`: List of ports to monitor for availability\n- `latency_checks`: List of hosts\u002Fservices to check latency\n\nExample:\n```yaml\n# Enable connection monitoring\nmetrics:\n  connections: true\n\n# Monitor specific ports\nports:\n  - port: 80\n    name: \"HTTP\"\n    host: \"localhost\"\n  - port: 443\n    name: \"HTTPS\"\n    host: \"mysite.com\"\n\n# Check latency to external services\nlatency_checks:\n  - host: \"8.8.8.8\"\n    name: \"Google DNS\"\n    type: \"tcp\"\n    port: 53\n  - host: \"https:\u002F\u002Fapi.myservice.com\"\n    name: \"My API\"\n    type: \"http\"\n```\n\n## Development Status\n\nThis project is being built in phases:\n\n- [x] **Phase 0**: Project Setup & Foundation ✅\n- [x] **Phase 1**: Authentication System (Device Linking) ✅\n- [x] **Phase 2**: Core Metrics Collection ✅\n- [x] **Phase 3**: Main Agent Loop & Communication ✅\n- [x] **Phase 4**: Network Monitoring (Extended) ✅\n- [ ] **Phase 5**: Process Monitoring\n- [ ] **Phase 6**: Service Monitoring\n- [ ] **Phase 7**: Deployment & Production Readiness\n- [ ] **Phase 8**: Testing & Refinement\n\n## Architecture\n\n```\nwatchup-agent\u002F\n├── cmd\u002Fagent\u002F          # Main application entry point\n├── internal\u002F\n│   ├── auth\u002F          # Authentication & device linking\n│   ├── config\u002F        # Configuration management\n│   ├── metrics\u002F       # System metrics collection\n│   └── client\u002F        # HTTP client & communication\n├── config.yaml        # Agent configuration\n└── README.md\n```\n\n## Requirements\n\n- Go 1.19 or later\n- Network access to WatchUp backend API\n- Standard user permissions (no root required for basic metrics)\n\n## 🤝 Contributing\n\nWe welcome contributions! This is an open source project under the MIT License.\n\n### Ways to Contribute:\n- **Bug Reports**: Use GitHub Issues\n- **Feature Requests**: Describe your use case in an issue\n- **Code Contributions**: Fork, create a feature branch, and submit a PR\n- **Documentation**: Help improve our docs and examples\n\n### Development Setup\n\n1. **Fork and clone**:\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FYOUR_USERNAME\u002Fwatchup-agent.git\n   cd watchup-agent\n   ```\n\n2. **Install dependencies**:\n   ```bash\n   go mod download\n   ```\n\n3. **Make your changes**:\n   ```bash\n   # Create a feature branch\n   git checkout -b feature\u002Famazing-feature\n   \n   # Make your changes\n   # ...\n   \n   # Test your changes\n   go test .\u002F...\n   ```\n\n4. **Build and test**:\n   ```bash\n   # Build for your platform\n   go build -o watchup-agent cmd\u002Fagent\u002Fmain.go cmd\u002Fagent\u002Fsetup.go\n   \n   # Test the binary\n   .\u002Fwatchup-agent\n   ```\n\n5. **Build for all platforms** (optional):\n   ```bash\n   # Linux\u002FmacOS\n   .\u002Fbuild.sh\n   \n   # Windows\n   .\\build.ps1\n   ```\n\n6. **Submit a pull request**:\n   ```bash\n   git add .\n   git commit -m \"Add amazing feature\"\n   git push origin feature\u002Famazing-feature\n   ```\n   Then open a PR on GitHub!\n\n### Testing\n\n```bash\n# Run all tests\ngo test .\u002F...\n\n# Run tests with coverage\ngo test -cover .\u002F...\n\n# Run specific package tests\ngo test .\u002Finternal\u002Fmetrics\u002F\n\n# Run with verbose output\ngo test -v .\u002F...\n```\n\n### Code Style\n\n- Follow standard Go conventions\n- Use `gofmt` to format code\n- Add comments for exported functions\n- Write tests for new functionality\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.\n\n---\n\n## 🚀 Deployment & Releases\n\n### Creating a Release\n\n1. **Tag a new version**:\n   ```bash\n   git tag v1.0.0\n   git push origin v1.0.0\n   ```\n\n2. **GitHub Actions will automatically**:\n   - Build binaries for all platforms\n   - Create a GitHub release\n   - Upload all binaries as release assets\n\n### Manual Release Build\n\n```bash\n# Build all platforms\n.\u002Fbuild.sh v1.0.0\n\n# Binaries will be in dist\u002F\nls dist\u002F\n```\n\n### Supported Platforms\n\n| OS | Architecture | Binary Name |\n|----|--------------|-------------|\n| Linux | amd64 | `watchup-agent-linux-amd64` |\n| Linux | arm64 | `watchup-agent-linux-arm64` |\n| Linux | armv7 | `watchup-agent-linux-armv7` |\n| macOS | amd64 (Intel) | `watchup-agent-darwin-amd64` |\n| macOS | arm64 (M1\u002FM2) | `watchup-agent-darwin-arm64` |\n| Windows | amd64 | `watchup-agent-windows-amd64.exe` |\n| Windows | arm64 | `watchup-agent-windows-arm64.exe` |\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🔗 Links\n\n- **WatchUp Platform**: [https:\u002F\u002Fwatchup.site](https:\u002F\u002Fwatchup.site)\n- **Documentation**: [MONITORING_CAPABILITIES.md](MONITORING_CAPABILITIES.md)\n- **Deployment Guide**: [DEPLOYMENT.md](DEPLOYMENT.md)\n- **Architecture**: [OPEN_SOURCE_ARCHITECTURE.md](OPEN_SOURCE_ARCHITECTURE.md)\n- **Contributing**: [CONTRIBUTING.md](CONTRIBUTING.md)\n- **Issues**: [GitHub Issues](https:\u002F\u002Fgithub.com\u002Ftomurashigaraki22\u002Fwatchup-agent-v2\u002Fissues)\n\n## 🙋 Support\n\n- **Documentation**: Check the docs in this repository\n- **Community**: GitHub Discussions\n- **Issues**: GitHub Issues for bugs and feature requests\n- **Security**: Email security@watchup.com for security issues\n\n---\n\n**Made with ❤️ by the WatchUp team and contributors**","WatchUp Agent 是一个生产级的开源Go语言代理程序，用于收集全面的系统指标并将其发送到WatchUp监控平台。该项目的核心功能包括设备链接认证、全面的系统和网络监控（如CPU、内存、磁盘使用情况及网络连接状态）、实时数据采集与强大的通信机制，确保在各种网络条件下都能稳定运行。此外，它还支持跨平台操作，并且资源消耗极低，非常适合需要长期稳定运行在Windows、Linux或macOS服务器上的企业级监控场景。由于其开放源代码特性，用户可以对其进行审计、自定义修改以及贡献新功能，增强了灵活性和安全性。","2026-06-11 03:30:54","CREATED_QUERY"]