]> git.openstreetmap.org Git - chef.git/commitdiff
Remove RRD dumps from Munin server
authorMatt Amos <zerebubuth@gmail.com>
Wed, 3 Jul 2019 10:29:50 +0000 (11:29 +0100)
committerMatt Amos <zerebubuth@gmail.com>
Wed, 3 Jul 2019 10:29:50 +0000 (11:29 +0100)
In #109 we added downloadable RRD dumps, which may or may not have been useful at the time. However, they've been broken for almost a year (since August 2018 by my reckoning) without anyone complaining. Except `cron`, which complains to me daily.

If, as it appears, it's not being used any more, then it seems we might as well turn it off.

cookbooks/munin/files/default/rrddump.sh [deleted file]
cookbooks/munin/recipes/server.rb
cookbooks/munin/templates/default/rrddump.cron.erb [deleted file]

diff --git a/cookbooks/munin/files/default/rrddump.sh b/cookbooks/munin/files/default/rrddump.sh
deleted file mode 100644 (file)
index 0894203..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-RRD_DIR=/var/lib/munin/openstreetmap
-DIR=`mktemp -d`
-DUMP_DIR=/srv/munin.openstreetmap.org/dumps
-TARGET_TGZ=`date "+munin-data-%Y-%m-%d.tar.gz"`
-KEEP_OLD_COUNT=3
-
-function cleanup {
-  rm -rf "$DIR"
-}
-
-trap cleanup EXIT
-
-set -e
-
-cd "$RRD_DIR"
-for f in *.rrd; do
-  rrdtool dump "$f" "$DIR/${f}.xml"
-  touch -r "$f" "$DIR/${f}.xml"
-done
-
-cd "$DIR"
-find -name "*.xml" -print0 | tar zcf "dump.tar.gz" --null -T -
-
-# if we got here, then the file was created okay so we're okay to delete any
-# old files.
-find "${DUMP_DIR}" -name "munin-data-*.tar.gz" -print0 | \
-    sort -z -r | \
-    tail -z -n "+${KEEP_OLD_COUNT}" | \
-    xargs --null rm -f
-
-mv dump.tar.gz "${DUMP_DIR}/${TARGET_TGZ}"
index 063f4dbc59d24a2060b54f4b29f73063918b80fb..a70ff14fe3307ee57b5359e65cf21189c7afe96f 100644 (file)
@@ -106,21 +106,6 @@ template "/etc/cron.daily/munin-backup" do
   mode 0o755
 end
 
-# simple shell script to dump RRD data to a file
-cookbook_file "/usr/local/bin/rrddump" do
-  source "rrddump.sh"
-  owner "root"
-  group "root"
-  mode 0o755
-end
-
-template "/etc/cron.d/rrddump" do
-  source "rrddump.cron.erb"
-  owner "root"
-  group "root"
-  mode 0o755
-end
-
 munin_plugin "munin_stats"
 munin_plugin "munin_update"
 munin_plugin "munin_rrdcached"
diff --git a/cookbooks/munin/templates/default/rrddump.cron.erb b/cookbooks/munin/templates/default/rrddump.cron.erb
deleted file mode 100644 (file)
index 33087c3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-MAILTO=zerebubuth@gmail.com
-# do the dump & cleanup in the early hours of the morning
-43 3 * * * www-data nice /usr/local/bin/rrddump