SMART disk Monitoring Scheme
The use of smartctl command line.
Command line instructions:
At present, all the servers we use have lsi raid cards. When using smartctl when the disk is SAS disk, you need to add:
Smartctl-d megaraid,$deviceid / dev/$diskname
When using smartctl when the disk is SATA disk, you need to add:
Smartctl-d sat+megaraid,$deviceid / dev/$diskname
You can use the raid card tool to view the disk interface type
Megacli-cfgdsply-aall | grep'PD TYPE'
If you do not use a raid card, you do not need to add the-d parameter.
Command line return value
After the execution of smartctl is finished, you can start from $? Shell variable to get the return value, if the disk is completely normal, the return value is 0, otherwise set the corresponding bit bit according to the error type.
The description of each bit is as follows:
Bit 0: Command line did not parse. Bit 1: Device open failed, device did not return an IDENTIFY DEVICE structure, or device is in a low-power mode (see-n option above). Bit 2: Some SMART or other ATA command to the disk failed, or there was a checksum error in a SMART data structure (see-b option above). Bit 3: SMART status check returned "DISK FAILING". Bit 4: We found prefail Attributes