Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am having a hard time trying to get my head around some of the more basic concepts of Nagios that I thought would be straight forward.

Basically, as well as the standard local infrastructure, I need to monitor a bunch of 3rd party web services, all of which I have web addresses for.

I simply can't decide how this should be organised. Each one requires me to create a new service which I understand, but after this...

Should I create a single host called "3rd party" along with 3 services that are linked to it, or should I create 3 new hosts with the name of the site, the 3 services and link them one to one?

My preference is to single hosts for each service as each service is independent of each other and I believe that is the way Nagios should be setup.

Along with this, these servers are not reachable by ping. By default, it reports as down. I have tried to disable the check_command check-host-alive, but, this just appears to make the host stay grey...

...Is there anyway I can make the host stay green if the only service is green and/or if I change the check_command to the service as above, will this do two checks to the web service, or even, is having the check_command on its own enough and I don't need to assign the service?

So, the real questions are...

  1. Should I be using one host per independent service as these are officially different "hosts"?
  2. When a host is only a single service and not reachable by ping, what are the best practices as above?
  3. (sort of extra) For organising Nagios, what is the best way to group these hosts? Is this what dependencies are for?
share|improve this question

1 Answer 1

up vote 5 down vote accepted

I think the answer to your question is not definitive, but will reveal itself over time as you develop a deeper understanding of how Nagios works. Services are generally tied directly to the host they run on, but as you are discovering, that is just a convention. A convention that works and provides some shortcuts, mind you, but a convention, nonetheless.

Also know that that you can define any check as the host check. It does not need to be ping. Perhaps check_http is better for your use.
See the image and host definition I use to check internet connectivity

define host{
use         generic-host,host-pnp       ; Name of host template to use
host_name       www.microsoft.com
alias           www.microsoft.com
address         www.microsoft.com
check_command       check_http
.
.
.
}

Given what you've said, I would create a dummy service with a bunch of you third party services tied to it for now and adjust it as you see fit.

To address your 3rd question, if you go the route of a host per service, you could use a host or service group to group them for display.

share|improve this answer
    
Thank you for this... I just want to confirm, it is perfectly fine/valid to have a host with the command and no services attached to a host? ... In addition, can I have a host without any check commands at all, just so I can have a name for parent objects to drawn out the map? –  William Hilsum Jul 1 '12 at 22:39
    
Let me add to this... For example, I have been looking at a few publically accessible Nagios Server such as this - 0i3.com:1777/nagios/?fromugsite=true and taking 8.8.8.8 Google DNS as an example, it is listed both as the host command and as the service - I can see it is doing two checks at two different times... I just don't understand if this is correct behaviour or not. –  William Hilsum Jul 1 '12 at 22:51
    
FWIW where you can't ping a remote webserver, then you might setup the host check_command as testing port 80 open, but have a service checking the content of the response to an http request. –  symcbean Jul 2 '12 at 8:37
    
Nagios has few rules in this area. As I said in my answer, as you grow to better understand it, you'll get this and possibly change you approach. On your example you should see that the dns check for the host definition isn't enables (active checks enabled - no) and the check interval is 0 so the check isn't doing anything. But the alternative is to have the host check_command be active and do exactly what you want with no services defined. –  uSlackr Jul 3 '12 at 1:53
    
I almost feel silly asking this, but, if active checks is set to no, what is the point of having it as a host_check? :/ ... I am marking this as answer and will just do a lot more experimenting myself. –  William Hilsum Jul 3 '12 at 10:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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