the default contacts column iterates over each available contact and checks
with isNagiosMember() if this contact is valid for the given hst/svc which in
turn calls is_contact_for_service() which simply iterates over all service
contacts and then over all contactgroups with all its members to see if the
contact matches. That's quite a number of nested loops just to get the contacts
list of a host/service. This scales accidentally quadratic with the number of
services/hosts/contacts.
We now calculate the contacts based on the contacts and contactgroup members on
the fly to avoid the nested loops. Since the list could then contain duplicates
and is not sorted we have to do apply sorting again to match the previous
result.
the default contacts column iterates over each available contact and checks with isNagiosMember() if this contact is valid for the given hst/svc which in turn calls is_contact_for_service() which simply iterates over all service contacts and then over all contactgroups with all its members to see if the contact matches. That's quite a number of nested loops just to get the contacts list of a host/service. This scales accidentally quadratic with the number of services/hosts/contacts.
We now calculate the contacts based on the contacts and contactgroup members on the fly to avoid the nested loops. Since the list could then contain duplicates and is not sorted we have to do apply sorting again to match the previous result.
Signed-off-by: Sven Nierlein sven@nierlein.de