Bug #348

avatar

Template' service extended info not herited

Added by Florent Houbart 608 days ago. Updated 481 days ago.

Status:Closed Start:
Priority:High Due date:
Assigned to:avatarFlorent Houbart % Done:

0%

Category:Centreon
Target version:Centreon-2.1
Resolution:


Description

When defining extended information on a service template, services that inherit from this template should inherit the extended info.

But when generating Nagios config files in such a situation, the inheritated extinfo are not written in the serviceextinfo.cfg file.

genExtendedInfos.php - proposition of corrected version (based on version 7034) (9.7 KB) Florent Houbart, 01/08/2009 03:37 PM

History

Updated by Florent Houbart 608 days ago

avatar
  • Status changed from New to Assigned

After looking at the code that generate the serviceextinfo.cfg, it appear that there is a mistake in the algorithm that go through the services' inheritance

In file www/include/configuration/configGenerate/genExtendedInfos.php, the if on line 113 (line number extracted from revision 7034) checks if there is at least one extinfo defined on the service before processing anything.
Further in code, the function getMyServiceExtendedInfoField go through the inheritance tree to find out the proper extinfo.

Problem is that if the service itself does not define any extinfo, but only its parent template, processing is excluding by the first if statement.

The function getMyServiceExtendedInfoField should be called before the if, and the if performed on the resulting data. With such solution, the SQL query can be simplificated by only getting the list of active services.

Working on revision 7034 (which is the one packed in v2.0 RC7), in attachement is a proposition of corrected code (modification contained between comments // flouba MODIFICATION START and // flouba MODIFICATION END to help locate them).

Updated by Julien Mathis 583 days ago

avatar
  • Status changed from Assigned to Closed
  • Resolution set to Duplicate

=> duplicate #359

Also available in: Atom PDF