Integration options with CheckMK

It’s not clear to me yet what options are available to integrate RF with CheckMK. There is RobotMK which integrates RF into CheckMK to enable synthetic monitoring. What I’m looking for is options for integrating a CheckMK server in the sense of a RF remote server (comparable to how remote server libraries are used with RF) instead however. In general CheckMK provides RESTful APIs which in general can be used for automation for example. It seems like it’s not possible to configure checks. Is it possible to access check results via the API (already)? @simonm

Hello Florian, I see several questions here :slight_smile: Let’s proceed in order :

With the help of Robotmk you can run RF tests periodically on dedicated testnodes (Win/Linux) and integrate the tests into Checkmk.
From version 2.4 onwards, not only tests, but also any keywords can be covered and monitored at runtime.

I had actually never considered the integration of RemoteServer, which could ‘deliver’ libraries to test nodes.
…the use case sounds interesting, but I wonder what problem we could really solve with it.

Imho, a client-side installation cannot be completely dispensed with that approach, because even if pure Python libraries are loaded via remote lib/HTTP, this still requires a) an existing Python installation and b) in the case of the browser library a local installation of NodeJS.

Robotmk as of today can build isolated runtime environments under the hood for each suite to be executed - including Python, all libraries and NodeJS. (Currently with RCC, but the stack will be replaced as there is no longer a maintainer for RCC).
(Even the offline installation of environments on hosts without Internet is possible.)
This means: zero manual installation effort on the client side.

I am only explaining this in such detail so that the resulting added value is clear. How would RemoteServer fit into here?


It seems like it’s not possible to configure checks.

What do you mean with “checks”? Do you want to create rules, or discover services?


Is it possible to access check results via the API (already)?

With Livestatus you can query the monitoring core for the status data of hosts and services.
I know, not really a REST-like way but this should work ;-):
https://sgala.com/post/checkmk-api-get-service/

Best regards, Simon

1 Like

Thx for the explanation!

I had actually never considered the integration of RemoteServer, which could ‘deliver’ libraries to test nodes.
…the use case sounds interesting, but I wonder what problem we could really solve with it.

The use case relates to system level end-to-end testing of modern, distributed cyber physical systems: Robot Framework for Cyber Physical System DevOps: Call for inspiration/feedback - #6 by fkromer

In such test automation systems RF runs in a CI and invokes remote libraries on Linux and/or Windows remote servers (e.g. to interface with measurement instruments for getting test output, etc.) usually. In some system scenarios (e.g. in systems containing on-premise networking in addition) it could potentially be interesting if RF could get consolidated check results of a CheckMK instance monitoring e.g. routers, switches, firewalls via SNMP in addition. I hope this explanation was sufficient enough to get the context.

What do you mean with “checks”? Do you want to create rules, or discover services?

Sorry, that was not precisely formulated: I mean the results of SNMP based check plug-ins. Related to consolidated results from the use case above.

With Livestatus you can query the monitoring core for the status data of hosts and services.
I know, not really a REST-like way but this should work ;-):

Not exactly the answer I was hoping for :slight_smile:

Thanks for the context.

But I still don’t see the reason why a Checkmk instance should serve remote libraries.

Not exactly the answer I was hoping for

…because you hoped for a REST endpoint?

Good morning Simon.

An image says more than 1000 words:

The abstract question/task is “Get CheckMK results into RF somehow.”

It works :slight_smile:

curl -X 'GET' \
  'http://localhost/heute/check_mk/api/1.0/objects/host/heute/actions/show_service/invoke?service_description=CPU%20utilization&columns=state&columns=state_type&columns=plugin_output&columns=performance_data' \
  -H 'accept: application/json' \
  -H 'Authorization: Basic YXV0b21hdGlvbjpeYXJFbW5VTE50MWV1WVdx'

output:

{
  "links": [
    {
      "domainType": "link",
      "rel": "self",
      "href": "http://localhost/heute/check_mk/api/1.0/objects/service/heute-CPU%2520utilization",
      "method": "GET",
      "type": "application/json"
    }
  ],
  "domainType": "service",
  "id": "heute-CPU utilization",
  "title": "Service CPU utilization",
  "members": {},
  "extensions": {
    "state": 0,
    "state_type": 1,
    "plugin_output": "Total CPU: 10.12%",
    "performance_data": {
      "util": 10.1223,
      "wait": 0.368419,
      "system": 2.41222,
      "user": 7.34162
    }
  }
}

If you have a CMK site running, you can get the list of all table columns here:

http://localhost/heute/check_mk/api/1.0/ui/#/section/Table-definitions

1 Like

For reference: CheckMK does not provide a public OpenAPI spec. The spec is dynamically generated from source code and observable in a running CheckM instance.

I assume that this is addressed to other readers here :slight_smile:
Yes, that is correct. I assume that you already have a CMK instance running.

Yes it is :slight_smile: