Vaporup.Checkmk.psm1

function Get-CheckmkAgentData {

  <#
 
    .SYNOPSIS
      Get the output from check_mk_agent.exe
 
    .NOTES
      Author : Sven Wick <sven.wick@gmx.de>
 
  #>


  $checkmkAgentPath = "C:\Program Files (x86)\checkmk\service\check_mk_agent.exe"

  if (-Not (Test-Path $checkmkAgentPath)) {
    Write-Output "Checkmk agent executable not found. Exiting script."
    Return
  }

  $checkmkOutput = & $checkmkAgentPath test

  Write-Output $checkmkOutput

}