I have installed the server side on a Centos 7.X virtual machine and then I have installed the agent on a WINDOWS server where I would like to monitor my web application.
I have then created a local check. Basically, I have written a small python script and put it in the folder:
C:\ProgramData\checkmk\agent\local
(copied only on the agent virtual machine)
When I run (in the folder C:\Program Files (x86)\checkmk\service):
check_mk_agent.exe test > OUTcheck_mk_agent_test
in the latest part of the file OUTcheck_mk_agent_test i can find the “print” statement (2 wim-db-count-Dw001DataMaster counts=1 CRITICAL see below) I would have expected by the python script to be written:
it looks like I expected it. The agent called locally finds the Python interpreter and the agent called with local system as user don’t know where the Python is.
Write a small wrapper for your python script and place this wrapper inside CheckMK as your local check.
Python script inside - C:\scripts\myscript.py → wrapper.cmd with content
@echo off
c:\path to python\python.exe c:\scripts\myscript.py
place this script inside your local directory from CheckMK agent.