[omd-commits] OMD Git: omd: You can do etc/init.d/rrdcached flush now

git version control git at mathias-kettner.de
Mon Oct 27 11:37:20 CET 2014


Module:   omd
Branch:   master
Commit:   c365096f4c096190bd68d9b65d5da571ed233a02
URL:      http://omdistro.org/projects/omd/repository/revisions/c365096f4c096190bd68d9b65d5da571ed233a02

Author:   Mathias Kettner <mk at mathias-kettner.de>
Date:     Mon Oct 27 11:37:13 2014 +0100
Commiter: Mathias Kettner <mk at mathias-kettner.de>
Date:     Mon Oct 27 11:37:13 2014 +0100

You can do etc/init.d/rrdcached flush now

This triggers a global flush by issuing a FLUSHALL command
to the rrdcached. Beware:

1. This can lead to intense Disk O
2. This is an asynchronous command. The flushing will just be triggered. The
   script does not wait until the flush has finised.

---

 packages/rrdtool/skel/etc/init.d/rrdcached |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/packages/rrdtool/skel/etc/init.d/rrdcached b/packages/rrdtool/skel/etc/init.d/rrdcached
index 97153f1..d72816b 100644
--- a/packages/rrdtool/skel/etc/init.d/rrdcached
+++ b/packages/rrdtool/skel/etc/init.d/rrdcached
@@ -100,6 +100,17 @@ case "$1" in
 	echo "stopped"
 	exit 1
     ;;
+    flush)
+        echo -n 'Triggering global flush of rrdcached...'
+        result=$(echo 'FLUSHALL' | unixcat ~/tmp/run/rrdcached.sock)
+        if [ "$result" = "0 Started flush." ] ; then
+            echo "OK"
+            exit 0
+        else
+            echo Failed: $result
+            exit 1
+        fi
+    ;;
     *)
 	echo "Usage: $0 {start|stop|restart|reload|status}"
     ;;



More information about the omd-commits mailing list