banshee is under active development: collectors will keep changing, and a version you publish will likely need adjustments. For stable use, wait for version 1.0.0.

Windows

banshee/windows-collection/windows/ssh/

pagefile

The commit charge of a Windows against its limit, and the use of each paging file, by SSH and PowerShell

  • windows
  • ssh
  • powershell
  • pagefile
  • memory

by banshee1 installation2 versions

Paging files of a Windows, by SSH

Returns the commit charge of a Windows against its commit limit, and the size and use of each paging file. Two watches are proposed, each one set on the probe. The physical memory is the collector windows/ssh/memory.

How it works

The collector runs one PowerShell command that reads Win32_OperatingSystem and Win32_PageFileUsage:

powershell -NoProfile -NonInteractive -Command "ConvertTo-Json -Compress -Depth 4 -InputObject @{os = (Get-CimInstance Win32_OperatingSystem | Select-Object TotalVirtualMemorySize, FreeVirtualMemory); files = @(Get-CimInstance Win32_PageFileUsage | Select-Object Name, AllocatedBaseSize, CurrentUsage)}"
  • The commit limit (TotalVirtualMemorySize) is physical memory and paging files together; the commit charge is the limit less FreeVirtualMemory, both in KiB, returned in MiB. When the charge reaches the limit, Windows refuses memory to programs: it is the figure to watch, more than the filling of a paging file.
  • Each paging file is named by its path (C:\pagefile.sys); its size (AllocatedBaseSize) and its use (CurrentUsage) are in MiB. A paging file without a size yet is left out.
  • A Windows may run without a paging file: the commit charge is then returned alone.
  • Nothing is skipped at the first run.
  • An answer that is not the expected JSON, or no commit limit, stops the collector as misconfigured: never a green light without a measure.

Nothing is written to the Windows: the command only reads.

Prerequisites

  • The OpenSSH server of Windows, installed and started: - on Windows Server 2019 and later, Windows 10 (version 1809 and later) and Windows 11, where it is built in: the optional feature "OpenSSH Server" (Settings, Optional features; or Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 in PowerShell), then the service sshd started and set to start automatically; - on Windows Server 2012, 2012 R2 and 2016, Windows 8, 8.1 and the earlier Windows 10, where it is not built in: OpenSSH for Windows installed from its Microsoft release (Win32-OpenSSH), then the service sshd started and set to start automatically.
  • The default shell of the OpenSSH server left at cmd.exe, as it is installed: the collector starts PowerShell itself, and a command meant for cmd.exe would be read differently by a PowerShell default shell.
  • Windows PowerShell 3.0 or later, as shipped with every Windows from Server 2012 and Windows 8 on (3.0 on Server 2012, 4.0 on 2012 R2, 5.1 from 2016 on).
  • An account for monitoring, without administrator rights, member of the local groups "Performance Monitor Users" and "Event Log Readers", so that the performance counters and the System log are not refused to it. banshee reads it in protocol:ssh:user, with its password in protocol:ssh:password or its key in protocol:ssh:private-key (the public key then in C:\Users\<account>.ssh\authorized_keys).
  • The fingerprint of the server's host key, set in protocol:ssh:fingerprint (on the server, C:\ProgramData\ssh\ssh_host_ed25519_key.pub); not needed when the Security settings trust the first SSH fingerprint presented.
  • The Windows firewall open to the poller on TCP 22 (the rule "OpenSSH SSH Server (sshd)", created with the feature).

Outputs

NameLabelUnitPer instance
commit-limitCommit limitMiBno
committedCommit chargeMiBno
commit-percentCommit charge%no
sizePaging file sizeMiByes, per paging file
usedPaging file usedMiByes, per paging file
used-percentPaging file used%yes, per paging file

Watches

NameTitleKindDefaultsChecked by default
commit-highCommit charge highabove a threshold, on commit-percentwarning above 85 %, critical above 95 %, for 3 runsyes
pagefile-highPaging file fillingabove a threshold, on used-percentwarning above 80 %, critical above 95 %, for 3 runsno

Limits

  • A paging file managed by the system grows on demand: its use may stay high while its size follows, and the commit charge says more.
  • The commit charge and the paging files are a moment, read once per run: a peak between two runs is not seen.