Xymon Mailing List Archive search

Need help with manual BBGEN report

5 messages in this thread

list Asif Iqbal · Tue, 15 Mar 2005 13:37:39 -0500 ·
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

#!/bin/sh
#
[ "$#" -gt 0 -a "$#" -lt 3 ] && echo && echo Usage: $0 [31 Jan 2004] &&
exit 1
[ "$#" -gt 3 ] && echo && echo Usage: $0 [31 Jan 2004] && exit 1
DAY=$1
MONTH=$2
YEAR=$3
DATE=/usr/local/bin/date
MKDIR=/usr/local/bin/mkdir
DAY=${DAY:=`$DATE +%d`}
MONTH=${MONTH:=`$DATE +%b`}
YEAR=${YEAR:=`$DATE +%Y`}
START=`$DATE +%s --date="01 $MONTH $YEAR 00:00:00"`
END=`$DATE +%s --date="$DAY $MONTH $YEAR 23:59:59"`
$MKDIR -p /usr/local/apache/htdocs/reports/monthly/$YEAR/$MONTH
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

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
report.monthly.sh: -n: not found
report.monthly.sh: /dev: cannot execute
report.monthly.sh: WARNING: not found
2005-03-15 13:38:09 xgetenv: Cannot find value for variable BBREPGREEN
2005-03-15 13:38:09 xgetenv: Cannot find value for variable MACHINE
2005-03-15 13:38:09 Environment variable MACHINE not defined
2005-03-15 13:38:09 Aborting

I am running RC5. The report page is empty.

Thanks for any help

-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
"It is not the strongest of the species that survives, not the most intelligent, but
 the one most responsive to change."    - Charles Darwin
list Henrik Størner · Tue, 15 Mar 2005 22:01:39 +0100 ·
quoted from Asif Iqbal
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
quoted from Asif Iqbal

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.
quoted from Asif Iqbal

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
list Asif Iqbal · Tue, 15 Mar 2005 16:40:18 -0500 ·
quoted from Henrik Størner
On Tue, Mar 15, 2005 at 10:01:39PM, Henrik Stoerner wrote:
On Tue, Mar 15, 2005 at 01:37:39PM -0500, Asif Iqbal wrote:
(hobbit)@bigbrother:~/server$ ./bin/bbcmd --env=etc/hobbitserver.cfg report.monthly.sh
2005-03-15 16:41:02 xgetenv: Cannot find value for variable ADDR
2005-03-15 16:41:02 execvp() failed: No such file or directory

Do I have to add any channel?
quoted from Asif Iqbal

-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
"It is not the strongest of the species that survives, not the most intelligent, but
 the one most responsive to change."    - Charles Darwin
list Asif Iqbal · Tue, 15 Mar 2005 16:51:20 -0500 ·
quoted from Asif Iqbal
On Tue, Mar 15, 2005 at 04:40:18PM, Asif Iqbal wrote:
On Tue, Mar 15, 2005 at 10:01:39PM, Henrik Stoerner wrote:
On Tue, Mar 15, 2005 at 01:37:39PM -0500, Asif Iqbal wrote:
(hobbit)@bigbrother:~/server$ ./bin/bbcmd --env=etc/hobbitserver.cfg report.monthly.sh
2005-03-15 16:41:02 xgetenv: Cannot find value for variable ADDR
2005-03-15 16:41:02 execvp() failed: No such file or directory
Fixed the ADDR problem

Here is what I get now

(hobbit)@bigbrother:~/server$ ./bin/bbcmd --env=etc/hobbitserver.cfg report.monthly.sh 
2005-03-15 16:52:41 execvp() failed: No such file or directory
quoted from Asif Iqbal
Do I have to add any channel?
-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
"It is not the strongest of the species that survives, not the most intelligent, but
 the one most responsive to change."    - Charles Darwin
list Henrik Størner · Tue, 15 Mar 2005 21:52:59 +0000 (UTC) ·
quoted from Asif Iqbal
In <user-a83415011723@xymon.invalid> Asif Iqbal <user-c8222abeff59@xymon.invalid> writes:
On Tue, Mar 15, 2005 at 10:01:39PM, Henrik Stoerner wrote:
On Tue, Mar 15, 2005 at 01:37:39PM -0500, Asif Iqbal wrote:
(hobbit)@bigbrother:~/server$ ./bin/bbcmd --env=etc/hobbitserver.cfg report.monthly.sh
2005-03-15 16:41:02 xgetenv: Cannot find value for variable ADDR
2005-03-15 16:41:02 execvp() failed: No such file or directory
Do I have to add any channel?
No, but you do have to specify the path to your reporting script, when
it is not in PATH setting....


Henrik