Icinga / Director Config Backup

Whats the recommended way to backup the Icinga and Director Configs?
I think the object definitions (Host, Service, Templates …) are the most important data?

Is there a possibility to create a backup of all objects that I have created with the Director to restore them in the future?

For which data does it make sense to have a backup?

You could make a dump of the directors mysql database.
Also the Director has a basket feature, which you can use for backup.

The basket upload feature dropped me an error while i tried to import an basket from another icinga/director instance.
Both have the same versions of icinga, icingaweb2 and director.

count(): Parameter must be an array or an object that implements Countable

#0 /usr/share/icingaweb2/library/vendor/Zend/Validate/File/Upload.php(224): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(Integer, String, String, Integer, Array)
#1 /usr/share/icingaweb2/library/vendor/Zend/File/Transfer/Adapter/Abstract.php(665): Zend_Validate_File_Upload->isValid(String, String)
#2 /usr/share/icingaweb2/library/vendor/Zend/File/Transfer/Adapter/Http.php(145): Zend_File_Transfer_Adapter_Abstract->isValid(String)
#3 /usr/share/icingaweb2/library/vendor/Zend/Form/Element/File.php(441): Zend_File_Transfer_Adapter_Http->isValid(String)
#4 /usr/share/icingaweb2/library/vendor/Zend/Form.php(2278): Zend_Form_Element_File->isValid(NULL, Array)
#5 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(379): Zend_Form->isValid(Array)
#6 /usr/share/icingaweb2/modules/director/application/controllers/BasketController.php(124): Icinga\Module\Director\Web\Form\QuickForm->handleRequest()
#7 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Controllers\BasketController->uploadAction()
#8 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#9 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#10 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#11 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
#12 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#13 {main}

Director version: 1.6.2
Icinga Web 2 version and modules: 2.6.3
Icinga 2 version: r2.10.5-1
Operating System and version: Ubuntu 18.04
Webserver, PHP versions: apache 2.4.29, php 7.2

There is a bug report for this, and a possible fix mentioned:

For the Director DB - and if you are not backing up the whole MySQL instance with some general backup tool - my experiences with mysqldump are positive, esp. in terms of later “rollback” to that configuration state by first deleting the DB and then resetting it up with your dump contents. If you are doing the latter on a new Icinga instance, you will have to afterwards still adapt end points & redo kick start, etc… /kb

1 Like

That is correct and good to mention!
I read the question like that the “config/monitoring” side of the Director should be backed up not the “infrastructure” side.