Why are there "commands"?

David Rosenstrauch darose at darose.net
Fri Aug 28 20:02:07 CEST 2009


On 08/28/2009 01:18 PM, David Dyer-Bennet wrote:
> I don't really understand the purpose / utility of the "command" level of
> abstraction in Nagios configuration.  (2.10; we're still on Centos 4.7).
> 
> To define a new service to check particular Windows web services we've
> written, I define a service, and then it has to refer to a command, and
> over in the command I have to hard-code the parameters needed to test this
> specific service -- so in fact I need a separate command for each service.
>  This seems, to me, to just introduce confusion, and separate bits of
> information that belong together.
> 
> Is this just a historical artifact that in fact doesn't make much sense,
> or are there lots of cases where it's useful and makes it easier or
> clearer to do what you want?
> 
> (I'm fine with "that's the way it works, but it doesn't really make much
> sense as it turns out", I've got plenty of that in my own code; I'm just
> looking for more understanding, in case it makes more sense than I've so
> far figured out.)

I can't speak to Nagios v2.x, but at least on Nagios 3.x the command 
definitions have variable, not hard-coded, parameters.  So the command 
definition essentially winds up being the general definition of what you 
want to check (e.g., check that a web server is up, using the check_http 
plugin), while the service definition provides specific details of which 
machine(s) should be checked using the command and how.  (e.g., check 
that the web servers on boxes 1, 2, and 3 are up, that page /news.html 
doesn't return a 404, and that the page contains the text "News".)


> As a broader question, are there documents that give more of a logical
> overview of Nagios, explaining how and why things are broken up and how
> they work together?

Again, I'm responding for Nagios 3.x, but the docs are here:

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

Perhaps there's also docs on the site for v2.x.

HTH,

DR

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list