Check Commands

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Check Commands

Post 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
Last edited by klee on Fri Apr 18, 2014 10:33 am, edited 1 time in total.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check Commands

Post 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
Former Nagios employee
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Re: Check Commands

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Check Commands

Post 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.
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Re: Check Commands

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Check Commands

Post 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
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Re: Check Commands

Post 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?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Check Commands

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Re: Check Commands

Post 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)?
Last edited by klee on Fri Apr 18, 2014 12:19 pm, edited 1 time in total.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check Commands

Post 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.
Former Nagios employee
Locked