[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

log1 and nagios cron alerts



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 \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]