Configure additional backup domains


Dieser Artikel wird nicht mehr gepflegt und ist unter Umständen nicht mehr gültig!

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!