List services/hosts based on notification contact

Hello Together,

I had to validate the notification contacts for few of the icinga checks and I’m trying to pull report from ui with service contact as filter but the filter is not working 100% and is showing random results.
Then tried the (/v1/objects/services) api and here also the service contact is not showing in result.

Is there any other way to do this? Any insight will be of great help.

Web UI Filter Tried : Overview → Services → Service Contact
Icinga Web Version : 2.8.2

Thanks,
Karthick N

Hello All,

Any update on this request ? Thanks in advance…

When I try this, I get the desired results.

I had to validate the notification contacts for few of the icinga checks and I’m trying to pull report from ui with service contact as filter but the filter is not working 100% and is showing random results.

What do you mean by random? Are you using wildcards/regex in your filters?

You might also try filtering by contact groups, assuming that your contacts might be in group(s)

I can’t find anything wrong with it as well.
What makes you think it does not work 100%? Any examples?

The issue is with the space in contact display name i think. Few of the contacts have spaces in the display name like “email notification”, “telegram notification” so when i do a search on service contact = “email notification” it is giving random result due to space issue… Tried using wildcard like email*notification, email%20notification but nothing works…

I also do not have any issue in filtering contacts with no white spaces like “whatsapp_notification”.

Do we have a way to fill this regex during search?

Thanks much for your time.

Not that I know of.

Couldn’t you just eliminate the space in the display name by setting it to “email-notification” or use the object name instead?

edit: Ah I just realized(or at least I think so) that the search filter for “Service Contact” or “Host Contact” does not compare against the display_name property at all. It compares only against the object name.

Any other way to fetch the result from API? I’m unsure which api stream has user contact details… Notification has but it give the result of latest sent notifications.

Have you tried it with the object name of the service contact?

As for the API: Not sure, but you could look at what notification objects have the contact configured and then pull the host/service out of there. But I would guess that this is something a small script has to do and not a single API call.