How to load rules.mk in python scripts?

Hi,
Does anyone knows a propper way to load the content of rules.mk files in a python script? I don’t know the estructure used for storing it, but I need to open it from python to process it and don’t know how to load from file

Example:

I read in documentation that this files are stored in some kind of python way and I’d like to know how to load them into a structure more easy to manipulate and read it.

You should really use the API for that task. The new REST-API is currently not able to edit rules but the older WATO-API is still available: Configuration via HTTP-API

1 Like

I tried, but old installations like mine (1.4p36) doesn’t support this kind of requests to their API:

Witch new ones does:

I don’t know other way to get this information :slightly_frowning_face:

Not sure in which patch level of 1.4 but it was a request from us to be able to create rules with API. I will check with my colleague how it has to be used.

BR

MF

1 Like

The werk should be this:

With 1.4 we had a special version of checkmk and I cannot really say if the change found its way in to 1.4 ever.
Documentation is here:

Anyway I highly recommend to update your installation.

Whish you good luck

Michael

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.