[checkmk-commits] Check_MK Git: check_mk: Agents HP-UX / Solaris / MacOS X - add debug support

git version control git at mathias-kettner.de
Tue Nov 20 13:41:18 CET 2012


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

Author: Florian Heigl <fh at mathias-kettner.de>
Date:   Tue Nov 20 13:41:11 2012 +0100

Agents HP-UX / Solaris / MacOS X - add debug support

---

 agents/check_mk_agent.hpux    |    9 ++++++++-
 agents/check_mk_agent.macosx  |   10 +++++++++-
 agents/check_mk_agent.solaris |    8 ++++++++
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/agents/check_mk_agent.hpux b/agents/check_mk_agent.hpux
index 20633cc..e822054 100755
--- a/agents/check_mk_agent.hpux
+++ b/agents/check_mk_agent.hpux
@@ -38,7 +38,14 @@ PLUGINSDIR=$MK_LIBDIR/plugins
 # refer to online documentation for details about local checks.
 LOCALDIR=$MK_LIBDIR/local
 
-exec <&- 2>/dev/null
+# close standard input (for security reasons) and stderr
+if [ "$1" = -d ]
+then
+    set -xv
+else
+    exec <&- 2>/dev/null
+fi
+
 
 echo '<<<check_mk>>>'
 echo Version: 1.2.1i3
diff --git a/agents/check_mk_agent.macosx b/agents/check_mk_agent.macosx
index a3f7793..2591196 100755
--- a/agents/check_mk_agent.macosx
+++ b/agents/check_mk_agent.macosx
@@ -33,6 +33,15 @@ unset LANG
 export MK_LIBDIR="/to/be/changed"
 export MK_CONFDIR="/to/be/changed"
 
+# close standard input (for security reasons) and stderr
+if [ "$1" = -d ]
+then
+    set -xv
+else
+    exec <&- 2>/dev/null
+fi
+
+
 echo '<<<check_mk>>>'
 echo Version: 1.2.1i3
 echo AgentOS: macosx
@@ -68,7 +77,6 @@ echo '<<<tcp_conn_stats>>>'
 ###############################
 # Things up for takers:
 ###############################
-# *Add agent debug mode
 # *OSX SW Raid status
 # *launchctl daemon status
 # *hw sensors, how to query them?
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index cb81488..5d369d0 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -40,6 +40,14 @@ PLUGINSDIR=$MK_LIBDIR/plugins
 # to online documentation for details.
 LOCALDIR=$MK_LIBDIR/local
 
+# close standard input (for security reasons) and stderr
+if [ "$1" = -d ]
+then
+    set -xv
+else
+    exec <&- 2>/dev/null
+fi
+
 echo '<<<check_mk>>>'
 echo Version: 1.2.1i3
 echo AgentOS: solaris



More information about the checkmk-commits mailing list