Module: check_mk
Branch: master
Commit: ee5d9926047375cb49f6efc399ea7c99c6302c7f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ee5d9926047375…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Apr 17 10:01:31 2011 +0200
smart-plugins: speed up by avoiding three processes
---
agents/plugins/smart | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/agents/plugins/smart b/agents/plugins/smart
index eda9307..220fef6 100755
--- a/agents/plugins/smart
+++ b/agents/plugins/smart
@@ -5,8 +5,8 @@ if which smartctl > /dev/null 2>&1 ; then
echo '<<<smart>>>'
for D in /dev/[sh]d[a-z] /dev/[sh]d[a-z][a-z]; do
N=${D##*/}
- VEND=$(cat /sys/block/$N/device/vendor | tr -d ' ')
- MODEL=$(cat /sys/block/$N/device/model | tr ' ' _ | sed
's/_*$//g')
+ VEND=$(tr -d ' ' < /sys/block/$N/device/vendor)
+ MODEL=$(sed -e 's/ /_/g' -e 's/_*$//g' <
/sys/block/$N/device/model)
smartctl -A $D | grep Always | sed "s|^|$D $VEND $MODEL |"
- done
+ done 2>/dev/null
fi