Module: check_mk
Branch: master
Commit: 3e929ad7da53c06074b9030092a8adbe00868ecf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e929ad7da53c0…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Dec 8 13:21:26 2015 +0100
smart: extended detection for MegCli. Thanks to Thomas Mittmann
---
agents/plugins/smart | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/agents/plugins/smart b/agents/plugins/smart
index 1a0f250..03c5baf 100755
--- a/agents/plugins/smart
+++ b/agents/plugins/smart
@@ -32,7 +32,12 @@
megaraid_info()
{
- PDINFO=$(MegaCli -PDlist -a0)
+ #PDINFO=$(MegaCli -PDlist -a0)
+ if [ -z "$1" ]; then
+ PDINFO=$(megacli -PDlist -a0)
+ else
+ PDINFO=$($1 -PDlist -a0)
+ fi
echo "$PDINFO" | \
while read line ; do
@@ -154,8 +159,19 @@ if which smartctl > /dev/null 2>&1 ; then
# Call MegaRaid submodule if conditions are met
- if which MegaCli > /dev/null && [ -c /dev/sg0 ] ; then
- megaraid_info
+ if type MegaCli >/dev/null ; then
+ MegaCli_bin="MegaCli"
+ elif type MegaCli64 >/dev/null ; then
+ MegaCli_bin="MegaCli64"
+ elif type megacli >/dev/null ; then
+ MegaCli_bin="megacli"
+ else
+ MegaCli_bin="unknown"
+ fi
+
+ if [ "$MegaCli_bin" != "unknown" ]; then
+ megaraid_info "$MegaCli_bin"
fi
+
fi