Module: check_mk
Branch: master
Commit: 454b81676bd68f5524fb19604781a2600ffc0607
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=454b81676bd68f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 30 10:31:27 2013 +0200
agent_ipmi: Added variant with free ipmi
---
doc/treasures/agent_ipmi | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/doc/treasures/agent_ipmi b/doc/treasures/agent_ipmi
old mode 100644
new mode 100755
index 7d814a3..060de9b
--- a/doc/treasures/agent_ipmi
+++ b/doc/treasures/agent_ipmi
@@ -8,12 +8,19 @@ USERNAME=$2
PASSWORD=$3
echo '<<<check_mk>>>'
-Version: ipmi 1.0
-AgentOS: iDrac
+echo 'Version: ipmi 1.0'
+echo 'AgentOS: IPMI'
-echo '<<<ipmi>>>'
-ipmitool -i lan -H "$HOST" -U "$USERNAME" -f "$PASSWORD"
sensor show 2>/dev/null \
- | grep -v 'command failed' \
- | sed -e 's/ *| */|/g' -e 's/ /_/g' -e
's/_*"'$'"//' -e 's/|/ /g' \
- | egrep -v '^[^ ]+ na ' \
- | grep -v ' discrete '"
+if which ipmi-sensors >/dev/null 2>&1
+then
+ echo '<<<ipmi_sensors>>>'
+ ipmi-sensors -h $1 -u $2 -p $3 -l USER -Q --ignore-not-available-sensors
--legacy-output \
+ | sed -e 's/ /_/g' -e 's/:_\?/ /g' -e 's@
\([^(]*\)_(\([^)]*\))@ \2_\1@'
+else
+ echo '<<<ipmi>>>'
+ ipmitool -i lan -H "$HOST" -U "$USERNAME" -f
"$PASSWORD" sensor show 2>/dev/null \
+ | grep -v 'command failed' \
+ | sed -e 's/ *| */|/g' -e 's/ /_/g' -e
's/_*"'$'"//' -e 's/|/ /g' \
+ | egrep -v '^[^ ]+ na ' \
+ | grep -v ' discrete '
+fi