2

I'm looking for a little direction on this one. We have 8 mobile servers, and at anytime one can go offline and be moved to a different location. I don't want Nagios to send me an alert if a system goes offline. I would like it to just send an alert on a service, CPU gets to hot, etc. I have everything working fine as of right now, apart from the fact that I get alerts when the system goes down.

As I said these servers are online and offline constantly over the course of a two week period. So getting a message at 3:00AM on a Saturday telling me a system is offline, I can care less about. I'm more concerned about something overheating. So any advice would be appreciated on how to tackle this?

3 Answers 3

5

You probably want to switch off host notifications, rather than host checks. Nagios only alerts on service failures if it thinks the host is up; if you switch off host checks then you will get a flood of service notifications when the host goes away.

To switch off host notifications, set notification_options to n like this:

define host {
    use                    generic-host
    host_name              example
    address                192.168.1.254
    notification_options   n
}

(assuming you have a definition of generic-host somewhere else)

1

Not sure I understand correctly, but you want only the service notification, not host checks?

If this is the case, you can probably do it in the config, but in the past I have just gone into the web interface, click 'Host Detail', then the host, and then "Disable notifications for this host".

Maybe for the config, you just don't specify a check_command in the host definition or any templates that the host definition inherits from?

Update:
Okay, so maybe you want to make it so in the notification_options for the service, you don't include u which is for 'send notifications on an UNREACHABLE state'. It might be something like service_notification_options as well, look at these in this object definitions section of the Nagios documentation.

Another route that I think you might be able to take is to make the services a dependency of the host checks, and not get notified of the host checks. Not as sure about this option though.

None of this is an exact answer, but hopefully points you in the right direction...

3
  • I know it's strange. These servers run in high humidity areas and can be moved at a moments notice and go offline for 3-15 hours. Due to the fact that uptime and downtime is so dynamic I don't care if it get shut down and moved. but I do care if it gets to 103f and my systems start to have overheating issues. Hope that makes more sense? Jan 8, 2010 at 13:28
  • Let me give that a try, thanks for the tip will update on how it works! Jan 8, 2010 at 13:38
  • Also, you might want to consider keeping the host checks, and making the thresholds very high, so you will get notified if a host has been down for more than 15 hours. Jan 8, 2010 at 14:50
0

If I'm understanding correctly, you want to monitor services attached to the host but not the host itself.

The key is to use a host definition which does not define check_command. You may, for example, be extending host definition linux-server - this does define check_command and so is unsuitable. Instead you should use, for example, generic-host e.g.

define host{
    name                            nocheck-host
    use                             generic-host
    }

One caveat to be aware of is that if Nagios already has your host in a 'down' state it may stay in a down state after Nagios restart. Because Nagios thinks its down, it won't send notifications for the services. To get around that you can send a passive check to the host to force Nagios to reset the state of that host (do this from the web frontend).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.