centreon / nagiosToCentreon

Import your nagios config files into Centreon DB... And it rocks !
Apache License 2.0
9 stars 13 forks source link

Services by host groups are converted to services by hosts #11

Closed euidzero closed 8 years ago

euidzero commented 8 years ago

Importing a service by host group splits it to multiple services by hosts for every host in the group

define hostgroup{ hostgroup_name Physical_server_with_soft_raid members host1, host2, host3 }

define service{ hostgroup_name Physical_server_with_soft_raid service_description check_nrpe_cores_temp use modele_service_nrpe check_command check_nrpe_check_cores_temp }

becomes SERVICE;ADD;host1;check_nrpe_cores_temp;from_service_by_hg_check_nrpe_cores_temp SERVICE;ADD;host2;check_nrpe_cores_temp;from_service_by_hg_check_nrpe_cores_temp SERVICE;ADD;host3;check_nrpe_cores_temp;from_service_by_hg_check_nrpe_cores_temp

which is repeated twice in the centreon_clapi_import_commands.txt

euidzero commented 8 years ago

My fix export-hgservices.patch.txt

lpinsivy commented 8 years ago

Hi, Yes it is a desired behavior

Service by hostgroup have doesn't allow to see them into Centreoni n the "Configuration -> Services -> Services by host".

Moreover, If you change a value in the definition of a service by hostgoup, all services will be impacted.

centreon team prefer to use template of services to use inheritance.

Regards

euidzero commented 8 years ago

IMHO The nagios importer shall respect the structure decided by the user who create the nagios configuration and not substitute to the user. A data importer should be neutral with respect to the structure.

I ended up with hundreds of undesired services while importing an old nagios+centreon config that only count 10 services by host groups.

At least there should be a switch and proper documentation. Thanks

lpinsivy commented 8 years ago

I understand your point of view but in the future of Centreon, service by hostgroup may disappear.

So I can add an option --use-hg-service to keep service by hostgroup. Without option, service by hostgroup will be use service template.

Do you agree ?

euidzero commented 8 years ago

Definitely. Thanks

Le mar. 26 janv. 2016 18:23, Laurent Pinsivy notifications@github.com a écrit :

I understand your point of view but in the future of Centreon, service by hostgroup may disappear.

So I can add an option --use-hg-service to keep service by hostgroup. Without option, service by hostgroup will be use service template.

Do you agree ?

— Reply to this email directly or view it on GitHub https://github.com/centreon/nagiosToCentreon/issues/11#issuecomment-175127763 .

euidzero commented 8 years ago

See my comment on the commit : the HGSERVICE creation should be in the outer loop.

lpinsivy commented 8 years ago

sorry corrected I hope

btassite commented 8 years ago

So I can add an option --use-hg-service [..]

In the current code this is --servcies-hg, not --use-hg-service (also misspelled :))