Koozali.org: home of the SME Server
Obsolete Releases => SME 7.x Contribs => Topic started by: shodanki on September 07, 2008, 11:22:59 AM
-
I have installed awstats acourding to the how to for die Qmail statistics and basicly it works fine.
but since then i hav every hour an error report from cron that states this :
subject: /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mail >/dev/null
/bin/ls: /var/log/qmail/*.s: No such file or directory
/bin/basename: too few arguments
Try `/bin/basename --help' for more information.
How do i fix it ?
regards
shodan
-
I had the same problem
I noticed the /etc/e-smith/templates-custom/etc/crontab/awstats file pointed to a different location to where my awstats is located. So all I did was change it to point to /var/www/awstats/awstats.pl
then I rebuilt the template by /sbin/e-smith/expand-templates /etc/crontab
Hope that might be of some help to you. If not I hope someone here could please correct me (in a nice fashion would be great :-)
-
The pre-processor script has a bug. It can not deal with missing rotated log files. I'll fix it.
-
A fixed qmail-awstats-setup.v2.sh script is immediately available here (http://neddix.com/sme7/Qmail-AWStats/qmail-awstats-setup.v2.sh) and from the updated Wiki page as soon as the mirrors have synced.
-
I had the same problem
I don't think so. Are you sure that you have installed awstats-6.7-1 from Sourceforge and not installed or updated the RPM from the dag repository? The EL4 RPM from dag is incomplete, a needed script is missing. Cannot remember what it was a the moment.
-
Jep , fixed the problem.
thanks for the quick solution.
regards
Shoddan
-
Hi,
Same problem here. Every hour i receive an email:
Cron <root@yoda> /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mail >/dev/null
/usr/bin/test: too many arguments
I've fixed changing the first line of /home/e-smith/awstats/qmail-preprocessor.sh
from:
/usr/bin/test ! -f /var/log/qmail/*.s && /bin/touch /var/log/qmail/awstats_dummy.s
to:
/usr/bin/test ! -f "/var/log/qmail/*.s" && /bin/touch /var/log/qmail/awstats_dummy.s
tnx for the contrib
z
-
It appears the problem stems from awstats being installed from the wiki:
http://wiki.contribs.org/AWStats
Then the how-to is being followed from here:
http://wiki.contribs.org/Qmail_Statistics_(AWStats)
**NOTE** This could break your installed awstats! The template 86awstats redirects the installed awstats away from the /var/www install
directory. To fix your installed awstats copy or move the 86awstats from the templates-custom and signal-event post-upgrade signal-event reboot.
The install script v2 ports Qmail_Statistics_(AWStats) to the /usr/local/awstats/wwwroot where a "standard" linux package would be placed.
For it to work correctly with the SME contrib and display this in the panel manager the fixes seen are not suitable to display the information from within
server-manager.
Since I'm no coding guru maybe we could encourage the maintainer to rewrite the script to be compatible with the awstats contrib.
Paul
-
I, too, am getting this message every hour. The body of the email says:
/usr/bin/test: /var/log/qmail/@40000000493422961eecb9a4.s: binary operator expected
I followed the howto from http://wiki.contribs.org/Qmail_Statistics_(AWStats) to install and configure and my qmail-awstats-setup.v2.sh file is dated as Sep 07, so I'm assuming it's the correct one.
So... which is the correct fix - the one posted by dz00te or the one posted by davelister?
-
Just installed it.. and I receive this message every 3 hours.
Subject: Cron <root@sme> /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mail >/dev/null
/usr/bin/test: too many arguments
any updates on the fix
-
Hi,
Same problem here. Every hour i receive an email:
Cron <root@yoda> /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mail >/dev/null
/usr/bin/test: too many arguments
I've fixed changing the first line of /home/e-smith/awstats/qmail-preprocessor.sh
from:
/usr/bin/test ! -f /var/log/qmail/*.s && /bin/touch /var/log/qmail/awstats_dummy.s
to:
/usr/bin/test ! -f "/var/log/qmail/*.s" && /bin/touch /var/log/qmail/awstats_dummy.s
tnx for the contrib
z
This is not a correct fix.
This line is intended to create a file /var/log/qmail/awstats_dummy.s only if there is no file with the pattern /var/log/qmail/*.s.
with your suggestion the dummy file will be created each time, resulting in data loss after a log rotate.
if you want to verify :
# /usr/bin/test ! -f "/var/log/qmail/*.s" && echo 'no files'
no files
# /usr/bin/test ! -f "/var/log/qmail/*.ds" && echo 'no files'
no files
# /usr/bin/test ! -f /var/log/qmail/*.s && echo 'no files'
/usr/bin/test: trop d'arguments
# /usr/bin/test ! -f /var/log/qmail/*.ds && echo 'no files'
no files
the correct patch would be :
/usr/bin/test ! `/bin/ls -l /var/log/qmail/*.s|grep -v ^l | wc -l` -ge 1 && /bin/touch /var/log/qmail/awstats_dummy.s
that way the script search for the existence of a number of regular files with the pattern *.s and if it is less than 0 create the dummy. If it is more than 0 do nothing AND returns no errors.
-
Good Day
I have installed as per the Wiki, and I get the following.. I have read the posts above, so which is the correct fix?
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=mail >/dev/null
/usr/bin/test: too many arguments
-
works fine with the one i gave
I've fixed changing the first line of /home/e-smith/awstats/qmail-preprocessor.sh
from:
/usr/bin/test ! -f /var/log/qmail/*.s && /bin/touch /var/log/qmail/awstats_dummy.s
to:
/usr/bin/test ! `/bin/ls -l /var/log/qmail/*.s|grep -v ^l | wc -l` -ge 1 && /bin/touch /var/log/qmail/awstats_dummy.s
-
Excellent, thanks..it worked