Xymon Mailing List Archive search

"include: command not found" in apache logs

list Japheth Cleaver
Wed, 25 Jul 2012 21:36:59 -0700 (PDT)
Message-Id: <user-c7f55cb7fd20@xymon.invalid>

There are a couple of shell scripts under cgi-bin that do this:

 . /path/to/xymonserver.cfg

Unfortunately, I have an "include" in that file.  So whenever I either do
a
report (report.sh) or look at a snapshot view (snapshot.sh) I get this
kind
of thing in the Apache log:

[Wed Jul 25 09:45:18 2012] [error] [client 192.168.1.11]
/usr/lib/xymon/server/etc/xymonserver.cfg: line 4: include: command not
found, referer: https://servername/xymon-cgi/report.sh

My include specifies a file called xymonserver-local.cfg, in which I
define
server-specific configurations such as XYMONSERVERHOSTNAME and
XYMONSERVERIP.  So these won't be seen by these two CGI scripts.  I doubt
that any of the definitions in my include file are important.  However, if
I had ALL of my definintions in an include file, and xymonserver.cfg
consisted only of "include otherfile.cfg", I wonder what would break.

It's obvious that the way the definitions are added into the CGI script's
environment is not appropriate for the type of file - "Even though it
might
look like a shell-script, it is NOT."  Furthermore, this extra line
appears
to be redundant, given that $CGI_SNAPSHOT_OPTS and $CGI_REP_OPTS both
include "--env $XYMONENV", and $XYMONENV is set to
/path/to/xymonserver.cfg.  So I suspect that this line can be taken out
altogether.

Cheers
Jeremy

I've proposed a patch to help with this kind of situation which adds
"source " and ". " as synonyms for "include " to give you a little more
flexibility in this regard.

(Obviously, this would only work with single sourced files and not the
full-on "directory " directive.)

Does this seem like it would do what you need?


Regards,

-jc
Attachments (1)