summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2012-12-01 16:02:55 +0100
committerHolger Levsen <holger@layer-acht.org>2012-12-01 16:02:55 +0100
commita085f800dfa6272f23e10663ea26064822f449d0 (patch)
tree0d51d45539d71c3981ee73a9eabdc9af072cb429
parentf95a0ca45e12303fda54686fd77badfc4e2d0bd7 (diff)
downloadjenkins.debian.net-a085f800dfa6272f23e10663ea26064822f449d0.tar.xz
fixup: save state in statefiles and update them every 30min
-rw-r--r--etc/cron.d/jenkins-munin-plugin8
-rwxr-xr-xetc/munin/plugins/jenkins_builds3
-rwxr-xr-xetc/munin/plugins/jenkins_builds_results3
-rwxr-xr-xetc/munin/plugins/jenkins_jobs3
4 files changed, 6 insertions, 11 deletions
diff --git a/etc/cron.d/jenkins-munin-plugin b/etc/cron.d/jenkins-munin-plugin
deleted file mode 100644
index 80d5fe6e..00000000
--- a/etc/cron.d/jenkins-munin-plugin
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# cron-jobs for jenkins munin plugins
-#
-
-MAILTO=root
-
-5,35 * * * * root cd /etc/munin/plugins/ ; for plugin in jenkins* ; do /usr/sbin/munin-run $plugin update ; done
-
diff --git a/etc/munin/plugins/jenkins_builds b/etc/munin/plugins/jenkins_builds
index 00d1342b..24480de2 100755
--- a/etc/munin/plugins/jenkins_builds
+++ b/etc/munin/plugins/jenkins_builds
@@ -35,7 +35,8 @@ if [ -f $STATEFILE ] && [ "$1" = "" ] ; then
exit 0
fi
-if [ "$1" = "update" ] ; then
+# delete statefile if it's older than 30min
+if test `find $STATEFILE -mmin +30`
rm -f $STATEFILE
fi
diff --git a/etc/munin/plugins/jenkins_builds_results b/etc/munin/plugins/jenkins_builds_results
index d38eb678..26dd2e34 100755
--- a/etc/munin/plugins/jenkins_builds_results
+++ b/etc/munin/plugins/jenkins_builds_results
@@ -35,7 +35,8 @@ if [ -f $STATEFILE ] && [ "$1" = "" ] ; then
exit 0
fi
-if [ "$1" = "update" ] ; then
+# delete statefile if it's older than 30min
+if test `find $STATEFILE -mmin +30`
rm -f $STATEFILE
fi
diff --git a/etc/munin/plugins/jenkins_jobs b/etc/munin/plugins/jenkins_jobs
index ee5e24aa..29898b1f 100755
--- a/etc/munin/plugins/jenkins_jobs
+++ b/etc/munin/plugins/jenkins_jobs
@@ -35,7 +35,8 @@ if [ -f $STATEFILE ] && [ "$1" = "" ] ; then
exit 0
fi
-if [ "$1" = "update" ] ; then
+# delete statefile if it's older than 30min
+if test `find $STATEFILE -mmin +30`
rm -f $STATEFILE
fi