Module: check_mk
Branch: master
Commit: c719ad1122cfd5812beeb7d6ed960d383b2813cd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c719ad1122cfd5…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Feb 20 12:08:10 2014 +0100
check_mk_agent.solaris: report statgrab_mem section if solaris_mem section is missing
Some older solaris machines do not have /usr/bin/top, which is required by
<tt><<<solaris_mem>>></tt>.
In this case we report the deprecated (but still supported section)
<tt><<<statgrab_mem>>></tt>.
---
.werks/560 | 9 +++++++++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 10 +++++++---
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/560 b/.werks/560
new file mode 100644
index 0000000..8e04f47
--- /dev/null
+++ b/.werks/560
@@ -0,0 +1,9 @@
+Title: check_mk_agent.solaris: report statgrab_mem section if solaris_mem section is
missing
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1392894310
+Class: feature
+
+Some older solaris machines do not have /usr/bin/top, which is required by
<tt><<<solaris_mem>>></tt>.
+In this case we report the deprecated (but still supported section)
<tt><<<statgrab_mem>>></tt>.
diff --git a/ChangeLog b/ChangeLog
index 1647f07..4938048 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -92,6 +92,7 @@
* 0718 logwatch.ec: Optionally monitor the list of forwarded logfiles...
* 0556 esx_vsphere_counters.diskio: now also shows disk latency
* 0583 stulz_pump: now monitors the pumps rpm in precent of maximum and gathers
performance data
+ * 0560 check_mk_agent.solaris: report statgrab_mem section if solaris_mem section is
missing...
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 20a2c51..a1a328e 100644
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -158,9 +158,13 @@ then
grep "^$s\." /tmp/statgrab.$$ | cut -d. -f2-99 | sed 's/ *= */
/'
done
-# this info is already provided by solaris_mem
-# echo '<<<statgrab_mem>>>'
-# egrep "^(swap|mem)\." /tmp/statgrab.$$ | sed 's/ *= */ /'
+ # the <<<statgrab_mem>>> info is already provided by
<<<solaris_mem>>>
+ # However, we make an exception if /usr/bin/top is missing (required by solaris_mem)
+ if [ ! -x /usr/bin/top ]
+ then
+ echo '<<<statgrab_mem>>>'
+ egrep "^(swap|mem)\." /tmp/statgrab.$$ | sed 's/ *= */ /'
+ fi
[ -f /tmp/statgrab.$$ ] && rm -f /tmp/statgrab.$$
fi