Module: check_mk
Branch: master
Commit: 44f1946652558ae9e44a9c87f2c17a046a87b4fa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=44f1946652558a…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Tue Jan 10 11:08:33 2012 +0100
Linux agent: normalize MegaClis device encoding before sending to server (Thanks to Vaclav
Ovsik)
---
agents/check_mk_agent.linux | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 0745ecc..649d6fc 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -268,9 +268,10 @@ fi
if which MegaCli >/dev/null ; then
echo '<<<megaraid_pdisks>>>'
- for part in $(MegaCli -EncInfo -aALL -NoLog < /dev/null | egrep
'Enclosure|Device ID'); do
- [ $part == 'Enclosure' ] && echo -ne "\ndev2enc"
- echo -n " ${part//:/}"
+ for part in $(MegaCli -EncInfo -aALL -NoLog < /dev/null \
+ | sed -rn 's/:/ /g; s/[[:space:]]+/ /g; s/^ //; s/ $//; /^(Enclosure|Device
ID) [0-9]+$/ p'); do
+ [ $part = 'Enclosure' ] && echo -ne "\ndev2enc"
+ echo -n " $part"
done
echo
MegaCli -PDList -aALL -NoLog < /dev/null | egrep 'Enclosure|Raw Size|Slot
Number|Device Id|Firmware state|Inquiry'