diff --git a/Nagstamon/Servers/Alertmanager/alertmanagerserver.py b/Nagstamon/Servers/Alertmanager/alertmanagerserver.py index ab07ccadb..24884371a 100644 --- a/Nagstamon/Servers/Alertmanager/alertmanagerserver.py +++ b/Nagstamon/Servers/Alertmanager/alertmanagerserver.py @@ -248,6 +248,12 @@ def _get_status(self): self.new_hosts[service.host].name = str(service.host) self.new_hosts[service.host].server = self.name self.new_hosts[service.host].services[service.name] = service + if service.name not in self.new_hosts[service.host].services: + self.new_hosts[service.host].services[service.name] = service + else: + # Compare the labels if they match do *not* create a new "instance" of alert + if not service.labels == self.new_hosts[service.host].services[service.name].labels: + self.new_hosts[service.host].services[service.name + service.fingerprint[0:4]] = service except Exception as the_exception: # set checking flag back to False