Custom plugin not showing up as service in CheckMK

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.

The script outputs its own agent data section <<<DiskQuota>>>. Why?

If it’s a Local Check it must not output an agent data section header. And it must be placed in the local directory of the checkmk agent installation, not the plugins directory.

1 Like

Hi, i had seen the <<>> part in a different script so i figured i would try this as well. I had used the script with and without this part without seeing a difference. I had indeed placed the script in the wrong folder, somehow I’ve overlooked this completely. Thank you.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.