You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds Windows Server monitoring support to the monitoring service.
Currently all metric collection uses Linux-specific commands (/proc/stat, free -b, lsblk, etc.), which causes N/A for all metrics on Windows hosts.
Approach
Detects OS on connect by attempting to read /proc/version (Linux succeeds, Windows fails)
If Windows is detected, runs PowerShell equivalents via SSH for all metrics
Falls back to existing Linux collection path unchanged
Load Average returns null on Windows (no equivalent concept)
Windows metrics implemented
Metric
PowerShell command
CPU Usage
Get-WmiObject Win32_Processor
Memory
Get-WmiObject Win32_OperatingSystem
Uptime
gcim Win32_OperatingSystem LastBootUpTime
Disk
Get-WmiObject Win32_LogicalDisk
Processes
Get-Process
OS Info
Win32_OperatingSystem + Win32_ComputerSystem
Network
Get-NetAdapter + Get-NetAdapterStatistics
Tested on
Windows Server 2022 Datacenter (via Azure)
Ubuntu 24.04 (existing Linux monitoring unaffected)
It seems great, but please check the quality issues review from sonarqubecloud (those are small fixes as far as I'm concerned).
Also, I don't think that it should fall back to "Windows" simply because cat /proc/version fails. I think the code should try to run a WMI query and check the response before assumes "Windows".
Fixed the two issues in our Windows code (optional chain on L79, replaceAll on L285). The remaining parseInt issues on L326-358 are in the pre-existing Linux metrics code, not part of this PR's changes — happy to fix those too if you'd like, but wanted to confirm before modifying code outside the scope of this PR.
It seems great to me. I'll try to test into my environment, but we need to wait for review by other Nexterm developers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Adds Windows Server monitoring support to the monitoring service.
Currently all metric collection uses Linux-specific commands (
/proc/stat,free -b,lsblk, etc.), which causes N/A for all metrics on Windows hosts.Approach
/proc/version(Linux succeeds, Windows fails)nullon Windows (no equivalent concept)Windows metrics implemented
Get-WmiObject Win32_ProcessorGet-WmiObject Win32_OperatingSystemgcim Win32_OperatingSystem LastBootUpTimeGet-WmiObject Win32_LogicalDiskGet-ProcessWin32_OperatingSystem + Win32_ComputerSystemGet-NetAdapter + Get-NetAdapterStatisticsTested on