[Check_mk (english)] check_mk local checks configuration

Sweta swetashah10 at gmail.com
Fri Feb 8 22:35:24 CET 2019


Thank you Markus,

I do have this line in check_mk.ini file which is placed in the same folder
where check_mk_agent.exe exists. Still when I perform cmk -I <winhost> and
cmk -d <winhost> - python file is not being executed.

I have made sure that my path variable in windows has an entry for
python.exe as well as have marked .py files to be executed with python by
default. Do I need to do something else for check_mk agent to correctly
execute python code?

Also, when i do cmk -d - is there a location where check_mk stores standard
error log?

Thanks,
Sweta

On Fri, Feb 8, 2019 at 12:54 AM <Markus.Bloch at telekom.de> wrote:

> Hi Sweta,
>
>
>
> if you want to change this in the windows agent, you must add following to
> the check_mk.ini of the windows agent:
>
>
>
> [global]
>
>     # Execute only files with the following extensions
>
>     *execute = bat exe vbs ps1 **py*
>
>
>
> see: https://mathias-kettner.de/checkmk_windows.html Chapter 10
> “Extending the windows agent”.
>
>
>
> Best Regards
>
>
>
> Markus
>
> *Von:* checkmk-en <checkmk-en-bounces at lists.mathias-kettner.de> *Im
> Auftrag von *Sweta
> *Gesendet:* Freitag, 8. Februar 2019 09:10 Uhr
> *An:* Dr. Maik Götte <maik.goette at uni-kassel.de>
> *Cc:* checkmk-en at lists.mathias-kettner.de
> *Betreff:* Re: [Check_mk (english)] check_mk local checks configuration
>
>
>
> Thank you for your response Maik. I have successfully gotten local checks
> to work in Linux with bash scripts and in Windows with batch scripts,
> however wanted to do some parsing logic and hence wanted to directly
> execute python/java code that outputs a single line as per local check
> syntax.
>
>
>
> I read somewhere that I need to change check_mk.ini file under
> check_mk_agent and edit global section to include execute = bat vbs py and
> also have included python.exe in path variable in environment variables in
> windows where the agent is running.
>
>
>
> Including this line in .ini file and doing inventory check does not
> execute my python file.
>
>
>
> Would you know how to configure check mk local checks to execute python
> file directly? Or is it recommended to use batch files only to give out
> output to local check?
>
>
>
> Thanks in advance!
>
>
>
> Regards,
>
> Sweta
>
>
>
> On Thu, Feb 7, 2019 at 10:26 PM Dr. Maik Götte <maik.goette at uni-kassel.de>
> wrote:
>
> Hey Sweta
>
> not sure, you're mixing things up here. Is it windows or linux you wanna
> do a local check for?
>
> In windows visual basic, cmd-line and powershell scripts (.vbs, .cmd,
> .bat, .ps1) should natively work fine for local checks; a properly
> integrated python,perl, whatsover will probably work, too if paths are
> properly set. This won't work out of the box, though.
>
> In linux bash, python, perl and probably any other stuff should work if
> the script for the local check is correct.
>
> You just have to make sure that your output line is correct according to
> the cmk howto.
>
> Regards,
>
> Maik
>
> Am 08.02.2019 um 00:17 schrieb Sweta:
>
> Hello,
>
>
>
> How can I configure check_mk_agent to directly execute python (py) files
> and not bat or sh files?
>
>
>
> I read that this configuration should be done in check_mk .ini file, but
> of agent or check_mk server? Sorry if question is very naive, would
> appreciate if links to relevant documentation is given as I could not find
> one..
>
>
>
> --
>
> Thanks & Regards,
>
> Sweta
>
>
>
> _______________________________________________
>
> checkmk-en mailing list
>
> checkmk-en at lists.mathias-kettner.de
>
> Manage your subscription or unsubscribe
>
> https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-en
>
> _______________________________________________
> checkmk-en mailing list
> checkmk-en at lists.mathias-kettner.de
> Manage your subscription or unsubscribe
> https://lists.mathias-kettner.de/cgi-bin/mailman/listinfo/checkmk-en
>
> --
>
> Thanks & Regards,
>
> Sweta
>


-- 
Thanks & Regards,
Sweta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mathias-kettner.de/pipermail/checkmk-en/attachments/20190208/0ec002d8/attachment.html>


More information about the checkmk-en mailing list