[checkmk-commits] Check_MK Git: check_mk: Moved mrpe_include to deprecated plugins

Mathias Kettner mk at mathias-kettner.de
Sun Aug 24 16:27:20 CEST 2014


Module: check_mk
Branch: master
Commit: fc29ec635337ce31e3370869100152385eeeb46e
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fc29ec635337ce31e3370869100152385eeeb46e

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Sun Aug 24 16:27:11 2014 +0200

Moved mrpe_include to deprecated plugins

---

 .../deprecated/agents/plugins/mrpe_include         |   53 ++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/doc/treasures/deprecated/agents/plugins/mrpe_include b/doc/treasures/deprecated/agents/plugins/mrpe_include
new file mode 100755
index 0000000..908418e
--- /dev/null
+++ b/doc/treasures/deprecated/agents/plugins/mrpe_include
@@ -0,0 +1,53 @@
+#!/bin/bash
+# +------------------------------------------------------------------+
+# |             ____ _               _        __  __ _  __           |
+# |            / ___| |__   ___  ___| | __   |  \/  | |/ /           |
+# |           | |   | '_ \ / _ \/ __| |/ /   | |\/| | ' /            |
+# |           | |___| | | |  __/ (__|   <    | |  | | . \            |
+# |            \____|_| |_|\___|\___|_|\_\___|_|  |_|_|\_\           |
+# |                                                                  |
+# | Copyright Mathias Kettner 2014             mk at 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.
+
+# Note: This script is deprecated and has been replaced by the script runas
+# which is able to handle mrpe, local and plugin scripts
+
+echo '<<<mrpe>>>'
+grep -Ev '^[[:space:]]*($|#)' "$MK_CONFDIR/mrpe_include.cfg" | \
+while read user include
+do
+    if [ -f $include ] ; then
+        PREFIX=""
+        if [ "$user" != "-" ] ; then
+            PREFIX="su $user -c "
+        fi
+
+        grep -Ev '^[[:space:]]*($|#)' "$include" | \
+        while read descr cmdline
+        do
+            PLUGIN=${cmdline%% *}
+            if [ -n "$PREFIX" ] ; then
+                cmdline="$PREFIX\"$cmdline\""
+            fi
+            OUTPUT=$(eval "$cmdline")
+            echo -n "(${PLUGIN##*/}) $descr $? $OUTPUT" | tr \\n \\1
+            echo
+        done
+    fi
+done
+
+



More information about the checkmk-commits mailing list