We use cookies to ensure that we give you the best experience on our website.  Visit our Privacy Policy to learn more. If you continue to use this site, we will assume that you are okay with it.

Your choices regarding cookies on this site.
Your preferences have been updated.
In order for the changes to take effect completely please clear your browser cookies and cache. Then reload the page.

Configure additional backup domains

Checkmk Manual

Related articles

Search in the manual

This is the old documentation.
You can find the shiny new documentation here, which is replacing over time this one.
Thus, this article is obsolete and may be not valid anymore - however, the new one is not finished yet!

1. Backup domain syntax

As of version 1.2.4 a WATO snapshot is a tar file which contains several tar.gz files, each representing a specific category in the monitoring system. Those categories are called backup domains and contain a defined set of files and folders.

They are configured through the global parameter backup_domains, a dictionary, with the following syntax:

backup_domains.update(
    {
        "mkeventhistory": {
          "group"       : _("Historic Data"),
          "title"       : _("Event Console Archive and Current State"),
          "prefix"      : defaults.omd_root,
          "paths"       : [
                            ("dir",  "var/mkeventd/history"),
                            ("file", "var/mkeventd/status"),
                          ],
        }
    }
)

The dictionary key "mkeventhistory" is the name of the backup domain included into the WATO snapshot.
So if you create a snapshot with the backup domain shown above, the WATO snapshot will contain a file named mkeventhistory.tar.gz.

The following list explains all possible parameters for a backup domain

  • group
  • This parameter is only used within the GUI, to group certain backup domains into the same category.
    If you do not set this key, the backup domain ends up in the group "Other".
  • title
  • The title of this group which is also solely used in the GUI.
  • prefix
  • All files within a backup domain need a common prefix path. This is the base path of the tar.gz file.
  • paths
  • This parameter is a python list of tuples, containing the type and path of an element in this backup domain.
    The type can be set to dir (include the entire dir) or file (include the file). Keep in mind that when the snapshot is restored all directories and files specified here get emptied and deleted!
  • default
  • If this parameter is set to true this domain is activated by default.

2. How to add a new domain?

All you have to do is to specify this domain in the folder ~/local/share/check_mk/web/plugins/wato/

~/local/share/check_mk/web/plugins/wato/mydomain.py
backup_domains.update(
    {
        "mydomain": {
          "group"       : _("My special group"),
          "title"       : _("My precious files and directories"),
          "prefix"      : defaults.omd_root,
          "paths"       : [
                            ("dir",  "var/myfolder/thefolder"),
                            ("file", "var/myfolder/file1"),
                            ("file", "var/myfolder/file2"),
                          ],
          "default"     : True
        }
    }
)


After you've restarted the apache server go to WATOs "Backup & Restore"


Voila, a new default backup domain is born!