Awstats stderr solution


 
Thread Tools Search this Thread
Operating Systems BSD Awstats stderr solution
# 1  
Old 08-19-2008
Awstats stderr solution

Hello!

Firts of all, sorry fo my poor english, but i hope you'll undestand me Smilie

Ok, let's go to the problem....

I have a lot of awstats crontabs, and i have one mail,where i get daily and weekly output of all servers that i administrate, now it's problem that i get to his mail every time, when crontab for awstats is started.

I was searching on google so long, but i did't find any fine solution too me, because i don't want to use this in the end of crontab -> CRON >/dev/null 2>&1
because this will email me only if file won't exist anymore.

Finally, i want that crontab for awstats send me email just in case if awstats don't update correcly.

Thank you very much!

Regards
# 2  
Old 08-21-2008
So is there a program or script named "awstats" which is in a crontab? Let's say you have this job running every day at 2:30 am.

Code:
2  30  * * * /usr/local/bin/awstats

If you want it to only email you when there's a problem, just do this:
Code:
2  30  * * * /usr/local/bin/awstats >/dev/null 2>&1 || echo "awstats failed to complete"

This does require that the script exit with a non-zero condition upon an error. Do you have a way of testing this?
# 3  
Old 08-21-2008
Hmmm.... maybe this'll work, buti don't know if this will alert me, if config file doesn't exit and if update wasn't successfully made?
# 4  
Old 08-22-2008
Test it. Run awstats and force an error condition (one way is to kill the process from another terminal). Then in the command prompt after awstats returns, run
Code:
echo $?

If it exited with a non-zero, cron will email you. Make sure cron CAN email you.
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Infrastructure Monitoring

Awstats webserver analyser

Need assistance in troubleshooting I have configured awstats 7.3 version on RedHat linux and I am stuck at getting the updates from the website . Please let me know if anybody can give me some inputs I can see the webpages but it gives "Never updated (See 'Build/Update' on awstats_setup.html... (2 Replies)
Discussion started by: ajayram_arya
2 Replies

2. Web Development

AWstats - Installation

Hi Gurus, I was trying to install AWstats in one of my EL5 boxes and got the below error: # rpm -i awstats-7.0-1.noarch.rpm error: Failed dependencies: perl(LWP::UserAgent) is needed by awstats-7.0-1.noarch # rpm -i perl-Test-Mock-LWP-0.05-1.el6.rf.noarch.rpm warning:... (1 Reply)
Discussion started by: Hari_Ganesh
1 Replies

3. BSD

can't install AWStats

I am running FreeBSD 6.3 and trying to install AWStats. I found this site with some instructions: Installing AWStats on FreeBSD however, the pkg install doesn't work. This is the error I get: dl1-3# pkg_add install -r awstats pkg_add: can't stat package file 'install' pkg_add: can't stat... (3 Replies)
Discussion started by: jasonfrost
3 Replies
Login or Register to Ask a Question