Module: check_mk
Branch: master
Commit: ed9f19459f7b145d70d8d468f1ee171ce9f4be77
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ed9f19459f7b14…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Wed May 16 14:33:25 2012 +0200
HP-UX Agent Documentation updates
---
agents/hpux/statgrab | 2 +-
doc/agents/README.HP-UX | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/agents/hpux/statgrab b/agents/hpux/statgrab
index 0306a92..68311b9 100644
--- a/agents/hpux/statgrab
+++ b/agents/hpux/statgrab
@@ -1,7 +1,7 @@
#!/bin/sh
# this is for users who compiled statgrab on hp-ux.
-# note you'll need a 0.18 version, from their github page at
+# note you'll need a 0.18+ version, from their github page at
# https://github.com/i-scream/libstatgrab
# flags used for compiling - disable documentation, examples and set*id
diff --git a/doc/agents/README.HP-UX b/doc/agents/README.HP-UX
index 8c9e9c0..bea482f 100644
--- a/doc/agents/README.HP-UX
+++ b/doc/agents/README.HP-UX
@@ -46,3 +46,6 @@ inetd -c
# to verify configuration and / or check for issues, have a look at tcpdchk(1)
# http://nixdoc.net/man-pages/hp-ux/man1/tcpdchk.1.html
# but this might only work if you installed tcpwrappers, which is not commonple.
+
+
+# There's now a plugin for using libstatgrab like on Solaris/FreeBSD
Module: check_mk
Branch: master
Commit: 6e73f83246a6065437be76789edad69372820423
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6e73f83246a606…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Wed May 16 14:32:13 2012 +0200
Solaris Agent: Disable statgrab.net if run in a non-global Solaris Zone
---
agents/check_mk_agent.solaris | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 78c0ba2..1c6234a 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -27,8 +27,8 @@
export LC_ALL=C
unset LANG
-MK_LIBDIR="/to/be/changed"
-MK_CONFDIR="/to/be/changed"
+MK_LIBDIR="/usr/lib/check_mk_agent"
+MK_CONFDIR="/etc/check_mk"
export MK_LIBDIR MK_CONFDIR
# All executables in PLUGINSDIR will simply be executed and their
@@ -62,9 +62,23 @@ ps -A -o user,vsz,rss,pcpu,args | sed -e 1d -e 's/ *\([^ ]*\) *\([^ ]*\) *\([^ ]
# You need statgrab to be installed. You'll find it
# here: http://www.i-scream.org/libstatgrab/
-if statgrab const. cpu. disk. general. load. mem. net. page. proc. swap. user. > /tmp/statgrab.$$ 2>/dev/null
+
+# Only collect net stats if we are in a global zone
+statgrab_vars="const. cpu. disk. general. load. mem. page. proc. swap. user."
+statgrab_sections="proc cpu load disk page"
+if which zonename > /dev/null; then
+ if [ "`zonename`" = "global" ]; then
+ statgrab_vars="$statgrab_vars .net"
+ statgrab_sections"$statgrab_sections net"
+ fi
+else
+ statgrab_vars="$statgrab_vars .net"
+ statgrab_sections"$statgrab_sections net"
+fi
+
+if statgrab $stagrab_vars > /tmp/statgrab.$$ 2>/dev/null
then
- for s in proc cpu net load disk page
+ for s in $statgrab_sections
do
echo "<<<statgrab_$s>>>"
cat /tmp/statgrab.$$ | grep "^$s\." | cut -d. -f2-99 | sed 's/ *= */ /'
@@ -90,6 +104,11 @@ if [ -x /sbin/zpool ]; then
/sbin/zpool status -x
fi
+
+# TCP Connection stats
+echo '<<<tcp_conn_stats>>>'
+netstat -nafinet -P tcp | tail +5 | awk '{ c[$7]++; } END { for (x in c) { print x, c[x];}}'
+
if cd $PLUGINSDIR 2>/dev/null
then
for skript in `ls`