Importing Shinken framework cfg file to Shinken Enterprise is very easy. You can import your previous Shinken framework configuration using the cfg-file-shinken source.
Configuration
To define a shinken cfg source:
- Configure the module in the file /etc/shinken/modules/cfg-file-shinken.cfg
to define the behaviour of the module - Then configure the source in the file /etc/shinken/sources/cfg-file-shinken.cfg
to enable the source and call the module configured in step 1. - Then you must declare the cfg-file-shinken source in the file /etc/shinken/synchronizers/synchronizer-master.cfg.
Note
During the Shinken Enterprise installation process, a cfg-file-shinken module called cfg-file-shinken is already defined.
It is provided to be able to import default Shinken Entrerprise configuration.
sources/cfg-file-shinken.cfg
| Property | Example | Description |
|---|---|---|
source_name | cfg-file-shinken | Name of this source. Must be unique. |
| order | 3 | Order in the merge algorithm of this source data. Look in the Synchronizer page for more information about it. |
| import_interval | 5 | Launch this source every import_inverval minutes. If you set it to 0, the module will never be launcher automatically |
| modules | cfg-file-shinken | The module to launch |
| enabled | 0 | 1 - Activate the source 0 - Viewed in the interface, but doesn't collect data nor import objects. |
| description | This source is about loading a | A description to show on the UI. |
modules/cfg-file-shinken.cfg
Here is the list of parameters required by the module to be updated the in cfg file.
| Property | Default (if not set) | Description |
|---|---|---|
| module_name | cfg-file-shinken | Name of this module. Must be unique. |
| module_type | cfg-file-import | Can't be changed |
| cfg_path | /etc/shinken/local-import.cfg |
... cfg_file=dependencies.cfg ... cfg_dir=hosts cfg_dir=services ... |
Here there an example of the module definition:
define module{
# Shinken Enterprise. Lines added by import core.
# Do not remove it, it's used by Shinken Enterprise to update your objects if you re-import them.
_SE_UUID XXXXXXXXXXXXXXXX
_SE_UUID_HASH XXXXXXXXXXXXXXXX
# End of Shinken Enterprise part
module_name cfg-file-shinken
module_type cfg-file-import
cfg_path /etc/shinken/local-import.cfg
}
Create a new source for cfg file import
When you have many sources of configuration (for example a new configuration in addition to the one delivered in Shinken to import), we advise you to create another automatic source.
If you keep only one source, you will have to merge the 2 Shinken configurations in the same directory. You may have naming conflicts.
To have an additional source:
- Create configuration files emplacement for new source by copying the /etc/shinken-user/source-data/source-data-cfg-sample folder and renaming it to /etc/shinken-user/source-data/source-data-cfg-source_name.
Also rename /etc/shinken-user/source-data/source-data-cfg-source_name/definition-source-data-cfg-sample.cfg into /etc/shinken-user/source-data/source-data-cfg-source_name/definition-source-data-cfg-source_name.cfg
- Copy /etc/shinken/modules/cfg-file-shinken.cfg into another cfg file name and configure it.
- Change the module name, for example cfg-file-source_name
Remember that the module_name must be unique cfg_path must be set to /etc/shinken-user/source-data/source-data-cfg-source_name/definition-source-data-cfg-source_name.cfg
- Change the module name, for example cfg-file-source_name
- Copy /etc/shinken/sources/cfg-file-shinken.cfg into an other cfg file name and configure it:
- Change the source name, for example cfg-file-source_name
Remember that the source_name must be unique.
- modules must be set to the new module you just defined (cfg-file-source_name)
- Change the source name, for example cfg-file-source_name
- Then you must declare the source_name source in the file /etc/shinken/synchronizers/synchronizer-master.cfg.
Add the source name in the line sources
define synchronizer { ... sources syncui,cfg-file-shinken,active-dir,sync-vmware,cfg-file-nagios,discovery,cfg-file-source_name ... }
- Restart the synchronizer for it to recognize the new source
- Load your configuration files into the new source emplacement: /etc/shinken-user/source-data/source-data-cfg-source_name
Global datas
Global datas can be configured in /etc/resources.d/. This folder contains files defining global datas for various subjects (email, mysql, oracle, ...) accessible by your objects globally in Shinken.
For easier organisation and a cleaner configuration, global datas can also be configured into the sources.
The sample cfg source folder located in /etc/shinken-user/source-data contains a global-data folder in which global datas definitions can be placed (a sample file is also present in this folder).
When the source is imported, these global datas files will be copied into /etc/resources.d/source_name.
This mecanism also allows you to overload values defined in /etc/resources.d with files defined in sources.