Use GIT version control for WATO - how?

Hi,

I’m currently setting up a new installation of checkmk enterprise as our current setup is quite old and needs to be updated/graded, not documented and the people who initially set it up have left the company.
So I’m currently diving into this and learning more and more about checkmk :slight_smile:

The question I currently have and for which I cannot seem to find any documentation is the following:
In the Global Settings, in the section “Administration Tool (WATO)” there is an option “Use GIT version control for WATO”. This is by default Off.

Now I can put this to On… but I’m assuming that’s not all there is to it. You probably need to configure more, like an actual GIT repo to use etc. But as stated, I cannot seem to find any documentation on this.

I’m seeing in our current setup that we’re using this option too, but as said, the previous engineer did not document this or how he configured this.

Any idea how to do this or where I can find a manual/instruction on how to do this?

1 Like

You are rigth:

i thing the docu for this feature isn`t relased … :thinking:

I`m also intressted for

and welcome to the community

I just found these werks:

Hi,
you have to install GIT on the CMK server. Then activate “Use Git version control for WATO.” That’s it. Switch to the Linux CLI as site user. The etc/check_mk-directory is your GIT repository.

4 Likes

In addition to @kdeutsch’s answer it is advisable to enable “Pretty-Print configuration files” otherwise you have random changes in the config as Python dictionaries do not have a consistent order.
This makes a git diff more readable than the default without pretty printing.

2 Likes

That’s a global setting in WATO. Just search for “pretty”.

1 Like

Hi all,

Thanks for the replies so far … I totally missed the informational text from the screenshot BH2005 posted (was switched off in my GUI :roll_eyes: )
That text however, to me, doesn’t explain everything. I do have GIT installed on the check_mk machine.
I also see the option for “Pretty-Print configuration files” in the Global Settings in the “Administration tool (WATO)” section.

I’m however still unclear on how to proceed. If I set the “Use GIT version control…” to ON, kdeutsch indicated your /omd//etc/check_mk dir will become your GIT repo …
Forgive my ignorance here. If this is the case, I’d have to update the GIT config file to point to an origin in for instance bitbucket? (just want to make sure I understand correctly) :slight_smile:

i have found it … to quick by writing and to slow by thing first and take a look :see_no_evil:

a very detailed HowTo is this:

https://www.karl-deutsch.at/versionsverwaltung_mit_git.html

thanks to @kdeutsch

@BH2005 yeah that’s about how GIT works generically.
So I’m guessing my assumption would be right. Enable the function in Check_mk and then update the git config accordingly to connect with a remote etc. :slight_smile:

After enabling the GIT function in CMK your local /opt/omd/sites/YOURSITE/etc/check_mk directory is the GIT repository. You don’t have to change the GIT configuration files.

2 Likes

Hi @kdeutsch, that I understand. I was however thinking of having the changes pushed to a repo in Github/Gitlab/bitbucket.
To me this would serve as a back up of sorts of the config. That way, should the server crash, you’d still have the configs “off site”. Otherwise, what would be the point of using Git for version control (in my opinion).

Anyway, I have enough info for now. Thanks all for the input :slight_smile:

1 Like