0

I have two sets of on-call people -- sysadmins and operators. I have nagios monitoring an SSH service. If the service goes down or comes back up, I want to notify the operators; they don't need WARNING or FLAPPING, just CRITICAL and OK. But I want to notify the sysadmins for everything.

As far as I can see, the only way to do that is to create two entirely separate nagios services, perhaps called SSH and SSH2, both running the same check. They would be treated entirely separately by nagios and listed separately in the nagios web pages.

Can I do this with a single service -- set up two different contacts with two different notification_options values ? I've tried a few times, but as far as I can tell, redefining a service just replaces the old configuration with the new one.

(I may have the same question about hosts, too. And I definitely don't to have duplicate hosts in my nagios web pages.)

4
  • Each service definition can take multiple contacts. Each contact can have its own values for service_notification_options. You generally have to reload or restart Nagios after making changes. Nov 29, 2016 at 16:50
  • Thank you ... but I don't (at this time) want to change my defaults. I'm trying to change one specific service on one specific host.
    – hymie
    Nov 29, 2016 at 17:06
  • It's not clear what you mean by "my defaults". You can change the service definition to use two contacts; you can change the value of service_notification_options for each contact; you can create a new contact for SSH operators or for SSH sysadmins. If you don't want to change any of those things, you're going to have trouble. Consider putting all these Nagios files under version control. Nov 29, 2016 at 18:15
  • My understanding, when you said "each contact can have its own values for service_notification_options", you meant that I would be adjusting the service notification options for that contact for ALL services. I don't want to change the default service notification options for this contact. I want to change the specific service notification options for this specific service when it alerts this specific contact. But the "create new contacts" idea might be the one i need.
    – hymie
    Nov 29, 2016 at 18:20

1 Answer 1

0

Default is a fuzzy term when we're talking about Nagios.

Assuming that

  • the sysadmin contact has a "standard" set of notification options (say, w,u,c), and
  • the sysadmins need a different set of notification options for SSH ("everything": w,u,c,r,f,s,n)

then I think you just need to create another contact for sysadmins. Name it, say, sysadmin_ssh. Set its notification options to w,u,c,r,f,s,n. Then use that contact for the SSH service, and the standard sysadmin contact for all the other services.

Also, version control is your friend. VC makes testing safe and painless.

2
  • sigh For internal reasons related to my specific setup, I cannot create a separate contact. The contact_name must be set to a specific value. Although this is probably the correct answer in general, it will not work for me.
    – hymie
    Nov 30, 2016 at 15:31
  • @hymie: Maybe we need to attack this from the other direction. What can you change? (Edit your question; include these new restrictions.) Nov 30, 2016 at 15:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .