shinken-monitoring / mod-webui

Shinken Web User Interface
GNU Affero General Public License v3.0
79 stars 71 forks source link

Plugin configuration file #50

Closed mohierf closed 9 years ago

mohierf commented 10 years ago

Each plugin should have its own configuration file. A simple Ini file should be enough to store configuration parameters ... something like :

[plugin]
# Mongo DB server connection
mongo_host=localhost
mongo_port=27017

logs_type=
logs_limit=500

in a file store in the plugin dir and named with the plugin name and an extension .cfg.

mohierf commented 9 years ago

Closing ... future release will store parameters in user's preference.

oloc commented 8 years ago

Actually, all the cfg files of the cfg_dir declared in the /etc/shinken/shinken.cfg are parsed by the configuration validation process of the Shinken arbiter. By default, in the /etc/shinken/shinken.cfg, we can read cfg_dir=modules. So modules are parsed.

As a particular result, config, minemap, and worldmap present errors in their *.cfg. for the verification process:

And currently these errors break the verification, and therefore the arbiter does not start. I propose to move .cfg into .ini (not parsed), or mark as a comment the [plugin] and feed with empty value xxx='' .

Maybe you can provide a quick patch for these minor errors with your own vision of the best correction.

Sources: https://shinken.readthedocs.org/en/latest/04_runningshinken/verifyconfig.html https://shinken.readthedocs.org/en/latest/03_configuration/config.html#main-configuration-file-shinken-cfg

mohierf commented 8 years ago

Very strange your problem! I do not have this problem neither in my configuration nor after a fresh install ...

When I run shinken-arbiter -v -c /etc/shinken/shinken.cfg it does not parse any sub-directory of the /etc/shinken/modules/webui2 directory ...:

[1446715366] INFO: [Shinken] Processing object config file '/etc/shinken/modules/sample.cfg'
[1446715366] INFO: [Shinken] Processing object config file '/etc/shinken/modules/graphite2.cfg'
[1446715366] INFO: [Shinken] Processing object config file '/etc/shinken/modules/webui2.cfg'
[1446715366] INFO: [Shinken] Processing object config file '/etc/shinken/modules/simple-log.cfg'
[1446715366] INFO: [Shinken] Processing object config file '/etc/shinken/modules/ui-graphite2.cfg'
oloc commented 8 years ago

shinken-arbiter: 2.4.2

When I run shinken-arbiter -v -c /etc/shinken/shinken.cfg I can read the parse of the plugins. Here are the parsed part of webui2, and the errors:

[1446716577] INFO: [Shinken] Processing object config file '/etc/shinken/modules/webui2/plugins/minemap/plugin.cfg'
[1446716577] INFO: [Shinken] Processing object config file '/etc/shinken/modules/webui2/plugins/cv_host/default.cfg'
[1446716577] INFO: [Shinken] Processing object config file '/etc/shinken/modules/webui2/plugins/cv_host/replace.cfg'
[1446716577] INFO: [Shinken] Processing object config file '/etc/shinken/modules/webui2/plugins/config/plugin.cfg'
[1446716577] INFO: [Shinken] Processing object config file '/etc/shinken/modules/webui2/plugins/worldmap/plugin.cfg'
[1446716577] INFO: [Shinken] Processing object config file '/etc/shinken/modules/webui2/plugins/logs/plugin.cfg'

[1446716423] ERROR: [Shinken] [config] the parameter [plugin] is malformed! (no = sign)
[1446716423] ERROR: [Shinken] [config] the parameter minemap_hostsHide is malformed! (no value after =)
[1446716423] ERROR: [Shinken] [config] the parameter minemap_servicesHide is malformed! (no value after =)
[1446716423] ERROR: [Shinken] [config] the parameter [view] is malformed! (no = sign)
[1446716423] ERROR: [Shinken] [config] the parameter svc_load_uom is malformed! (no value after =)
[1446716423] ERROR: [Shinken] [config] the parameter [view] is malformed! (no = sign)
[1446716423] ERROR: [Shinken] [config] the parameter svc_load_uom is malformed! (no value after =)
[1446716423] ERROR: [Shinken] [config] the parameter [plugin] is malformed! (no = sign)
[1446716423] ERROR: [Shinken] [config] the parameter [plugin] is malformed! (no = sign)
[1446716423] ERROR: [Shinken] [config] the parameter map_layer is malformed! (no value after =)
[1446716423] ERROR: [Shinken] [config] the parameter map_hostsHide is malformed! (no value after =)
[1446716423] ERROR: [Shinken] [config] the parameter [plugin] is malformed! (no = sign)
mohierf commented 8 years ago

I understand your problem ... how did you get those plugins configuration file in your /etc/shinken/modules directory?

Those files must be located in /var/lib/shinken/modules/webui2/plugins directory and this directory is never parser by the shinken-arbiter ...

oloc commented 8 years ago

Thank you very much! My fault.

In order to have all the modules stuff in the same place, I created a link /var/lib/shinken/modules targeting /etc/shinken/modules. That was a very bad idea.

I purge all, and install shinken again from scratch without this symlink, and everything is OK.