I get the same result if I use the resource.cfg-sample provide with the
install.
$ nagios -v /usr/local/etc/nagios/nagios.cfg
Nagios 3.0.2
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 05-19-2008
License: GPL
Reading configuration data...
Error: Unexpected token or statement in file
'/usr/local/etc/nagios/resource.cfg' on line 26.
$ cat resource.cfg
########################################################################
###
#
# RESOURCE.CFG - Sample Resource File for Nagios 3.0.2
#
# Last Modified: 09-10-2003
#
# You can define $USERx$ macros in this file, which can in turn be used
# in command definitions in your host config file(s). $USERx$ macros
are
# useful for storing sensitive information such as usernames, passwords,
# etc. They are also handy for specifying the path to plugins and
# event handlers - if you decide to move the plugins or event handlers
to
# a different directory in the future, you can just update one or two
# $USERx$ macros, instead of modifying a lot of command definitions.
#
# The CGIs will not attempt to read the contents of resource files, so
# you can set restrictive permissions (600 or 660) on them.
#
# Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)
#
# Resource files may also be used to store configuration directives for
# external data sources like MySQL...
#
########################################################################
###
# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/local/libexec/nagios
# Sets $USER2$ to be the path to event handlers
#$USER2$=/usr/local/libexec/nagios/eventhandlers
# Store some usernames and passwords (hidden from the CGIs)
#$USER3$=someuser
#$USER4$=somepassword
-----Original Message-----
From: Thomas Guyot-Sionnest [mailto:***@aei.ca]
Sent: Wednesday, June 04, 2008 10:27 PM
To: Andrew Edwards
Cc: Nagios-***@lists.sourceforge.net
Subject: Re: [Nagios-users] error when including resource.cfg
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Andrew EdwardsI have been recently working on upgrading my nagios1.0 install to
3.0.2
Post by Andrew Edwardsand whenever I have my resources.cfg file included in the nagios.cfg
file I get
Error: Unexpected token or statement in file
'/usr/local/etc/nagios/resource.cfg' on line 37.
and line 37 is where I define $USER1$ is defined and I get this error
on
Post by Andrew Edwardsevery $USERx$ that is defined. I'm installing on freebsd7 from ports
and the only thing I found searching online is a reference to a
minimal.cfg but I don't know how to tell if that's my problem.
I suggest you look for typos, misspelled macros, leading and trailing
spaces in there... Otherwise make a copy of it with non-sensitive data,
verify it still breaks and send it over (as attachment) for inspection.
Thomas