[hobbit] Need help with manual BBGEN report

Henrik Stoerner henrik at hswn.dk
Tue Mar 15 22:01:39 CET 2005


On Tue, Mar 15, 2005 at 01:37:39PM -0500, Asif Iqbal wrote:
> I have this script which is suppose to create a monthly report as a
> cronjob, but it never worked with hobbit. It used to work fine with
> bb1.9c with bbgen 3.2

> Here is the script
[snip]
> BBHOME=/export/home/hobbit/server
> . $BBHOME/etc/hobbitserver.cfg
> BBWEB=/reports/monthly/$YEAR/$MONTH \
> $BBHOME/bin/bbgen --reportopts=$START:$END:1:crit \
>         --larrd043 --ignorecolumns=ssh,bbgen,bbtest --subpagecolumns=2 \
>         /usr/local/apache/htdocs/reports/monthly/$YEAR/$MONTH

Instead of source'ing the hobbitserver.cfg, try running the script via
the "bbcmd" tool. I.e.

   cd ~hobbit/server
   ./bin/bbcmd --env=etc/hobbitserver.cfg report.monthly.sh


> When I run it I get this as output
> 
> report.monthly.sh: -l: not found
> report.monthly.sh: -Pk: not found
> report.monthly.sh: -Pk: not found
> report.monthly.sh: ax: not found

These are symptoms of hobbitserver.cfg entries that aren't quoted.
E.g. you probably have a line
   DFCMD=df -Pk
which works OK as long as Hobbit interprets it, but fails with a
shell; instead, it should be
   DFCMD="df -Pk"

When hobbitserver.cfg was updated to include the BB client side
commands, I forgot to quote those commands. That's what is biting you
now.


> 2005-03-15 13:38:09 xgetenv: Cannot find value for variable BBREPGREEN

Missed that one in hobbitserver.cfg. It will default to a reasonable
value, so the warning is harmless - but annoying.


> 2005-03-15 13:38:09 xgetenv: Cannot find value for variable MACHINE
> 2005-03-15 13:38:09 Environment variable MACHINE not defined

This one is setup by bbcmd, based on the MACHINEDOTS setting, which is
why it isn't listed in hobbitserver.cfg. Running the script via bbcmd
should fix it.


Regards,
Henrik



More information about the Xymon mailing list