|
3 | 3 | # NVMe functionality added by Lukas de Boer <[email protected]>
|
4 | 4 | #
|
5 | 5 | # This script needs work:
|
6 |
| -# We assume Samsung SSDs or Intel SSDs |
7 |
| -# We assume 'Wear_Leveling_Count' or 'Media_Wearout_Indicator' (can be different for different manufacturers) |
| 6 | +# We assume Samsung SSDs, Intel SSDs or Micron SSDs |
| 7 | +# We assume 'Wear_Leveling_Count', 'Media_Wearout_Indicator' or |
| 8 | +# 'Percent_Lifetime_Remain' (can be different for different manufacturers) |
8 | 9 | #
|
9 | 10 | # According to http://www.anandtech.com/show/8239/update-on-samsung-850-pro-endurance-vnand-die-size
|
10 | 11 | # a drive should continue to work fine even when the value reaches 0, because:
|
@@ -49,7 +50,7 @@ PREFIX="SSD OK"
|
49 | 50 | TESTMODE=0
|
50 | 51 | DEBUG=0
|
51 | 52 | HAS_SSD=0
|
52 |
| -BRAND="SAMSUNG\|INTEL" |
| 53 | +BRAND="SAMSUNG\|INTEL\|MICRON" |
53 | 54 | WARNING=10
|
54 | 55 | CRITICAL=5
|
55 | 56 | NOSSD=0
|
@@ -96,7 +97,7 @@ case $i in
|
96 | 97 | echo -e ""
|
97 | 98 | echo -e "-c=, --card= Instead of autodetecting using lspci, set the card type. We accept \"lsi\", \"3ware\" and \"auto\" for now. Auto is autodetect"
|
98 | 99 | echo -e "-d=, --device= The blockdevice we should use for calling smartmontools. Can be any blockdevice in /dev, but is driver specific"
|
99 |
| - echo -e "-b=, --brand= The brand of SSD to search for. We accept \"samsung\" and \"intel\"" |
| 100 | + echo -e "-b=, --brand= The brand of SSD to search for. We accept \"samsung\", \"intel\" and \"micron\"" |
100 | 101 | echo -e ""
|
101 | 102 | echo -e "-d, --debug Enable debug output"
|
102 | 103 | echo -e "-t, --test Only test if there are SSDs present in the system. exits with 0 when found, 1 if not"
|
@@ -265,37 +266,37 @@ function checkDID () {
|
265 | 266 | fi
|
266 | 267 | temperature=$($NVMECLI smart-log "$d" | awk -F'[\t ]+' '/^temperature/ {print $3}')
|
267 | 268 | else
|
268 |
| - VALUE=$($SMARTCTL -A -d auto "$d" | awk '/^233/ || /^177/ { gsub ("^0*", "", $4); print $4}') |
| 269 | + VALUE=$($SMARTCTL -A -d auto "$d" | awk '/^233/ || /^177/ || /^202/ { gsub ("^0*", "", $4); print $4}') |
269 | 270 | fi
|
270 | 271 | else
|
271 | 272 | if [ "$DRIVER" = "megaraid" ]; then
|
272 | 273 | DRIVER="sat+megaraid"
|
273 | 274 | fi
|
274 |
| - VALUE=$(echo "$($SMARTCTL -A -d $DRIVER,"$d" "${BLOCKDEVICE[$1]}" | grep "^177\|^233" | head -n1 | awk '{ print $4 }')") |
| 275 | + VALUE=$(echo "$($SMARTCTL -A -d $DRIVER,"$d" "${BLOCKDEVICE[$1]}" | grep "^177\|^202\|^233" | head -n1 | awk '{ print $4 }')") |
275 | 276 | [ ! -z ${VALUE} ] && VALUE=$(echo ${VALUE} + 0 | bc)
|
276 | 277 | fi
|
277 | 278 |
|
278 | 279 | if [ ! -z ${VALUE} ]; then
|
279 | 280 | if [[ ${VALUE} -lt ${CRITICAL} ]]; then
|
280 |
| - MESSAGE+="Drive $d on $1 CRITICAL WLC/MWI ($VALUE). " |
| 281 | + MESSAGE+="Drive $d on $1 CRITICAL WLC/MWI/PLR ($VALUE). " |
281 | 282 | EXITCODE=2
|
282 | 283 | PREFIX="SSD CRITICAL"
|
283 | 284 | elif [[ ${VALUE} -lt ${WARNING} ]]; then
|
284 |
| - MESSAGE+="Drive $d on $1 MEDIUM WLC/MWI ($VALUE). " |
| 285 | + MESSAGE+="Drive $d on $1 MEDIUM WLC/MWI/PLR ($VALUE). " |
285 | 286 | if [ "$EXITCODE" -eq "0" ]; then
|
286 | 287 | EXITCODE=1
|
287 | 288 | PREFIX="SSD WARNING"
|
288 | 289 | fi
|
289 | 290 | else
|
290 |
| - MESSAGE+="Drive $d on $1 WLC/MWI $VALUE. " |
| 291 | + MESSAGE+="Drive $d on $1 WLC/MWI/PLR $VALUE. " |
291 | 292 | fi
|
292 | 293 | # ADD PERF DATA
|
293 | 294 | PERF_DATA+="Drive_${1}_${d}=${VALUE}% "
|
294 | 295 | if [ -n "$temperature" ] && [ "$temperature" -gt 0 ]; then
|
295 | 296 | PERF_DATA+="Drive_${1}_${d}_temp=$temperature "
|
296 | 297 | fi
|
297 | 298 | else
|
298 |
| - MESSAGE+="No WLC/MWI info found for drive ${d} on ${1}. " |
| 299 | + MESSAGE+="No WLC/MWI/PLR info found for drive ${d} on ${1}. " |
299 | 300 | EXITCODE=3
|
300 | 301 | PREFIX='UNKNOWN'
|
301 | 302 | fi
|
|
0 commit comments