1

I'm monitoring a server with Nagios. I've configured it like this:

host{
name http_server
}

service{
name check-http
host_name http_server
check_command check_http
}

What I'm trying to achieve is that when any of the services fail, the host falls under that state. This way I can monitor from the Status Map or have a better overview of the whole system.

Thanks!

3 Answers 3

1

hmmm.

I don't think its ideal to use the service monitoring as the host monitoring. A better solution might be to do a check on port 80 as the test for the host (if ping is not possible) and then a more specific check (e.g. for a 200 response or validating the content) in the HTTP check.

1

I wouldn't attempt to do that. I would use the the "tactical overview" or the "Problems" pages. If you need something fancier have a look at NagVis.

0

In the example you give you only have one service on the host. In that case, I have a simple answer for you!

host{
    name http_server
    check_command check_http
    }

This will make the status of the HOST depend on the status of the command.

If you have multiple services you want to join together, here is an approach to consider, but I am not sure if it will work.

  • Create a new service representing the overall state of the machine. It doesn't much matter what its check_command actually is - perhaps check_dummy?
  • Create a set of ServiceDependency objects that make that new service depend on all the other services on the host you are interested. So, when they fail, this service also fails (or is in warning or unknown, or whatever you prefer.)
  • Make this new service the check_command for the host.

The last step I am unsure about. It requires passing a service as a command to check_command, and I don't know if that is really legal.

You must log in to answer this question.

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