Configuration

Configuration

Overview

Configure sysmonitoring by passing an options object when creating a MonitoringDashboard instance. This allows you to customize the server's behavior, such as which stats to display and the refresh interval.

Configuration Options

  • port (number) - The port to listen on (default: 3000).

  • showCpuLoad (boolean) - Whether to display CPU load (default: true).

  • showMemoryUsage (boolean) - Whether to display memory usage (default: true).

  • showPing (boolean) - Whether to display system latency (default: true).

  • refreshInterval (number) - Data refresh interval in milliseconds (default: 1000).

Example

const MonitoringDashboard = require('sysmonitoring');

const monitoring = new MonitoringDashboard({
  port: 4000,             // Server will listen on port 4000
  showCpuLoad: true,      // Show CPU load
  showMemoryUsage: true,  // Show memory usage
  showPing: true,         // Show system latency
  refreshInterval: 1000   // Refresh data every second
});

monitoring.startServer(); // Start the server

Last updated