Check_MK Discovery Can not load Robotmk JSON data! (json.loads())

yeah i know , and the only think to make it start is ti change a rule to Use Checkmk Python, if it has been installed… but there is an error … It’s like checkmk would execute robotMK when it is using it’s own interpreter … i am not sure why it’s happening like that … I’ll be in touch about it when i run some more test e.g.
Python doesn’t have to be installed locally but Libraries can be installed using CMK python 3.8 like that :
1.open terminal CMD as admin.
2.run : c:\ProgramData\checkmk\agent\modules\python-3.venv\Scripts.\python -m pip install robotframework pyyaml mergedeep python-dateutil
3. run needed extensions :
e.g.
c:\ProgramData\checkmk\agent\modules\python-3.venv\Scripts.\python -m pip install --upgrade robotframework-seleniumlibrary
or
c:\ProgramData\checkmk\agent\modules\python-3.venv\Scripts.\python -m pip install rpaframework

in terms of seleniumlibrary it solves the problem and everything works as it should well everything there is update of the agent everything what robot is using have to be reinstalled … i have idea how to overcome that as well …but e.g. RPA needs newer python installed and 64 bit and other dependencies …
I dont think that going with the way of using build in interpreter is a good idea …
i can uninstall local python but then it’s messing up CMK agent as for updating needs build in python wrrrr… have you got any other suggestions how to make robotmk to start ??
meanwhile maybe you could share your testing set up ? what cmk you are using 2.1.xx ? what system client has ? what python version you installing to use robotframwork ?
anything really would help …

Rafal, can you ensure that you also set up the rule

Limit script types to execute

and added “py” to the list of allowed scripts?
Best regards,
Simon

YESSSSS !!!
Thank you soooo much ! that solved the problem …
I guesss when you set up rule Install Python runtime environment as :
image
It somehow tells checkMK that script allowed are not going to be python anymore :smiley: but adding py
image
definitely solved the problem … You are star ! thank you !

1 Like

Hello there, I am having a similar issue with RobotMK, at least the error message looks the same on my Check_mk Discovery Service
I have tried a lot to get it working and went through the Troubleshooting steps I found on this board, however it seems like I am either missing something or the execution of robotMK may not be possible**.

First an foremost I made sure, python is installed in the right directory (I had to reinstall)

C:\Program Files\python\python.exe
C:\Program Files\python\Lib\site-packages(All required modules are located here)

This is the Agents output:

Agent Output

<<robotmk:sep(0):cached(1707906767,600)>>
{
“runner”: {
“encoding”: “zlib_codec”,
“robotmk_version”: “v1.4.2”,
“id”: “runner”,
“execution_mode”: “agent_serial”,
“start_time”: “2024-02-13T10:36:13.701987+01:00”,
“end_time”: “2024-02-13T10:36:19.807249+01:00”,
“assigned_host”: [
“Host”,
“HOST”
],
“runtime_total”: 6.105262,
“runtime_suites”: 6.10426,
“runtime_robotmk”: 0.0010019999999997253,
“selective_run”: false,
“cache_time”: 1800,
“execution_interval”: 3600,
“is_piggyback_result”: false
},
“suites”: [
{
“id”: “seleniumtest”,
“cache_time”: 1800,
“execution_interval”: 3600,
“path”: “seleniumtest”,
“tag”: null,
“start_time”: “2024-02-13T10:36:13.701987+01:00”,
“htmllog”: null,
“xml”: “eNrtWlFz2jgQfu+v0Hg6JXmwwUBCSEN6aUqvnbZJJuQmD5cbImxhdNiST5JDaOf++61kGwwhQOF618kkD4Blab/Vt99KKztHb+6jEN0RISlnrZLrVEqIMI/7lAWtUqL6B6U3xy+OBO9xhQLCiMCKi5Z1aRr2Hddx0c7FWA04QzXHdZ09BL9GlNWqu1Y+gPgtq1qp1itVt47cymFt/9CtOQ33wEIixi2rj0NJLCS9AYlw7otVtwBYJlQRRMGAdC3EcERaVoeEhNEkUkQqGMUT4UHr6eHNheCBwNE7rPAN2PKG0fAGgw/qxvh/I4sD54zbD+0TLMcb259caCuOua8h9a0poq0moFftzhU6Pem0D1Gn3UYfzjtXFgopg1uuYWI4ynq273CYAKn6dk9gMW5ZbxMaqo9Md7vD4vjlN28geES6PFZApfz7qKybXxxhERzLsXQi7ichkb+XciedEen5ggL3pT+cUzP4PB27s3tU1sMmg/NLn3vHuSsSqQFBAYxniNzHgkgdQkQZyqSBmY8EUYlgaVfokYTKOSprKy+OIhkgRSPgBkfxQ63UnUqjAdMldyRsWR/P3p9bD+eIWuhVqF4/nJGTdnSyjk42McR7fxJPIaxQ5b6i/6q1emW/+q5y6lZeBer1URnc0ipRWCUSpV8t6+Kk07H0lVDa5Ue9Jcxfer8MpsvDUTGypzgM0RcCjPmLg6uZXxDcaXyw73fhG1THVL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KJfSV5TomvKoAhYrgEdvXygRFBkC4j0pLoaGQsb18aZr0vmUtXR2jyl2yGZPzuAiGIeJ3EXUiUIiOhGJMDwwZIuLIlJ/PRSPSNhi1w3fpDUzPa53nRqlfpjuZ6jlFbFafM1IMNforp6ZX+bFM1k+xMB/At5E1I2bH2Asl8+Z8iPz5C6W12ZIdOIbJMLddddqqS9/S2laqT4EwGsnwtaBJ5C7wWeffAR4adVERbnuVkOdIiSUOrD+MfFj3DqaF5DmO7rZ8ReYz4jUrd1SqTIJR2XbVJhr7E8FRp7e9sp1Sjx/wVYnAoF8V7ggKBTzhSQKVer4eU3/TpzRqYanCeqVRC3jrHGkCgxIJOnHjiOCRZSv1guaiMGJ7aoKs00l9GgtbQ5z6seLhUB9GO4DSBqTqPeXAGRn1PMq+7NMPRr+qUY9QUYVCrqSf3CmyscZo3m8UXLggTSi0zLgsOcHNJY/zg+CUN0RUzloLsaWrKhCgfm0nwVQZbYW/YvA8fFqwncegYf+zeBGZtO8dZ0Prnr5RmC0neJz8+JVz4nLk+YKpuH7Mf/AMn6F9k=”,
“end_time”: “2024-02-13T10:36:19.806247+01:00”,
“attempts”: 1,
“max_executions”: 1,
“rc”: 0,
“status”: “nonfatal”
}
]
}

ERROR You need to specify a browser or driver (!!! This Message does not appear, if I run robotmk.py in the commandline!!)

The Test-Case itself is working and executable

TEST CASE: SEE HOST
	${chrome_options}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys
	${BROWSER}=		Open Browser    ${SITE}    Chrome    options=${chrome_options}
	Input Text      id=input_user    ${username}
    	Input Password  id=input_pass    ${Password}
	Click Button    id=_login
	maximize Browser Window
	Click Element   id=popup_trigger_mega_menu_setup
	Click Element   link=Hosts
	Select Frame 	main
	Wait Until Page Contains    	${HOST}   timeout=10s

As you can see, I already tried using the Selenium Webdriver software in order to get the right chromedriver.

Manual Execution of the robot-file (seleniumeasy.robot):

this is what robot.yml looks like

robot.yml

Created by Check_MK Agent Bakery.

This file is managed via WATO, do not edit manually or you

lose your changes next time when you update the agent.

This file is part of Robotmk, a module for the integration of Robot

framework test results into Checkmk.

https://robotmk.org

GitHub - elabit/robotmk: Robotmk - the Robot Framework integration for Checkmk

https://robotframework.org/

ROBOTMK VERSION: v1.4.2

global:
execution_mode: agent_serial
agent_output_encoding: zlib_codec
transmit_html: false
log_level: INFO
log_rotation: 3
cache_time: 1800
execution_interval: 3600
suites:
seleniumtest:
path: seleniumtest
robot_params:
variable:
HOST: RobotMKTestHost

robot-runner.py:
Runs the Test successfully but no output on the commandline

robotmk-controller.log:

Summary

2024-02-14 11:41:53,645 RMKCtrl [ 8464] INFO: ====================
2024-02-14 11:41:53,676 RMKCtrl [ 8464] INFO: Reading suite statefiles and encoding data (zlib_codec)…
2024-02-14 11:41:53,676 RMKCtrl [ 8464] INFO: 1 Suites to check: seleniumtest
2024-02-14 11:41:53,676 RMKCtrl [ 8464] INFO: - Suite: seleniumtest
2024-02-14 11:41:53,692 RMKCtrl [ 8464] INFO: Quitting Controller, bye.
2024-02-14 11:50:59,275 RMKCtrl [ 8724] INFO: ====================
2024-02-14 11:50:59,321 RMKCtrl [ 8724] INFO: Reading suite statefiles and encoding data (zlib_codec)…
2024-02-14 11:50:59,321 RMKCtrl [ 8724] INFO: 1 Suites to check: seleniumtest
2024-02-14 11:50:59,321 RMKCtrl [ 8724] INFO: - Suite: seleniumtest
2024-02-14 11:50:59,321 RMKCtrl [ 8724] INFO: Quitting Controller, bye.
2024-02-14 11:51:04,360 RMKCtrl [ 9696] INFO: ====================
2024-02-14 11:51:04,391 RMKCtrl [ 9696] INFO: Reading suite statefiles and encoding data (zlib_codec)…
2024-02-14 11:51:04,391 RMKCtrl [ 9696] INFO: 1 Suites to check: seleniumtest
2024-02-14 11:51:04,391 RMKCtrl [ 9696] INFO: - Suite: seleniumtest
2024-02-14 11:51:04,407 RMKCtrl [ 9696] INFO: Quitting Controller, bye.

robot_runner.log

2024-02-14 11:54:26,280 RMKrunner [ 4544] INFO: ####################
2024-02-14 11:54:26,296 RMKrunner [ 4544] INFO: => Suites to start: seleniumtest
2024-02-14 11:54:26,296 RMKrunner [ 4544] INFO: ~~~~ Suite ID: seleniumtest ~~~~
2024-02-14 11:54:26,296 RMKrunner [ 4544] INFO: > Starting suite…
2024-02-14 11:54:32,158 RMKrunner [ 4544] INFO: < RC: 0
2024-02-14 11:54:32,158 RMKrunner [ 4544] INFO: Final suite RC: 0
2024-02-14 11:54:32,159 RMKrunner [ 4544] INFO: Writing results to suite statefile C:\ProgramData\checkmk\agent\log\robotmk\robotmk_seleniumtest.json
2024-02-14 11:54:32,160 RMKrunner [ 4544] INFO: … Quitting Runner, bye. —

robotmk_seleniumtest.json

{
“id”: “seleniumtest”,
“cache_time”: 1800,
“execution_interval”: 3600,
“path”: “seleniumtest”,
“tag”: null,
“start_time”: “2024-02-14T11:35:49.716674+01:00”,
“htmllog”: “C:\ProgramData\checkmk\agent\log\robotmk\robotframework_seleniumtest_1707906949_attempt-1_log.html”,
“xml”: “C:\ProgramData\checkmk\agent\log\robotmk\robotframework_seleniumtest_1707906949_attempt-1_output.xml”,
“end_time”: “2024-02-14T11:35:56.346946+01:00”,
“attempts”: 1,
“max_executions”: 1,
“rc”: 0
}

Hi Lucas,

I am irritated by the last line in the agent output.
Is that what you get on the server side?
Are you using SeleniumManager? Could this be related to this problem?
Regards,
Simon

Hey Simon, thanks for the quick reply,

I am also confused by this line, as it’s only appearing when the CMK Agent is running.
Yes, this is what I get when I download the agents output from the Site.
Yes I am using Selenium-manager.exe, however the version I have, I downloaded in November, which is two months after those guys fixed the issue

KR
Lucas

I should add that I started using selenium-manager.exe after I didn’t succed using the regular chromedriver.
I just checked the env variables, and inside PATH, there is still a valid path to chromedriver.exe

may this pollution causes the agent to misbehave?

Which way of Webdriver do you recommend? the classic way of downloading the respective webdriver version or to simply use selenium-manager.exe?

Hi Lucas,

I have found another issue, have a look at it and try the suggestions in it.

But I can’t confirm that because I don’t use Selenium at all.

With that, I would also like to answer your question: My recommendation is clearly the Browser Library. It is based on Playwright, which is a much better tool for automated web testing. I will publish a separate video course on this, please sign up for the waiting list on the Robotmk page.

I hope that this is of any help for you!
Reach out to me if there is anything unclear.

Kind regards,
Simon