SysMonitoring
  • Introduction
  • Installation
  • Configuration
  • Troubleshooting
  • Functions
    • startServer()
    • stopServer()
    • getCpuLoad()
    • getMemoryUsage()
    • getPing()
  • API
    • /cpu
    • /memory
    • /ping
  • Terminal Commands
    • echo
    • time
    • help
    • stats
Powered by GitBook
On this page
  • Configuration
  • Overview
  • Configuration Options
  • Example

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
PreviousInstallationNextTroubleshooting

Last updated 5 months ago