Page 1 of 2

Host vs Service check

Posted: Mon May 19, 2014 2:39 am
by klee
How exactly do I distinguish between what is set up as a Host check vs a Service check?

For example, if I download a Monitoring Wizard, how do I tell which type of check it does.

Even if I can tell (while initially setting it up) because the service is totally self-explanatory, such as Website Wizard (Monitor a website), which monitors HTTP service...

What happens when I return to it after an extended period of time...

Nagios automatically created a Host definition for it, in addition to the Service definition...

How do I distinguish between what was originally set up as a Host check vs a Service check?

Thanks,

-klee

Re: Host vs Service check

Posted: Mon May 19, 2014 10:03 am
by tmcdonald
Typically a wizard will create a single host and several services attached to it. There are commands in XI that have names like "xi_wizard_whatever" that should let you know if a wizard created them for the most part. Otherwise in the Misc Settings tab for the service in the CCM you can view the "Manage Variable Definitions" link and look for the "_xiwizard" variable that should tell you which wizard created the service.

Re: Host vs Service check

Posted: Mon May 19, 2014 1:50 pm
by klee
Please allow me to clarify. The following is from a previous thread:

--------------------------------------------------------------------------------
Re: macros return as $
Postby abrist ยป Mon Apr 07, 2014 11:04 am
Are you sure this event is configured on a service and not the host?
--------------------------------------------------------------------------------

How can I easily tell if the wizard initially defined a Host Check or a Service Check?
This is so I won't make the mistake of creating event handlers for the wrong thing, attempting to use macros intended for services instead of hosts (or vice versa), or submitting passive check results for the wrong thing?

Re: Host vs Service check

Posted: Mon May 19, 2014 2:01 pm
by tmcdonald
Well as I said before, a wizard will usually create both a host and a service. You can look in the custom variables for a host/service to see which wizard created it. If you see that the wizard created Host A, and services SB, SC, and SD are attached to it, there is a good chance they will have the same variable value listed.

Re: Host vs Service check

Posted: Mon May 19, 2014 3:59 pm
by klee
So for example, if I install Linux Server Wizard to monitor a remote Linux server,

By default, is that considered a host check or a service check?

Re: Host vs Service check

Posted: Mon May 19, 2014 4:01 pm
by slansing
I think you may be getting your terms messed up a little bit. A wizard is simply a tool with which you create host and service checks. Each wizard will create One host, with it's personal ping check, and the metrics which you set thresholds for during the first step of the wizard are your service checks. For instance, if you ran the Linux Server Monitoring Wizard right now, you could deselect all of the check boxes such as Load, Processes, etc, and all you would be left with would be the host it would create and assign to the address you gave the wizard.

Re: Host vs Service check

Posted: Mon May 19, 2014 4:01 pm
by tmcdonald
A physical machine should always be a host, whereas a program running on that host is a service. So in your example that would be a host. Then if you tell it to monitor HTTP on that server, that would be a service check.

Re: Host vs Service check

Posted: Mon May 19, 2014 4:12 pm
by Box293
I'll ty explaining it a different way.
  • You have a windows server which you want to monitor the disk space, memory and cpu usage
    Disk space, memory and cpu usage checks are all "services"
    But before you can create a service, you need to create a host object first
  • Nagios needs to know if the host object is up or down
    So a host object itself has a check performed against it, which is normally a ping test
    The ping test check is defined in the host objects configuration
    The host itself gets the macro $HOSTADDRESS$
  • When creating the services for each of the disk space, memory and cpu usage checks, the command usually needs to know the address of the host you are contacting
    This could be defined statically in each service as 192.168.1.45 OR $HOSTADDRESS$
    If the $HOSTADDRESS$ macro is used, if you change the IP address of the host later on, you only need to change the address in the HOST OBJECT definition as all the services using the macro will automatically use the new address
So when you are creating event handlers, they use macros from the service AND the host object.

Re: Host vs Service check

Posted: Mon May 19, 2014 4:14 pm
by klee
Right, exactly =)

So all i'm asking is if there's an easy way to tell what it was set up as by default.

It may seem apparent now, when I'm installing the wizard, but what happens week/months in the future?

Particularly when we're watching 200-300 machines (each of which has host and service definitions)?

Thanks,

-klee
PS: I posted this at the same time as your post above... I'll have to read that first....

Re: Host vs Service check

Posted: Mon May 19, 2014 4:26 pm
by klee
...right exactly (and I am sorry for belaying the point)...

As you said:

"Nagios needs to know if the host object is up or down
So a host object itself has a check performed against it, which is normally a ping test
The ping test check is defined in the host objects configuration
The host itself gets the macro $HOSTADDRESS$"

How is one to know "the ping test check is defined in the host objects configuration"? One can interpret Ping as an service using the ICMP protocol.

This all goes back to the host-specific/service specific macros we'll need to distinguish between when writing event handlers.

Even with the macro list Nagios provides, how can one know when we're supposed to use host-specific/service specific macros, when we're not sure which is host and which is service?

Hope that makes sense...

Thanks,

klee