I think one way to avoid this problem is to use a different nagios_host_context on each model, and have the model name be part of that context.
I see concretely where we've done this for a cloud where keystone is deployed to both openstack and kubernetes models. Hostnames come up as e.g. <customer>-<cloud>-openstack-keystone-1 and <customer>-<cloud>-k8s-keystone-1, with no collision. -- You received this bug notification because you are a member of Nagios Charm developers, which is subscribed to Nagios Charm. https://bugs.launchpad.net/bugs/1939068 Title: Incorrect parent values when using cross-model relations Status in Nagios Charm: New Bug description: Nagios sets a "parents" value in host definitions so that when a host dies and alerts, the containers running on that host do not also alert. This functionality works fine when charm-nagios and charm-nrpe are related within the same model, but this value is never set properly when a cross-model relation is used. When these two charms are related, the following takes place: 1. Each nrpe unit provides its machine id and hostname and to nagios 2. Nagios extracts the parent's machine id from the unit's id, if it's an lxd 3. If that parent machine id exists in a dictionary of hosts, then the parent relationship is set up This process can break down in cases where nagios is working with multiple models with overlapping machine ids (which is very likely). As an example, it's possible for machine "3/lxd/0" in model "openstack" to be given machine 3 in the "lma" model as a parent, which it should be machine 3 in the "openstack" model. To manage notifications about this bug go to: https://bugs.launchpad.net/charm-nagios/+bug/1939068/+subscriptions -- Mailing list: https://launchpad.net/~nagios-charmers Post to : [email protected] Unsubscribe : https://launchpad.net/~nagios-charmers More help : https://help.launchpad.net/ListHelp

