@@ -1,8 +1,8 @@
#!/usr/bin/env bash
# Inventory System
# Author: Carsten Schoene
-# $LastChangedDate: 2015-08-06 12:05:21 +0200 (Thu, 06 Aug 2015) $
-# $Rev: 10469 $
+# $LastChangedDate: 2017-09-14 09:26:55 +0200 (Thu, 14 Sep 2017) $
+# $Rev: 11564 $
#
# Default options (can be changed by inventory-system.conf)
DEBUG="yes"
@@ -381,10 +381,15 @@
INSTMEM=`${CAT} /proc/meminfo | ${GREP} "^MemTotal:" | ${AWK} '{print int($2/1024)}'`
;;
*)
- for MODULE in `${DMIDECODE} -t memory | ${GREP} -E '\<Size:.*MB$' | ${GREP} -iv -E '(No Module Installed|Maximum)' | ${AWK} '{print $(NF-1)}'`
+ for MODULE in `${DMIDECODE} -t memory | ${GREP} -E '\<Size:.*[MG]B$' | ${GREP} -iv -E '(No Module Installed|Maximum)' | ${AWK} '{print $(NF-1)}'`
do
+ # if the module size is given in GB, multiply with 1024, 128GB is the maximum size per module which is currently (2017) available
+ if [ ${MODULE} -le 128 ] ; then
+ MODULE=`${EXPR} ${MODULE} \* 1024`
+ fi
INSTMEM=`${EXPR} ${INSTMEM} + ${MODULE}`
done
+
;;
esac
debug "SYSTEM-MEMORY: ${INSTMEM}"
|