log1 and nagios cron alerts

Jon Stanley jonstanley at gmail.com
Sun Nov 9 02:43:28 UTC 2008


This should prevent us from executing the same awstats analysis at the
same time, thereby eliminating the nagios alerts for crond on log1.
Since I'm not in sysadmin-web, I don't feel real comfortable deploying
this without someone telling me it's OK and that it looks sane :)

diff --git a/modules/awstats/templates/awstats.cron.erb
b/modules/awstats/templates/awstats.cron.erb
index 7e41be0..7ea507b 100755
--- a/modules/awstats/templates/awstats.cron.erb
+++ b/modules/awstats/templates/awstats.cron.erb
@@ -1,6 +1,12 @@
 #!/bin/bash

 # <%= name %>
+
+if [ -e /var/run/<%=name>.awstats.lock ] ; do
+   exit 1
+fi
+
+touch /var/run/<%= name%>.awstats.lock
 mkdir -p /srv/web/awstats/<%= name %>

 /usr/share/awstats/tools/awstats_buildstaticpages.pl \




More information about the infrastructure mailing list