Page 1 of 2

Check Commands

Posted: Fri Apr 18, 2014 10:15 am
by klee
Nagios CCM > Monitoring > Hosts > MY HOST > Host Management > Check command

Unfortunately, I have not been able to find any documentation explaining the various "Check command(s)"

How do we know which one is appropriate to use?

Thanks,

-klee

Re: Check Commands

Posted: Fri Apr 18, 2014 10:31 am
by tmcdonald
Check commands are how you define what plugin to use for a given host or service. Usually they will be named after the plugin, so the check_http command will run the check_http plugin with various arguments. Really straightforward. As for knowing which to use, that should be pretty clear in most cases. If you want to monitor DNS, use check_dns. The hard part is determining which arguments to use. For that I refer you to the Nagios Plugins Manuals page: https://nagios-plugins.org/doc/man/index.html

Re: Check Commands

Posted: Fri Apr 18, 2014 10:43 am
by klee
Hi Tmcdonal,

Does this mean if I defined the action via the Monitoring Wizard, and chose 'Windows WMI' wizard, I should choose 'check_xi_service_wmiplus' as the corresponding Check Command?

If so, may I ask why this field isn't populated automatically?

Under what circumstances would I have to choose a command (from Check Command) that doesn't match its plugin?

Thanks Again,

-klee

Re: Check Commands

Posted: Fri Apr 18, 2014 10:54 am
by slansing
No, the wizards create their hosts/services and populate the fields for you. There is no specific documentation covering the list of check commands, because of their simplicity it is not really required.

Re: Check Commands

Posted: Fri Apr 18, 2014 11:17 am
by klee
Yes, the wizards do create hosts/services and populate the fields for us... However:

When I define a Service through: Monitoring Wizard > Website: Monitor a Website, then go to: Nagios CCM > Monitoring > Services > Service Description > Service Management

The Check Command field is automatically defined as "check_xi_service_http".

But when I go to: Nagios CCM > Monitoring > Hosts > MY HOST > Host Management, the Check Command field is empty by default.

It is easy enough to manually choose the command (if indeed there is an corresponding command for each plugin).

But my question is: is there a situation where we would not choose a corresponding plugin (is that why Nagios leaves that field empty by default)?

Also, what is the relationship between a wizard and a plugin?

Thanks,

-klee

Re: Check Commands

Posted: Fri Apr 18, 2014 11:22 am
by slansing
Ah I see what you are asking, so those commands are typically used by templates, the templates are what the wizards assign, that is why it looks like there is nothing defined in the command field. If you were to manually create a host/service, you could use the check commands without issue, just be wary, that if you change a command used by a wizard, it may alter how well the wizard behaves when defining checks.

Wizards are simply a easy step by step process for creating your hosts/services, you can do the same through the CCM by hand. Many users do create services for their hosts by hand because they want to use custom plugins which are not used in the wizards. Plugins themselves are what nagios uses to either actively check hosts/service metrics, or are ran passively on a system and the information they output is pushed back to nagios to change your host/service states.

http://nagios.sourceforge.net/docs/3_0/ ... tions.html

Re: Check Commands

Posted: Fri Apr 18, 2014 11:30 am
by klee
Am I conflating 2 different items? Am I confusing Host checks vs Services checks again?

Perhaps Nagios does populate the Check Command field by default...

Maybe I'm looking in the wrong place...

Say for instance WMI monitor, how do I know if it's a service check or a host check?
Because I was looking at 'Check Command' under Host instead of Service (since Nagios does create a corresponding Service object of Host configurations and vice versa).

When I view 'Service Management' under Service, I do see:
Check command: check_xi_service_wmiplus
Command view
$USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$

Is this where I'm getting confused?

Re: Check Commands

Posted: Fri Apr 18, 2014 11:59 am
by sreinhardt
Service checks and host checks are interchangeable, and within the core and XI behave exactly the same with the exception of what they are assigned to. That said, I just want to reiterate slansings post that when a wizard creates a host or service, the fields are empty because the host\service is inheriting a template instead of applying everything directly to the object itself. So they are still there, just in another configuration file.

Re: Check Commands

Posted: Fri Apr 18, 2014 12:10 pm
by klee
So if the template says that it's a service check, then Nagios automatically fills in the check command under services but not host config, yes?

Plus, are service check and host checks really interchangeable (because many macros are exclusive to either/or)?

Re: Check Commands

Posted: Fri Apr 18, 2014 12:18 pm
by tmcdonald
klee wrote:So if the template says that it's a service check, then Nagios automatically fills in the check command under services but not host config, yes?
It is a little more complicated than that, but basically yes. When you create a service in a wizard it will create a host for it because you cannot have a service without a host to attach to. The service created gets a check command because it needs to be specific to that service. However, the host that is created gets a template (because it doesn't really matter how we check the host) and that template gives the check command, usually just check_ping or something depending on the wizard.
klee wrote:Are service check and host checks interchangeable (because many macros are exclusive to either/or)?
They are not interchangeable, but they are quite similar in how they function.