Module: check_mk
Branch: master
Commit: e8ec677e60cd48f3a1c9c90094f1be345d83152b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e8ec677e60cd48…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Aug 24 16:26:53 2014 +0200
lnx_psperf: allow comments in config file
---
agents/plugins/.f12 | 2 +-
agents/plugins/lnx_psperf | 3 ++-
agents/plugins/mrpe_include | 53 -------------------------------------------
3 files changed, 3 insertions(+), 55 deletions(-)
diff --git a/agents/plugins/.f12 b/agents/plugins/.f12
index 2cdd4e4..5d08296 100755
--- a/agents/plugins/.f12
+++ b/agents/plugins/.f12
@@ -2,5 +2,5 @@
SITE=${SITE:-$(cat ../../.site 2>/dev/null || true)}
SITE=${SITE:-$(omd sites --bare | head -n 1)}
# sudo mkdir -p /usr/lib/check_mk_agent/plugins
-sudo install -m 755 * /usr/lib/check_mk_agent/plugins || true
+# sudo install -m 755 * /usr/lib/check_mk_agent/plugins || true
sudo install -m 755 * /omd/sites/$SITE/share/check_mk/agents/plugins
diff --git a/agents/plugins/lnx_psperf b/agents/plugins/lnx_psperf
index f29fd06..c0946d2 100755
--- a/agents/plugins/lnx_psperf
+++ b/agents/plugins/lnx_psperf
@@ -38,10 +38,11 @@
if [ -e "$MK_CONFDIR/psperf.cfg" ] ; then
echo '<<<ps>>>'
echo '[proc_stat]'
+ egrep -v '^[[:space:]]*(#|$)' "$MK_CONFDIR/psperf.cfg" | \
while read LINE
do
for pid in $(pgrep $LINE) ; do
cat /proc/$pid/stat
done
- done < "$MK_CONFDIR/psperf.cfg"
+ done
fi
diff --git a/agents/plugins/mrpe_include b/agents/plugins/mrpe_include
deleted file mode 100755
index 908418e..0000000
--- a/agents/plugins/mrpe_include
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-# +------------------------------------------------------------------+
-# | ____ _ _ __ __ _ __ |
-# | / ___| |__ ___ ___| | __ | \/ | |/ / |
-# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
-# | | |___| | | | __/ (__| < | | | | . \ |
-# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-# | |
-# | 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.
-
-# 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
-
-