Nagios Contacts and Contact Groups?

127 views
Skip to first unread message

Sean Alderman

unread,
Jul 22, 2013, 3:12:08 PM7/22/13
to example42-pu...@googlegroups.com
Gang,
  Please bear with me once again, I'm a total nagios newbie, but fascinated at how simple Al's module makes getting Nagios operational.  I see in puppet-nagios, there are nagios::contact and nagios::contactgroup classes.  Is there a suggested way to manage these?  I'd love to have a  nagios contact for each monitored node - or perhaps Foreman's $::owner_name and $::owner_email, or a host_group such that monitored hosts in said group would have a designated nagios contact.

  I have read enough to know that the notification filtering in Nagios is not trivial, but at the moment, all I have configured is the nagios-admin account.  I have it on my todo list to integrate the NagiosUI authentication with our LDAP, but that has nothing to do with contact info for alerting system owners.

Thanks in advance for sharing your thoughts and experiences!

Alessandro Franceschi

unread,
Jul 24, 2013, 4:23:32 AM7/24/13
to example42-pu...@googlegroups.com
My2c
You have different alternative choices on how to manage these configurations with Puppet.
With the defines nagios::contact and contactgroup you can create whatever number of contacts you want, and eventually parametrize them with some Foreman parameter.
Still you need to use these contacts somewhere, either in host/service templates or directly in the checks configurations, and here the matter becomes a bit variable, as it doesn't make sense to have a template for each contact(group) if they are many, and at the same time by default the checks configured by Puppet, in the example42 module, don't provide a parameter to manage directly contacts, so, somehow, using templates is currently the only available alternative.

al

Sean Alderman

unread,
Jul 24, 2013, 3:58:34 PM7/24/13
to example42-pu...@googlegroups.com
Thanks Al,  I'll have to try a couple of things there and see where I land.  Your modules make things elegant, so I'll see if I can't find an elegant solution to go with this.

Sean Alderman

unread,
Sep 25, 2013, 2:21:35 PM9/25/13
to example42-pu...@googlegroups.com
Resurrecting this old topic with a progress update...

I have indeed taken your template route.  I have a site class for monitoring agents and server(s).  The server's subclass is complicated but sets up service groups, nagios contacts and contact groups (in hard coded fashion) for users I have in TheForeman ENC.  For now, the contact groups are for individual users as we don't use an on-call rotation, so by default the Foreman Host Owner is the contact for the Host.  I would love to figure out a way to collect exported resources $::owner_name and $::owner_email (foreman params), but I just don't know how to do that.  I tried adding parameter driven nagios::contact into my agent subclass on each host, but that didn't work.  Ideas would be welcome.

I also override the baseservices template with one that adds a contact_groups field to each of the services for which notifications are desirable.  I also override the hosts.erb template in the same fashion.  And am about to head down the path of overriding the service.erb template also - which I have to patch the puppet-monitor(?) module to do.  I'm not sure how to go about passing a parameter like nagios_service_template from the ENC to a module outside the nagios scope.

I would eventually like to get to leverage host/service escalations too, so after so many alerts, the whole team (there are like 4 of us) can get an email. but for now, it's functional as is.
Reply all
Reply to author
Forward
0 new messages