← Back to team overview

nagios-charmers team mailing list archive

[Bug 1939068] Re: Incorrect parent values when using cross-model relations

 

** Description changed:

- Nagios has code that's intended to populate the "parents" value in host
- definitions found in /etc/nagios3/conf.d/charm.cfg through its relation
- to charm-nrpe. However, this code cannot set this value due to a
- discrepancy between how host names and machine IDs are provided in
- relation data between nagios and charm-nrpe.
+ 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.
  
- A dictionary mapping child machine IDs to their host machine's name
- already exists, but a comparison against keys in this dictionary fails
- because the parent's machine ID is extracted from the child's ID, which
- doesn't exist in the dictionary.  For example, if there is a unit
- deployed at "2/lxd/0" where machine 2's name is "juju-mysql-0", this
- dictionary will look like {"2/lxd/0": "juju-mysql-0"}.  The bug here is
- that a regex expression is used to extract the machine ID of "2", which
- is compared against the dictionary, and that check fails.
+ 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 regular expression needs to be removed and the machine ID as it
- exists in the relation data between nagios and nrpe needs to be used as
- the key.
+ 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.

-- 
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



References