Need help with manual BBGEN report
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
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
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?
-- 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
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
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
In <20050315214018.GC8725 at qwestip.net> Asif Iqbal <iqbala-hobbit at qwestip.net> 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
participants (2)
-
henrik@hswn.dk
-
iqbala-hobbit@qwestip.net