CMK Version 2.1.0 RAW
Windows Server 2019
Custom plugin to check the usage of Disk Quota’s is not reporting in CheckMK.
Output of cmk --debug -vvn [hostname]:
<<>> / Transition NOOPParser → HostSectionParser
It is a ps1 script created based on the following forum post: Local check for Quota usage on Windows servers (Checkmk Agent 1.5.x) - #2 by andreas-doehler
The script:
Write-Host "<<<DiskQuota>>>"
$Quotas = @(Get-FsrmQuota | Select-Object Path, Size, Usage)
foreach ($Quota in $Quotas) {
$Size = ($Quota.Size / 1gb)
$Usage = [math]::Round($Quota.Usage / 1gb, 1)
$Path = ($Quota.Path)
$Percent = ($Usage / $Size * 100)
Write-Host("P Disk_Quota_" + $Path + " Usage=" + "{0:N0}" -f $Percent + ";85;95|Size=" + "{0:N0}" -f $Size + " Used: $Percent%, $Usage GB")
}
It is placed in %programdata%\checkmk\agent\plugins\DiskQuota.ps1
I’ve checked the yml files and this location is included.
I’ve read something in a different forum post that i need to create a Check in CheckMK but I’m not sure how to do this. I did find the following document: Local checks
But I couldn’t really find what I’m doing wrong.
I executed the following command: cmk -IIv --detect-plugins=local mycmkserver
Success - Found no services.
On the windows server i executed the following command:
C:\program Files (x86)\checkmk\service\check_mk_agent.exe test
Which did show me the expected output of the ps1 script.