Module: check_mk
Branch: master
Commit: fd750847eb5242a42ea71885ad0ac649c09d54fc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd750847eb5242…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Mar 8 14:32:30 2017 +0100
4489 FIX check_mk_agent.linux: Fixed group option, ie. newer ipmi-sensors versions have a
different group option, thus the section was empty.
Change-Id: I6d26c711acd0aecbe960a38e4403af0fa8855eca
---
.werks/4489 | 11 +++++++++++
agents/check_mk_agent.linux | 8 +++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/4489 b/.werks/4489
new file mode 100644
index 0000000..0834e82
--- /dev/null
+++ b/.werks/4489
@@ -0,0 +1,11 @@
+Title: check_mk_agent.linux: Fixed group option, ie. newer ipmi-sensors versions have a
different group option, thus the section was empty.
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.4.0b4
+Date: 1488979535
+
+
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 4d261ab..5b5c748 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -435,10 +435,16 @@ then
else
IPMI_FORMAT=""
fi
+ if ipmi-sensors --help | grep -q " \-\-groups"; then
+ IPMI_GROUP_OPT="-g"
+ else
+ IPMI_GROUP_OPT="-t"
+ fi
+
# At least with ipmi-sensors 0.7.16 this group is Power_Unit instead of "Power
Unit"
run_cached -s ipmi_sensors 300 "for class in Temperature Power_Unit Fan
do
- ipmi-sensors $IPMI_FORMAT --sdr-cache-directory /var/cache -g "$class"
| sed -e 's/ /_/g' -e 's/:_\?/ /g' -e 's@ \([^(]*\)_(\([^)]*\))@
\2_\1@'
+ ipmi-sensors $IPMI_FORMAT --sdr-cache-directory /var/cache $IPMI_GROUP_OPT
"$class" | sed -e 's/ /_/g' -e 's/:_\?/ /g' -e 's@
\([^(]*\)_(\([^)]*\))@ \2_\1@'
# In case of a timeout immediately leave loop.
if [ $? = 255 ] ; then break ; fi
done"