Module: check_mk
Branch: master
Commit: c1aa50b1b9e73dcf92462dcf85daf6672d9505d4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c1aa50b1b9e73d…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Jan 23 15:11:56 2015 +0100
small skript to migrate rrd Databases when the service description has changed
---
doc/treasures/migrate_rrd.sh | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/doc/treasures/migrate_rrd.sh b/doc/treasures/migrate_rrd.sh
new file mode 100644
index 0000000..47d98ff
--- /dev/null
+++ b/doc/treasures/migrate_rrd.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+ALT=$1
+NEU=$2
+
+echo "Copying rrd data for service description $1 to a new name $2 ..."
+find ~/var/pnp4nagios/perfdata -name "$ALT"_\*.rrd | sed -re
"s,(/\S*/)$ALT\_(\S*).rrd,\1$ALT\_\2.rrd \1$NEU\_\2.rrd," | xargs -n 2 cp
+echo "...finished."