Allow host down while under nagios watch

We're using nagios to watch our servers health. Now we have a task to add server which will be up only for certain time. And during that time we have to ensure that all services are up and running. Unfortunately we don't know when will be the host down. So we need some automatic way to achieve this.

  1. Is there a way (configuration directive) to not report if host goes down. I mean even in nagios clients like nagstamon. I don't like the idea of black icon in systray all day.
  2. Is there a way to not report any of services running on a host, while the host is down?
  3. While achieving points 1. and 2. is there a way to monitor all host services when and only when the host is up?

Solution 1:

Let me take the points in the wrong order.

2) NAGIOS should already do this; if a host is down, service alerts will not be sent.

1) I was thinking you could do this with flexible downtime: this is downtime of a given window duration which doesn't start at a known time; instead, the window starts automatically when the host goes down.

But then it occurred to me: all you really need to do is send no alerts when the host is down. If you manage that, then

  • When the host is down, service alerts will not be sent. You don't care that the host is down, because as you say, you don't know when it'll come and go, so the absence of a host alert is immaterial. The HOST DOWN will still be logged, allowing you to retrospectively see what has gone on, but alerts will not be sent.

  • When the host is up, service alerts will be sent anyway.

That's what you want, isn't it? If so, you need to add to the host definition

notification_options   n

I think that's also dealt with problem 3, as that's what happens normally. I can't speak for non-core clients like nagstamon. In my experience, these are usually screen-scrapers, and their decisions about what to notify aren't based on NAGIOS' notification logic. If your client honours NAGIOS' built-in rules, it should be fine; otherwise, you'll have to work with that particular tool to add a similar logic.