Koozali.org: home of the SME Server

Awstats cron error

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Awstats cron error
« on: August 08, 2008, 11:21:33 AM »
Hi all,

For some time now I've been receiving this cron error - I've delayed resolution till now as awstat reports have not been essential till now.
Quote
/bin/bash: /usr/local/awstats/wwwroot/cgi-bin/awstats.pl: No such file or directory

Now /etc/awstats/awstats.localhost.localdomain contains the following:
Quote
DirData="/var/www/awstats"
DirCgi="/awstats"

And /etc/cron.hourly/00awstats-<server_name_removed>-lan the following:
Quote
#!/bin/bash

if [ -f /var/log/httpd/access_log ] ; then
   exec /usr/bin/awstats_updateall.pl now       -confdir="/etc"       -awstatsprog="/var/www/awstats/awstats.pl" >/dev/null
fi
exit 0

I can't figure out why cron is looking in /../cgi-bin/ for awstats.pl
Am I missing something (other than a bit of grey matter :-)) ?


« Last Edit: August 08, 2008, 11:24:04 AM by ardugh »
SME Server is a fantastic product - thank you!

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Awstats cron error
« Reply #1 on: August 08, 2008, 11:42:15 AM »
how did you install awstats?

ciao
Stefano

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Awstats cron error
« Reply #2 on: August 08, 2008, 12:54:49 PM »
nenonano,

A search of .bash_history shows:
Quote
wget -c wget http://prdownloads.sourceforge.net/awstats/awstats-6.7-1.noarch.rpm
/usr/bin/yum -y localinstall awstats-6.7-1.noarch.rpm

Should I uninstall that and go for the contribs version?:
Quote
yum --enablerepo=smecontribs install smeserver-awstats
SME Server is a fantastic product - thank you!

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Awstats cron error
« Reply #3 on: August 08, 2008, 02:14:02 PM »
yes :-D

Ciao
Stefano

Offline bloodshoteye

  • *****
  • 232
  • +0/-0
  • Grateful thanks to SME devs
Re: Awstats cron error
« Reply #4 on: August 22, 2008, 02:09:20 PM »
nenonano, apologies for long absence.

Quote
Should I uninstall that and go for the contribs version?:
I did that Plus reconfigure, etc. Also enabled awstats in the sme panel.

But I still get these errors - any ideas?:
Quote
/bin/bash: /usr/local/awstats/wwwroot/cgi-bin/awstats.pl: No such file or directory
I looked and, of course, there is no file there.

BTW, cron.hourly is the only cron that has an awstats entry:
Quote
Code: [Select]
#!/bin/bash

if [ -f /var/log/httpd/access_log ] ; then
exec /usr/bin/awstats_updateall.pl now -confdir="/etc" -awstatsprog="/var/www/awstats/awstats.pl" >/dev/null
fi
exit 0
I looked and awstats.pl is there.
SME Server is a fantastic product - thank you!

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Awstats cron error
« Reply #5 on: August 13, 2010, 05:31:03 PM »
But I still get these errors - any ideas?:I looked and, of course, there is no file there.

I fix mine... by hand... with no respect to templates till now:
change on cron the path of
Code: [Select]
/bin/bash: /usr/local/awstats/wwwroot/cgi-bin/awstats.plto
Code: [Select]
/var/www/awstats.pl

and in file
Code: [Select]
/home/e-smith/awstats/qmail-preprocessor.sh this:
/bin/cat $SRC /var/log/qmail/current | /usr/local/bin/tai64nlocal | /usr/bin/perl /usr/bin/maillogconvert.pl standard | /bin/grep -v ' alias-localdelivery-'


I hope this thread survive long enough to someone find out why it´s using wrong path.


...

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Awstats cron error
« Reply #6 on: August 13, 2010, 09:34:02 PM »
I fix mine... by hand... with no respect to templates till now:
change on cron the path of
Code: [Select]
/bin/bash: /usr/local/awstats/wwwroot/cgi-bin/awstats.plto
Code: [Select]
/var/www/awstats.pl

how did you install awstats?
what cron are you talking about?

Quote
and in file
Code: [Select]
/home/e-smith/awstats/qmail-preprocessor.sh this:
/bin/cat $SRC /var/log/qmail/current | /usr/local/bin/tai64nlocal | /usr/bin/perl /usr/bin/maillogconvert.pl standard | /bin/grep -v ' alias-localdelivery-'

where does that file come from?
what's the output of
Code: [Select]
rpm -qf /home/e-smith/awstats/qmail-preprocessor.sh
?


Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Awstats cron error
« Reply #7 on: August 13, 2010, 09:42:32 PM »
how did you install awstats?
I think I installed AWStats and later awstats-qmail
get a problem, remove awstats, reinstall awstast using yum command from wiki, reinstall awstats-qmail as per wiki page.

Quote
what cron are you talking about?
I found one line at crontab file...not sure from where it came :$

Quote
where does that file come from?
what's the output of

Code: [Select]
rpm -qf /home/e-smith/awstats/qmail-preprocessor.sh
?

[root@marreco ~]# rpm -qf /home/e-smith/awstats/qmail-preprocessor.sh
file /home/e-smith/awstats/qmail-preprocessor.sh is not owned by any package
[root@marreco ~]#



BTW: I´m still getting error messages:
Code: [Select]
/usr/bin/test: too many arguments
ARGH!
...

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Awstats cron error
« Reply #8 on: August 13, 2010, 10:36:23 PM »
I think I installed AWStats and later awstats-qmail
get a problem, remove awstats, reinstall awstast using yum command from wiki, reinstall awstats-qmail as per wiki page.

I found one line at crontab file...not sure from where it came :$

Code: [Select]
rpm -qf /home/e-smith/awstats/qmail-preprocessor.sh
?

[root@marreco ~]# rpm -qf /home/e-smith/awstats/qmail-preprocessor.sh
file /home/e-smith/awstats/qmail-preprocessor.sh is not owned by any package
[root@marreco ~]#



BTW: I´m still getting error messages:
Code: [Select]
/usr/bin/test: too many arguments
ARGH!

- remove awstats ad install smeserver-awstats contrib: this should solve the first issue
- the wrong path in mweinber script is due to the fact he was using SF awstats rpm. I will contact him..

Offline Elliott

  • ****
  • 150
  • +0/-0
Re: Awstats cron error
« Reply #9 on: April 06, 2011, 10:55:52 PM »
So I am having the same error come up after the most recent updates. I see the same

/bin/bash: /usr/local/awstats/wwwroot/cgi-bin/awstats.pl: No such file or directory

Come up every hour.

I uninstalled the manual AWSTATS rpm that I had installed and then I installed the contribs version ala:

    yum --enablerepo=smecontribs install smeserver-awstats

Yet the errors continue. What was the solution for this scenario?
Elliott

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Awstats cron error
« Reply #10 on: April 06, 2011, 11:09:39 PM »
re-read carefully this message, all you need is there :-)

Offline Elliott

  • ****
  • 150
  • +0/-0
Re: Awstats cron error
« Reply #11 on: April 13, 2011, 10:04:00 PM »
re-read carefully this message, all you need is there :-)

I believe that I have done what that message is indicating. I say I believe because I think I understand what he is saying to do. What I did was edit /etc/cron.hourly/00awstats as indicated.

I also edited /home/e-smith/awstats/qmail-preprocessor.sh and replaced what was in there with what is in boldface in the message you are referring to.

I am still getting the messages every hour. Does this require a reboot or the restarting of any services?

Thanks,
E
« Last Edit: April 13, 2011, 10:06:17 PM by Elliott »
Elliott

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Awstats cron error
« Reply #12 on: April 13, 2011, 10:13:29 PM »
try to restart crond

Code: [Select]
service crond restart

Offline Elliott

  • ****
  • 150
  • +0/-0
Re: Awstats cron error
« Reply #13 on: April 13, 2011, 10:49:37 PM »
I have 2 SME's both with this issue. One, I restated cron. The other I fully rebooted.

Both are still sending the error.

Anything else to try?
Elliott

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Awstats cron error
« Reply #14 on: April 13, 2011, 11:02:22 PM »
I have 2 SME's both with this issue. One, I restated cron. The other I fully rebooted.

Both are still sending the error.

Anything else to try?

open a bug in bugzilla and report here the reference, thank you

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Awstats cron error
« Reply #15 on: April 13, 2011, 11:26:40 PM »
I believe that I have done what that message is indicating. I say I believe because I think I understand what he is saying to do. What I did was edit /etc/cron.hourly/00awstats as indicated.


Hum...to me that´s on other file:
Code: [Select]
[root@marreco ~]# grep awstats /etc/crontab
45 */1 * * * root /var/www/awstats/awstats.pl -update -config=mail >/dev/null
[root@marreco ~]#
...

Offline Elliott

  • ****
  • 150
  • +0/-0
Re: Awstats cron error
« Reply #16 on: April 14, 2011, 05:07:08 PM »
Bug 6594 opened (hopefully in the correct place as I have a history of making mistakes in there  :? )

http://bugs.contribs.org/show_bug.cgi?id=6594
Elliott

Offline Elliott

  • ****
  • 150
  • +0/-0
Re: Awstats cron error
« Reply #17 on: April 14, 2011, 07:22:10 PM »
Hum...to me that´s on other file:
Code: [Select]
[root@marreco ~]# grep awstats /etc/crontab
45 */1 * * * root /var/www/awstats/awstats.pl -update -config=mail >/dev/null
[root@marreco ~]#

I thought in this build that crontab was built from templates somewhere. Are you saying that I need to edit crontab directly?
Elliott

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Awstats cron error
« Reply #18 on: April 14, 2011, 07:25:20 PM »
YES!
I´m saying you should TEST it by direct edit crontab file.
If it works for you, edit template files to reflect that.

Test directly on file allow you to have a QUICK return and to get back (just generate file again by expand-templates!)

« Last Edit: April 14, 2011, 07:34:53 PM by jader »
...

Offline Elliott

  • ****
  • 150
  • +0/-0
Re: Awstats cron error
« Reply #19 on: April 14, 2011, 07:30:37 PM »
So at this point, on my testing machine I have edited the awstats template to reflect the desired path change.

I have typed:
Code: [Select]
expand-template /etc/crontab
and then I type:
Code: [Select]
service crond restart
In 15 minutes (45 after the hour) I shall see if we have a winner!

Thanks!

-E
« Last Edit: April 14, 2011, 07:51:36 PM by Elliott »
Elliott

Offline Elliott

  • ****
  • 150
  • +0/-0
Re: Awstats cron error
« Reply #20 on: April 14, 2011, 07:45:54 PM »
Bingo! I only received the error from the production server this hour.

Thanks!

-E
Elliott

Offline Bozely

  • *
  • 75
  • +0/-0
Re: Awstats cron error
« Reply #21 on: May 11, 2011, 03:01:55 PM »
What is the template file location that is required to be amended to sort out this problem?

Sorry if I have missed it but i've check every file mentioned in this post and made the necessary amendments and expanded templates but no change.

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Awstats cron error
« Reply #22 on: May 11, 2011, 04:29:41 PM »
What is the template file location that is required to be amended to sort out this problem?

Sorry if I have missed it but i've check every file mentioned in this post and made the necessary amendments and expanded templates but no change.

Please read the thread... just change the REAL files BEFORE... test it. There are instructions written by myself above.

Once the problem is solved, you´ll edit the template files. To understand template scheme read the docs.

Jáder

...

Offline Bozely

  • *
  • 75
  • +0/-0
Re: Awstats cron error
« Reply #23 on: May 12, 2011, 01:11:27 PM »
"Read the docs"! Teach a man how to fish eh? Well I caught some fish and i'm willing to share mine.

If your happy it works edit the template file found in the following location.

Code: [Select]
pico /etc/e-smith/templates-custom/etc/crontab/awstats
Expand your templates and restart the service as mentioned above.

As a side note, sometimes it's nice to just read a post that covers a problem from top to bottom with straight answers not just regarding the problem itself but the to niggly questions too. I get this whole principle of helping people help themselves and agree to some extent but the net effect in most cases of not providing answers to small questions/details in posts is potentially a bunch of confused newbies forever asking silly questions (like me) creating LOTS of irritating posts for all the clever people to waste time offering variations of "self help" advice on, where as if I had found the above info in the thread I would never have posted and surely in the grand scheme of things everybody would save time? hmmmm  :?
« Last Edit: May 12, 2011, 01:16:14 PM by Bozely »