The monitoring client that collects system information and reports it to the monitoring server.
- Collects static system information (CPU, memory, disk, etc.)
- Periodically collects dynamic system status (CPU usage, memory usage, etc.)
- Reports data to the monitoring server
- Caches failed reports and retries automatically
- Comprehensive error handling and logging
- Cross-platform support (Windows, Linux, macOS)
npm install
npm run build
#or use pnpm √Create a config.json file in the client directory. See config.example.json for reference:
cp config.example.json config.json
nano config.json{
"clientName": "My Server",
"clientTags": ["production", "web-server", "us-east"],
"clientPurpose": "Main production web server",
"serverUrl": "http://localhost:7788",
"reportInterval": 60000,
"minReportInterval": 10000,
"maxRetries": 3,
"cacheSize": 100
}- clientName: Custom name for this client (defaults to hostname if not specified)
- clientTags: Array of tags for categorizing this client
- clientPurpose: Description of what this client is used for
- serverUrl: URL of the monitoring server
- reportInterval: How often to report data (in milliseconds, minimum 10000)
- minReportInterval: Minimum allowed report interval (in milliseconds)
- maxRetries: Maximum number of retry attempts for failed reports
- cacheSize: Maximum number of reports to cache when offline
npm run build
npm startnpm run dev- Startup: The client loads configuration and collects static system information
- Periodic Collection: Every
reportIntervalmilliseconds, the client:- Collects current system status (CPU usage, memory usage, etc.)
- Builds a report payload with both static and dynamic data
- Sends the report to the server
- Error Handling:
- If collection fails, the error is logged and the client retries in the next cycle
- If reporting fails, the data is cached locally and retried later
- Cached reports are automatically sent when the connection is restored
The client uses structured logging with timestamps and log levels:
- INFO: Normal operations (startup, successful reports, etc.)
- WARN: Warnings (cache size limit, configuration issues, etc.)
- ERROR: Errors with full stack traces (collection failures, network errors, etc.)
npm test- Node.js 18 or higher
- Network access to the monitoring server
- Appropriate system permissions to read system information
- Check that the configuration file is valid JSON
- Ensure the server URL is correct and accessible
- Check system permissions
- Verify network connectivity to the server
- Check the server logs for errors
- Look for cached reports in the
.cachedirectory
- Increase the
reportIntervalto reduce collection frequency - Check for system-specific issues with the
systeminformationlibrary
MIT license ❤