Notification Setup (Migrating from Nagios)

Hello,

I’m in the process of migrating away from a Nagios 3.x/NagiosQL installation I’ve managed for years to Icinga2/Director and struggling to wrap my head around the notification process in Director (Partially because the old way is so ingrained, I think)

On Nagios I could setup notifications by assigning Users and/or Groups along with the notification periods directly to a host. Notification periods and Users/Groups could be assigned independently of one another, allowing me to customize each host. Of course I had default notification settings under templates as well.

On Icinga2/Director however, it seems I need to create notification objects with both the User/Group & Time Period tied together. Then apply that with some logic so they are assigned to the host. I tried to make it a little easier to customize by creating a variable called ‘notification_tags’. I assign a string(s) to each host then create notifications that look at this tag to be applied.

Here’s my confusion though…

I have 4 users (Net Admin, Sys Admin, Desktop Admin, Part Time). They may each have some objects that they need notified for that the others don’t. Some objects may need to notify multiple users. Then I have critical priority alerts (24x7), normal priority (M-F 8x5, repeat every 12 hrs), and low priority (M-F 8x5, never repeat).

4 notifications, one for each individual
3 notifications for multiple users (One for all 4 users, Then 3 users, then just the Net Admin/Sys Admin)

Then multiply that by 3 for each priority (critical, normal, low) for a total of 21 notification objects. Plus I have some specific alert groups for departments.

Is this how it’s supposed to work in best practice? I was thinking it would be simpler under the notification area and would like to know how others have their systems setup. It seems like this could get hard to manage quickly. Does anyone else use a custom variable to assign notifications?

The other thing I’m struggling with is in Nagios I could go to Configuration/Hosts or Configuration/Services to quickly see all the settings on a host which came in handy when auditing what notifications were assigned to hosts and see if I had missed one. I don’t see anything in Icinga2/Director like this. Is there a way to get a line by line comparison of the host settings somewhere?

thanks in advance

Hi & welcome to the community :slight_smile:

The old way of doing things had many things tied together, and you’d always needed to edit the host notification contacts. The new way of doing things is to not edit the host anymore, but dynamically apply notifications combined with users and groups.

You can also leverage certain things into notification templates, meaning to say you can group users into a usergroup, then assign this to a template with a context specific name, and then import that into your notification apply rule.

I would be that your 4 users can be grouped into something like “production-users”, “dev-users”, or similar.

If you cannot achieve the timeperiod filters on the notification object level, you can set such in the user object itself unless I am mistaken (Icinga 2 allows that).

That’s a common thing when working with Icinga 2, for any apply rule you’ll create and you cannot match the host name, or any oh the host’s attributes being available.

I’d advise to have a read into the monitoring basics and principles before going deep into the actual configuration. You’ll need to understand the object relations and specific differences, also when coming from the old world.

I don’t know if the Director has such a view, but users asked for this quite often - you can do that via REST API scripts, e.g. Filter hosts/services

Cheers,
Michael

Thanks Michael,

I had read the monitoring basics already but I think it just took me a while to get my head wrapped around the new filtering syntax and how I could apply it. I played with it a bit over the last week and think I’m finally understanding how it should work. I was able to modify the API script you mentioned for my environment, which at least makes me feel like I have something to hunt down Hosts without notifications instead of checking each host.

I also ended up creating a few hostgroups I wouldn’t normally have bothered with to simplify the notification filters. Thanks again.

1 Like

Playing and learning is a good thing, the documentation can never be that crystal clear about it. Especially when you’re coming from old habits, the expression language or how we call it, DSL (domain specific language), we’ve created, is overwhelming.

Since you’re using the Director, inspect the rendered configuration from the deployment tabs, and peek into what’s done inside the DSL. There’s additional techniques available, with the Director abstracting that away. You may for instance match on a specific host name or custom variable too and create notifications based on that as well. Or combine these filters :slight_smile:

Cheers,
Michael