mocdaniel / dashing-icinga2

Dashing dashboard for Icinga 2 using the REST API
MIT License
204 stars 47 forks source link

Multiple Services for single Host with same name are not displayed individually #122

Closed frankfil closed 2 years ago

frankfil commented 3 years ago

We use https://github.com/vshn/signalilo inside our Kubernetes cluster to catch alerts from Prometheus and then create and set service states in Icinga where each Kubernetes cluster gets its own Host in Icinga.

One side effect of this configuration is that signalilo can create multiple Services with the same Display Name against the same Host because Prometheus has triggered multi alerts based of the same alert rule (which is where the Server name is obtained).

When this happens the list of Services in the Dashboard will only list one Service - any additional Services with the same Display Name are not shown.

I believe what we are seeing is a side effect of #114 and specifically this:

https://github.com/mocdaniel/dashing-icinga2/blob/5ed16c97f83863a0074dde847b2397c6ed49b7f8/lib/icinga2.rb#L640-L645

For example if I set the service_display_name as follows

service_display_name = obj["name"].split('!')[0].to_s

Then I see all the Services in the list - but of course not using the Display Name.

To be honest I'm not even sure if this is an issue here or with signalilo or just a bad luck combination of how both application do things.

However another side effect of #114 is that we have Hosts with parentheses in their names and this causes the displayed name to not match.

Is there an issue in keeping ( or ) in the name? (I've never written code in Ruby before.)

mocdaniel commented 3 years ago

Thanks for reporting this, on first glance it definitely looks like a direct effect of #114 in one way or the other. I will look into the code that has been changed there again this weekend and try to come up with a solution asap.