Please define "defined" in this context

Marc Powell marc at ena.com
Wed Jun 3 16:27:58 CEST 2009


On Jun 3, 2009, at 8:13 AM, Whit Blauvelt wrote:

> Hi,
>
> Starting to set up Nagios, and puzzled at something that must be  
> simple, but
> the language is unclear

Welcome...

> define service{
>        use                             local-service         ; Name  
> of service template to use
>        host_name                       realhost
>        service_description             HTTP
>        check_command                   check_http -- 
> authorization=httpuser:pass
>        notifications_enabled           0
>        }
>
> But that doesn't work:

Correct, it won't. The check_command is the short name that references  
a command{} definition, with optional !-separated parameters.

> # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
> ...
> Error: Service check command 'check_http -- 
> authorization=httpuser:pass' specified in service 'HTTP' for host  
> 'realhost' not defined anywhere!
>
> What does "defined" means in this context?

There is no command{} definition with a command_name of 'check_http -- 
authorization=httpuser:pass' and corresponding command_line to be  
executed.

> What does "anywhere" mean?

In any cfg_file referenced by nagios.cfg.

> I'd say that the command is well-defined, in that check_http is a  
> standard
> request, and it's being followed by one of the flags it defines in  
> its help.
> Plus, that overall action is being defined right in "localhost.cfg".

Your guess was wrong and you misunderstand what it is you're changing.  
check_command is a reference to a command_name in a command{}  
definition. The corresponding command_line would be executed for the  
check and that's where you need to make your change.

> In the context of Nagios "not defined" and "anywhere" must be terms of
> art, rather than common English. How can a beginner learn what they  
> mean in
> Nagios-speak? What's the "where" to put the "definition" to make  
> this simple
> http login request work?

Reading the documentation would be a good start. I highly recommend  
you read through them fully at least once. Much time has been spent on  
them to address questions such as this and they're very thorough. All  
the objects are referenced as Definitions so 'not defined' isn't art  
so much as English. The terminology is used extensively within the  
docs. Some good starting points --

http://nagios.sourceforge.net/docs/3_0/config.html
http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html

and this one will help you generalize the check you're trying to do --

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

--
Marc


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
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