Splitting a site into central and remotes using "omd cp" (to keep historic events and availability)?

I’m new to distributed sites, so please bear with me if this is complete nonsense.

I have a small site (CRE) which I’d like to split into several ‘remote’ and a central site (will be CME).

I understand that the normal way would be to could migrate the old site to CME and use it as central site, create the remote sites and then migrate hosts/folders to the remote sites one by one. To keep the historic graphing I could copy over RRD files manually, but I will loose historic events and data about availability.

How about creating the remote sites as copies of the central site (“omd cp”)? Would I be able to strip down the remote sites of all unwanted hosts, folders and configuration files, and then connect them to the central site? Would that preserve the historic events and availability data?

I understand that chances would be that each remote site would contain information that is no longer appropriate (i.e. in the logfiles), but I would be willing to go with that, if it would allow me to keep the historic events and availability data.

Would this be a viable way or is it impossible?

Hi Gregor,

haven’t done this, but I don’t see why it shouldn’t work.

However, creating new sites and rsyncing the rrd and nagios log files (+ possibly inventory history if you use the hw/sw inventory) should work as well.

Gerd

Hmm, at a first try it looks as if the historic events and availibility data is already lost on the upgrade from CRE to CME. Could it be that that data can’t be migrated Nagios to CMC?

Did you switch to the cmc but maybe haven’t migrated the log files according to Migration to the CMC - Switching from Nagios to the Checkmk Micro Core ?

Following up on myself, I think I found a solution for my problem: You’re right, @gstolz! I failed to read the CMC migration documentation :wink:

The documentation on Migration to the CMC has a recipe how to make the Nagios event history available to the CMC:

The event history (Nagios-Log) will be maintained in a compatible format by the CMC — but in a different location (var/check_mk/core/history). The log archive is located in var/check_mk/core/archive. If you wish to carry over the event history (e.g., for availability), copy the necessary files using the command line:

OMD[mysite]:~$ cp var/nagios/nagios.log var/check_mk/core/history
OMD[mysite]:~$ mkdir -p var/check_mk/core/archive && [[ -e var/nagios/archive/* ]] && cp var/nagios/archive/* var/check_mk/core/archive

I tried and at a first glance this seems to work for copying to a new site as well.

So I will update the CRE site to CME and then copy over the nagios.log and archives to the new places. Then, I will create (empty, new) remote sites, move over the hosts with the WebUI and then copy over var/check_mk/core/history and var/check_mk/core/archive/* from the central site to the remote site (and accordingly for the RRDs).

I guess this is undocumented since the nagios.log potentially contains sensible information which should not be distributed to the remotes. As I said, I can live with this disclosure.

Yeah, it’s not ideal. You could in theory remove all lines matching certain hostnames from each hosts logs :slight_smile: but if you can live with it, I don’t see a need to do that.

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.