checkcommands.cfg problems...

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Mon May 5 08:07:46 CEST 2003


Dear Sir,

I am writing to thank you for your letter and say,

On Sun, May 04, 2003 at 03:53:41PM -0300, Pablo Medrano wrote:
> Hi !!!
> 
> Im sorry ! 
> I speak little english (you are doing fine.)

> 
> I having problems with nagios.
> 
> when I try to run :
> 
> nagios -v /etc/nagios/nagios.cfg
> 
> ...put back the next message :
> 
> Error: Unexpected token or statement in file '/etc/nagios/checkcommands.cfg' on line 43
> 
> And replacing or comment that line (#) in file, its the same error with the next line
> (i.e.  "...on line 51" )
> 
> I can not understand the real problem.
>

The real problem is that the the checkcommands.cfg file is poorly formed 
and the Nagios configuration file parser is objecting to the poorly 
formed part.

(It is hard aparently for parsers to report accurate error information. 
Also they do not handle grossly malformed 'sentences' very gracefully: 
they simply report a whole bunch of correct but unhelpful messages).
 
> Im using nagios-1.0 on Debian, and its an unstable package on SID.
> I can generate the checkcommands.cfg automaticaly with the Debian script:
> update-nagios
> this script check the plugins, and convert in correct checkcommands.cfg format file
> 
> I need help !!!
> 
> Thanks and regards ! and Im sorry for talking like Tarzan :D
>

What I suggest is 

1. abandon use of the 'update-nagios' script until later (util at least 
you understand what it should be producing)

2. read the docs about the configuration file format and make sure that 
you understand what the checkcommands file should look like.

Unfortunately there are two config file formats.

The two files are TEMPLATE and (I don't know) OLDSTYLE.

<path_to_nag>/bin/nagios -m will tell you which format your Nag has been 
compiled with

eg

tsitc# /usr/local/nagios/bin/nagios -m

Nagios 1.0
Copyright (c) 1999-2002 Ethan Galstad (nagios at nagios.org)
Last Modified: 11-24-2002
License: GPL

External Data I/O
-----------------
Object Data:      TEMPLATE

  .. yada ..
tsitc# 

Here is what a valid TEMPLATE checkcommands.cfg looks like

define command{
        command_name    check_tcp
        command_line    $USER1$/check_tcp $HOSTADDRESS$ -p $ARG1$
        }

# it defines only _one_ check command (named 'check_tcp').

3. It is hard to deal with syntax errors in these files (partly becuase 
of the problems noted above).

Therefore

3.1 use revision control

3.2 start small

Define a minimal services, hosts, contacts, contactgroups, checkcommands 
_manually_ with one host, one service, one contact, etc.

When you userstand how they are built, you can again (manually) edit 
them or fix what ever you have.

3.3 Be prepared to cut out (or comment) big chunks. Put it back once you 
it is clean. 



> Pablo Medrano
> 
> (from Argentina)
>

Yours sincerely. 

-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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