problem with services file.

Carroll, Jim P [Contractor] jcarro10 at sprintspectrum.com
Fri Jan 31 03:47:54 CET 2003


I noticed that Michael Halligan and Robert Galloway have already commented.
I'll throw in my $0.02.

1) I've never had any problems with using tabs in object definitions.  If
anything, I make sure my config files have tabs.  I'd be curious to know
what error Michael had (and the usual version of Nagios/platform/etc).
Regardless, if you prefer spaces, then use spaces.

2) The blank line in your host definition isn't required.  Feel free to
remove it.

3) The semicolon at the end of the 'use' declaration isn't required, unless
you plan to append a comment to that line.

4) Something to file away for later:  You need not use the 'address'
declaration, so long as you either have the hostname/IP defined in
/etc/hosts of your Nagios server, or you have that hostname/IP defined in
your DNS namespace and have /etc/resolv.conf correctly configured.  (There
are advantages/disadvantages to each of these 3 approaches.  Just make a
note of it for now.)

5) Something which seems to trip up some Nagios neophytes (it did me) is the
distinction between a host check and a service check.  You can make a host
check anything you like.  By default, check-host-alive uses the check_ping
plugin.  Just think of a host check as "if this test fails, I can safely
assume everything else on the host is dead".  (Some might argue the
particulars of this proposal, but I'm hoping it'll be enough to get you
started.)  Unless you're trying to monitor a host on the trusted side of a
firewall from the untrusted side, you need not worry about any other
incarnations of the host check.  In any case, as Robert Galloway pointed
out, you can have one (and only one) host check for a given host (unless you
start working with host aliases, but let's not complicate your present
situation).  'Nuff said on that.

6) You still need to concern yourself with the service checks.  In the
trivial case, you could leverage check_ping.  You may notice that you would
then have a host check and a service check which both use check_ping.  This
might seem redundant, but the logic of Nagios depends on the combination of
a host check with *some* service check for proper/complete operation.  If
you're doing something else (eg, check_smtp, check_http), you need not have
a service check which uses check_ping, although at least one subscriber to
this list prefers to have it anyway.  If you like, put it in now; you can
always remove it later.

It's also worth noting that while a service check name might be something
like check_smtp, this is not the same as a plugin called check_smtp.  This
subtle distinction might have you chasing your tail if you're not paying
close attention.  When you define a service check for a host, you're
effectively referencing a token.  If you refer to the checkcommands.cfg
file, you'll notice that quite a few of the command_name strings match the
basename of the command_line strings.  Why do this?  Because it affords you
a layer of abstraction.  Once you've got the basic services monitored and
you decide you want to do something which doesn't appear to exist, you can
create your own definition.  For example, you could create check_high_port
which essentially uses the check_tcp plugin to poke at port 9999 on whatever
host you decide to add this service definition to.  Again, wait till you've
got some basic monitoring working before you run off and attempt something
less obvious.  :)

Hope this gets you on track.

jc


> -----Original Message-----
> From: Ryan Cochrane [mailto:Ryan.Cochrane at webexpress.net.au]
> Sent: Thursday, January 17, 2002 7:09 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] problem with services file.
> 
> 
> Hi guys, sorry to bother you
> 
> I have finally got most of it working with auto and all!
> 
> I keep getting this error when i go to start it;
> 
> 
> Error: Invalid object definition type 'service(' in file
> '/usr/local/nagios/etc/services.cfg' on line 21.
> 
> 
> define host{
>         use                     generic-host            ;
> 
>         host_name               weig
>         alias                   Naigos Monitoring #1
>         address                 203.31.71.22
>         check_command           check-host-alive check_http check_smtp
>         max_check_attempts      10
>         notification_interval   120
>         notification_period     24x7
>         notification_options    d,u,r
>         }
> 
> 
> any pointers would be really good, ive been playin with it 
> for 3 hours now.
> :/
> 
> 
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com




More information about the Users mailing list