Advanced Configuration - skydashnet/skydash-monitoring GitHub Wiki
Advanced Configuration
This section covers advanced features that allow for greater flexibility, multi-device management, and easy setup replication.
1. Workspace & Multi-Device System
Skydash.NET is built to handle multiple MikroTik devices from a single account through its workspace and device management system.
- Adding Multiple Devices: Users can add any number of MikroTik devices to their workspace via the Settings -> Device Management card. Each device requires its own connection details (host, user, password, port).
- Active Device Selection: Within a workspace, only one device can be "active" at a time. The active device is the one that the dashboard monitors in real-time and that the WhatsApp bot interacts with. Users can easily switch the active device from the Device Management card. This change is handled by the backend, which updates the user's active workspace configuration.
- Workspace Ownership: Each user is assigned to a workspace. The initial workspace is created automatically for a new user, but they can join other workspaces using the cloning feature.
2. Workspace Cloning
To simplify the setup process for new users or team members, Skydash.NET includes a powerful workspace cloning feature.
- Generate a Clone Code: An existing user can generate a unique, 6-character code from the user dropdown menu ("Share Configuration"). This code is temporary and expires after 10 minutes for security.
- Using the Code: A new user who has not yet configured their account will see a prompt on their dashboard to either configure a new device or enter a clone code.
- What Gets Cloned: When a valid code is used, the new user's account is immediately associated with the original user's workspace. This instantly gives them access to all the same devices, network assets, and IP pool configurations without any manual setup.
3. Data Logging System
To provide insightful daily reports, Skydash.NET runs a scheduled background task to collect historical network statistics.
- Scheduled Task: A
node-cron
job is configured inserver.js
to run thelogAllActiveWorkspaces
function every 15 minutes. - Independent Connection: This data logger operates independently from the real-time WebSocket connection manager. For each active device, it establishes a new, temporary connection, gathers the necessary data, and then immediately disconnects. This "login-logout" approach ensures that the logging process is robust and does not interfere with the live dashboard monitoring.
- Data Collected: For each active device, the logger records:
- The number of active PPPoE and Hotspot users.
- The total
rx-byte
andtx-byte
counts from the primary WAN interface. - The live
rx-bits-per-second
andtx-bits-per-second
to capture the traffic speed at that moment.
- Purpose: This historical data is stored in the
historical_stats
table and is used by thereportGenerator.js
to analyze trends, find peak activity hours, and calculate total data usage for the daily WhatsApp reports.