Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

sources/cfg-file-shinken.cfg

PropertyExampleDescription

source_name

cfg-file-shinkenName of this source. Must be unique.
order3Order in the merge algorithm of this source data. Look in the Synchronizer page for more information about it.
import_interval5Launch this source every import_inverval minutes. If you set it to 0, the module will never be launcher automatically
modulescfg-file-shinkenThe module to launch
enabled0

1 - Activate the source

0 - Viewed in the interface, but doesn't collect data nor import objects.

description        

This source is about loading a
Shinken framework
configuration

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.

PropertyDefault (if not set)Description
module_namecfg-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
 



The path of the cfg file that list file and directories to import.

Code Block
...
cfg_file=dependencies.cfg
...
cfg_dir=hosts
cfg_dir=services
...
   

 

Here there an example of the module definition:

Code Block
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
}

...

New source creation


When you have many source sources of configuration (for example a new configuration in addition to the one deliver delivered in shinken  to import in your shinkenShinken to import), we advise you to create 2 another automatic sourcessource.


If you keep only one source, you will have to merge the 2 Shinken configurations in the same directory. You may have naming conflictconflicts...

 

To have an additional source:

  1.  Copy the Create configuration files for new source by copying the /etc/shinken/local-import.cfg  and rename it into you source_name_import-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
     
  2. Copy  /etc/shinken/modules/cfg-file-shinken.cfg  into an other 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 (Example: my_module_name)
    • cfg_path must be set to /etc/shinken-user/source-data/source-data-cfg-source_name_import/definition-source-data-cfg-source_name.cfg
  3. 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 sourcethe source_name must be unique.
      (Example:  my_source_name) 
    • modules must be set to the new module you just define (my_module_defined (cfg-file-source_name)
       
  4. Then you must declare the source_name source in the file /etc/shinken/synchronizers/synchronizer-master.cfg.
    • add Add the source name in the line sources sources syncui,cfg-file-shinken,active-dir,sync-vmware,cfg-file-nagios,discovery, my_source_name

 

Code Block
define synchronizer {
	...
	sources syncui,cfg-file-shinken,active-dir,sync-vmware,cfg-file-nagios,discovery,my_cfg-file-source_name
	...
}