Module: check_mk
Branch: master
Commit: 7ec90660efb92a479f4aa4ba54fe864cc1c154b3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7ec90660efb92a…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Wed May 16 08:26:16 2012 +0200
HP-UX Agent: Add plugin for statgrab support
---
agents/hpux/statgrab | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/agents/hpux/statgrab b/agents/hpux/statgrab
new file mode 100644
index 0000000..0306a92
--- /dev/null
+++ b/agents/hpux/statgrab
@@ -0,0 +1,25 @@
+#!/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
+#
https://github.com/i-scream/libstatgrab
+# flags used for compiling - disable documentation, examples and set*id
+
+
+if which statgrab > /dev/null ; then
+ # 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
+ then
+ for s in proc cpu net load disk page
+ do
+ echo "<<<statgrab_$s>>>"
+ cat /tmp/statgrab.$$ | grep "^$s\." | cut -d. -f2-99 | sed 's/
*= */ /'
+ done
+
+ echo '<<<statgrab_mem>>>'
+ cat /tmp/statgrab.$$ | egrep "^(swap|mem)\." | sed 's/ *= */
/'
+
+ fi
+ [ -f /tmp/statgrab.$$ ] && rm -f /tmp/statgrab.$$
+fi