I've found a bug that affects the generation of certain config files. In my case it affected service groups, and caused some members of it to dissapear.
Steps to reproduce:
- Create host "host1"
- Create service with description "test100", add it to host1
- Create service with description "test10", add it to host1
- Create servicegroup, add both services to it.
- Press the "view config" button on the servicegroup (or apply config/write files)
- Inspect which members are included in the servicegroup. If the bug occurs, only one of the two services will appear as a member
Any naming of services that contains substrings might trigger the bug. For instance, calling services "Something" and "Something - extra" can trigger it. It is also dependent on the order in which they were created.
The bug seems to be caused by in includes/components/ccm/classes/config.class.php line 886:
Code: Select all
if (substr_count($value, $strHost.",".$strService) == 0) {
$value .= $strHost.",".$strService.",";
}Thanks, Gonzalo