[Check_mk (english)] Problems with local checks to apper in GUI in "All services"

Dear All,

I have installed CHECKMK (version 1.6).

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:

<<<>>>

<<<>>>
<<>>
2 wim-db-count-Dw001DataMaster counts=1 CRITICAL
<<>>
1575220580

which makes me feeling like the python script and the local check is not an issue.

However when I try to get the result of this local check displayed on GUI of CHECKMK, it doesn’t work.

I have defined the HOST (WINDOWS server on which is located the python script and the agent) by the GUI of CHECKMK and other services are running:

image.png

Can someone help me to get the local check displayed on the GUI with other services?

Do I need to use WATO configuration by selecting “Host & Service Parameters” -> “Monitoring Agents” -> “Deploy custom files with agent” ?

I have added a new RULE in “Deploy custom files with agent” but nothing changed.

Many thanks in advance.

Best Regards

Gianluca

Hi Gianluca,

what happens if you query your system from the monitoring server with "cmk -d "?

I think your problem is that the local system (the agent is running as this user) don’t know where a Python interpreter can be found.

As Python is not natively supported inside Windows it is better to use a small wrapper script to call Python with the script.

Best regards

Andreas

PS: new location for all CheckMK questions and requests - https://forum.checkmk.com

Hi Gianluca,

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.

Best regards

Andreas

···

Am Mo., 2. Dez. 2019 um 10:00 Uhr schrieb Gianluca Giovannetti gianluca.giovannetti@gmail.com:

Dear Andreas,

Many thanks for your reply.

Actually if I query my system from the monitoring server with “cmk -d ” I get the file OUT_check_mk, which you can find in attachment.

In this file the piece realted to <<>> is missed.

This is a different situation from what I get when I run (in the folder C:\Program Files (x86)\checkmk\service):

check_mk_agent.exe test > OUTcheck_mk_agent_test

You can find the file OUTcheck_mk_agent_test

in attachment.

Here the <<>> is there.

I’m going to write CheckMK questions and requests at https://forum.checkmk.com.

Many thanks in advance.

Best Regards

Gianluca

On Mon, Dec 2, 2019 at 8:56 AM Andreas Döhler andreas.doehler@gmail.com wrote:

Hi Gianluca,

what happens if you query your system from the monitoring server with “cmk -d ”?

I think your problem is that the local system (the agent is running as this user) don’t know where a Python interpreter can be found.

As Python is not natively supported inside Windows it is better to use a small wrapper script to call Python with the script.

Best regards

Andreas

PS: new location for all CheckMK questions and requests - https://forum.checkmk.com